Hi all,
I am writing an application with uses JPA with GlassFish 3.1.2.2 and EclipseLink 2.3.2. I am using Oracle DB 11g and trying to store and retrieve date and times with timezone using the TIMESTAMPTZ field type.
When retrieving the data from the TIMESTAMPTZ, I am getting the following exception:
Exception [EclipseLink-3002] (Eclipse Persistence Services - 2.3.2.v20111125-r10461): org.eclipse.persistence.exceptions.ConversionException Exception Description: The object [oracle.sql.TIMESTAMPTZ@12cbe3f], of class [class oracle.sql.TIMESTAMPTZ], from mapping [org.eclipse.persistence.mappings.DirectToFieldMapping[startDateTime-->APPT_EVENT.START_DATE_TIME]] with descriptor [RelationalDescriptor(com.ntst.caremanager.server.entities.ApptEvent --> [DatabaseTable(APPT_EVENT)])], could not be converted to [class java.util.Date].
Has anyone ever encountered this before? This is how my the 'startDateTime' field in my entity class is set up:
@Column(name = "START_DATE_TIME")
@Temporal(TemporalType.TIMESTAMP)
private Date startDateTime;
I've also tried this without luck as well:
@Convert("timestamptz")
@TypeConverter(name="timestamptz", dataType=TIMESTAMPTZ.class)
@Column(name = "START_DATE_TIME")
@Temporal(TemporalType.TIMESTAMP)
private Date startDateTime;
I have read on the eclipselink wiki here, under the heading 'Support for oracle.sql.TimeStamp' that EclipseLink natively supports oracle's TIMESTAMPTZ without any conversion necessary. I have also tried using the 'Calendar' type instead of 'Date' time in my entity class without luck.
Has anyone seen this issue before, or see any error I may have made?
Thank you!