openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goodenough <david.goodeno...@btconnect.com>
Subject Problem with Postgresql TIMESTAMP objects
Date Thu, 03 Apr 2008 20:46:01 GMT
In my application I am using an @Version field which is a timestamp.

I declare is (in Basic for those following the saga)

@Version @Temporal(TemporalType.TIMESTAMP) private Date version;

(and that is a java.util.Date, not a java.sql.Date).

But when loading the metadata for the classes it says:-

2019  bucksmusic  TRACE  [main] openjpa.MetaData -      Resolving 
field "uk.co.dga.bucksmusic.jpa.Role@28360136.version".
2019  bucksmusic  TRACE  [main] openjpa.MetaData -      "version" has mapping 
strategy "none".
2020  bucksmusic  TRACE  [main] openjpa.MetaData -      Resolving 
field "uk.co.dga.bucksmusic.jpa.Role@28360136.fullName".
2020  bucksmusic  TRACE  [main] openjpa.MetaData -      "fullName" has mapping 
strategy "org.apache.openjpa.jdbc.meta.strats.StringFieldStrategy".

So it has correctly identified fullName as being a String, but for
version the strategy is none, where is should be TimestampVersionStrategy
(I presume).

Is this something I have set up wrong?

If I try changing version to being an int, it works.  But I had thought from 
the manual that using a Date field was an option?

David

Mime
View raw message