Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to map java.util.Date field to a timestamp with time zone column?

800776Nov 8 2008 — edited Nov 28 2008
Hello!
In my entity class I have a Date field:
@Entity
public class Code implements Serializable 
{
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateFrom;
    //...
}
The field dateFrom is mapped to a column of SQL type TIMESTAMP WITHOUT TIME ZONE in my PostgreSQL database.
Is there any way to map it to TIMESTAMP WITH TIME ZONE column?
I need to store dates with timezone information, what is the most convenient way to do that?
Thank you.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 9 2008
Added on Nov 8 2008
4 comments
5,092 views