facebook

Temporal type doesn’t work correctly – truncates time

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

    Scott Dunbar
    Participant

    I’m reverse engineering a PostgreSQL database that has columns of type “timestamp”. These columns generate code such as:

    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "last_update", nullable = false, length = 29)
    public Timestamp getLastUpdate() {
        return this.lastUpdate;
    }

    However, it seems that reading or writing to these columns internally translates to a java.sql.Date somewhere as the time portion of the field is lost.

    If I manually remove the @Temporal tag the code works as expected.

    This is a Java 6, Hibernate backed environment running against Postgres 8.3. MyEclipse says it is Version 7.0, build id 7.0-20081201.

    Any thoughts?

    #294935

    Scott Dunbar
    Participant

    Please ignore this message – I messed up what is not working – we’re getting an exception from Hibernate instead – I’ll repost in a minute.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Temporal type doesn’t work correctly – truncates time

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