facebook

Changing @Temporal(TemporalType.DATE) to….

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #286597 Reply

    davidsos
    Member

    According to another post regarding changing @Temporal(TemporalType.DATE) to @Temporal(TemporalType.TIMESTAMP). When must you do this for what types?

    In my MySQL DDL I have the below defined that each maps to a JAVA DATE type in the reverse engineered POJO.

    DDL
    ===
    `Timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP,
    `StartTime` time NOT NULL default ’00:00:00′,

    Generated POJO
    =============
    private Date timestamp;
    private Date startTime;

    What is the correct Meta Data Tag for each type and required modification to that MyEclipse reverse engineers?

    #286668 Reply

    Brian Fernandes
    Moderator

    David,

    Use TemporalType.TIMESTAMP for your Timestamp field and TemporalType.TIME for the StartTime field. The Date type generated (private Date timestamp…) should be fine for both fields.

    Hope this helps.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Changing @Temporal(TemporalType.DATE) to….

You must be logged in to post in the forum log in