Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Trouble retrieving Oracle TIMESTAMPTZ type (Error retrieving timezone's from Oracle DB.)
Trouble retrieving Oracle TIMESTAMPTZ type [message #994151] Wed, 26 December 2012 09:55 Go to previous message
Wan Li is currently offline Wan Li
Messages: 4
Registered: December 2012
Junior Member
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!
 
Read Message
Read Message
Read Message
Previous Topic:JPA meta-model getJavaMember does not work with dynamic JPA
Next Topic:Bad EclipseLink JPA dependency
Goto Forum:
  


Current Time: Sat May 25 13:05:11 EDT 2013

Powered by FUDForum. Page generated in 0.01573 seconds