Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 318532 - @ReturnUpdate does not return timestamps on dates
Summary: @ReturnUpdate does not return timestamps on dates
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P2 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-30 20:26 EDT by Tim Hollosy CLA
Modified: 2022-06-09 10:08 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Hollosy CLA 2010-06-30 20:26:44 EDT
Build Identifier: 

If you use @ReturnUpdate on a field that is a java.sql.Timestamp and the oracle datatype is Date, the timestamp portion is dropped.

James Sutherland summarized the problem on the mailing list here:

The issue is that the returned output parameters are retrieved using
Statement.getObject(), but on Oracle getObject() for the DATE type returns
java.sql.Date, getTimestamp() must be used to get the time portion.  This is
a bug in how EclipseLink retrieves the return row, it should instead be
using the same code used to access a ResultSet.  Please log a bug for this
an vote for it.


Reproducible: Always

Steps to Reproduce:
1. Create an oracle table with the type Date that is changed via an update trigger -- your standard modified_on column for example.
2. Map it to an entity field with a java.sql.Timestamp or java.util.Date with @TemporalType of Timestamp
3. Annotate it with @ReturnUpdate

Notice that when the date comes back it does not have the Timestmap, only the date portin.
Comment 1 Tom Ware CLA 2010-08-09 13:50:14 EDT
Setting target and priority.  See the following page for details of the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:08:25 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink