On Friday 04 April 2008, Brill Pappin wrote: > Isn't type timestamp a long value? > > - Brill Pappin > > -----Original Message----- > From: David Goodenough [mailto:[EMAIL PROTECTED] > Sent: Thursday, April 03, 2008 4:46 PM > To: [email protected] > Subject: Problem with Postgresql TIMESTAMP objects > > 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 "[EMAIL PROTECTED]". > 2019 bucksmusic TRACE [main] openjpa.MetaData - "version" has > mapping > strategy "none". > 2020 bucksmusic TRACE [main] openjpa.MetaData - Resolving > field "[EMAIL PROTECTED]". > 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
No, the database schema that OpenJPA creates has an "abstime" column for this field. David
