From hibernate-commits at lists.jboss.org Tue Sep 28 12:39:07 2010 Content-Type: multipart/mixed; boundary="===============9189703590703016095==" MIME-Version: 1.0 From: hibernate-commits at lists.jboss.org To: hibernate-commits at lists.jboss.org Subject: [hibernate-commits] Hibernate SVN: r20742 - core/trunk/documentation/manual/src/main/docbook/en-US/content. Date: Tue, 28 Sep 2010 12:39:06 -0400 Message-ID: <201009281639.o8SGd6kf002508@svn01.web.mwc.hst.phx2.redhat.com> --===============9189703590703016095== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Author: hardy.ferentschik Date: 2010-09-28 12:39:06 -0400 (Tue, 28 Sep 2010) New Revision: 20742 Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_map= ping.xml Log: HHH-5205 Updated documentation about @Source Modified: core/trunk/documentation/manual/src/main/docbook/en-US/content/ba= sic_mapping.xml =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_ma= pping.xml 2010-09-28 16:32:26 UTC (rev 20741) +++ core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_ma= pping.xml 2010-09-28 16:39:06 UTC (rev 20742) @@ -2203,8 +2203,8 @@ Timestamp = Alternatively, you can use a timestamp. Timestamps are a less - safe implementation of optimistic locking. However, sometimes the - application might use the timestamps in other ways. + safe implementation of optimistic locking. However, sometimes an + application might use the timestamps in other ways as well. = Simply mark a property of type Date or Calendar as @@ -2217,8 +2217,19 @@ public Date getLastUpdate() { ... } } = - Like version numbers, the timestamp can be generated by the - database instead of Hibernate. To do that, use + When using timestamp versioning you can tell Hibernate where= to + retrieve the timestamp value from - database or JVM - by optionally + adding the @org.hibernate.annotations.Source + annotation to the property. Possible values for the value attribut= e of + the annotation are + org.hibernate.annotations.SourceType.VM and + org.hibernate.annotations.SourceType.DB. The + default is SourceType.DB which is also used= in + case there is no @Source annotation at all. + + + Like in the case of version numbers, the timestamp can also = be + generated by the database instead of Hibernate. To do that, use @org.hibernate.annotations.Generated(GenerationTime.ALWAYS).= = In hbm.xml, use the <timestamp> --===============9189703590703016095==--