openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Goodenough <david.goodeno...@btconnect.com>
Subject Re: Problem with Postgresql TIMESTAMP objects
Date Fri, 04 Apr 2008 08:34:32 GMT
On Friday 04 April 2008, Brill Pappin wrote:
> Isn't type timestamp a long value?
>
> - Brill Pappin
>
> -----Original Message-----
> From: David Goodenough [mailto:david.goodenough@btconnect.com]
> Sent: Thursday, April 03, 2008 4:46 PM
> To: users@openjpa.apache.org
> 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 "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

No, the database schema that OpenJPA creates has an "abstime"
column for this field.

David

Mime
View raw message