Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Temporal annotation acts differently than mapping?

Verify that it is using the orm.xml and not still the annotations.  Also
ensure that your orm.xml is correct.

You can enable the persistence property,
"eclipselink.orm.validate.schema"="true"

to have your orm.xml validated against the XML schema, to ensure it is
defined correctly.

If still having issues please include your orm.xml (or at least the full
mapping)



fcalfo wrote:
> 
> It appears that the temporal annotation provides different results than
> the temporal mapping.
> 
> I'm using EclipseLink 1.1 against Oracle 10g.
> 
> I have a table with a column defined as DATE
> 
> The corresponding attribute in my entity class is defined as a
> java.util.Date
> 
> When I map this attribute to the column via the
> @Temporal(TemporalType.DATE) annotation, 
> I expect to get a date with no time element and I do.
> 
> When I map this attribute to the column via the
> @Temporal(TemporalType.TIMESTAMP) annotation,
> I expect to get a date with the time element set and I do.
> 
> However, when I map this entity to the table via orm.xml mapping instead
> of annotations
> and associate the <temporal>TIMESTAMP</temporal> with the date attribute,
> the 
> date value populated by EclipseLink does not contain the time element as
> expected.
> 
> So it looks like the @Temporal(TemporalType.TIMESTAMP) is acting correctly
> but the <temporal>TIMESTAMP</temporal> does not act correctly.
> 
> What's up?
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://www.nabble.com/Temporal-annotation-acts-differently-than-mapping--tp23489987p23523530.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top