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_mapping.xml
Log:
HHH-5205 Updated documentation about @Source
Modified:
core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml
===================================================================
---
core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml 2010-09-28
16:32:26 UTC (rev 20741)
+++
core/trunk/documentation/manual/src/main/docbook/en-US/content/basic_mapping.xml 2010-09-28
16:39:06 UTC (rev 20742)
@@ -2203,8 +2203,8 @@
<title>Timestamp</title>
<para>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.</para>
+ safe implementation of optimistic locking. However, sometimes an
+ application might use the timestamps in other ways as well.</para>
<para>Simply mark a property of type
<classname>Date</classname> or
<classname>Calendar</classname> as
@@ -2217,8 +2217,19 @@
public Date getLastUpdate() { ... }
} </programlisting>
- <para>Like version numbers, the timestamp can be generated by the
- database instead of Hibernate. To do that, use
+ <para>When using timestamp versioning you can tell Hibernate where to
+ retrieve the timestamp value from - database or JVM - by optionally
+ adding the <classname>(a)org.hibernate.annotations.Source</classname>
+ annotation to the property. Possible values for the value attribute of
+ the annotation are
+ <classname>org.hibernate.annotations.SourceType.VM</classname> and
+ <classname>org.hibernate.annotations.SourceType.DB</classname>. The
+ default is <classname>SourceType.DB</classname> which is also used
in
+ case there is no <classname>@Source</classname> annotation at all.
+ </para>
+
+ <para>Like in the case of version numbers, the timestamp can also be
+ generated by the database instead of Hibernate. To do that, use
<code>(a)org.hibernate.annotations.Generated(GenerationTime.ALWAYS).</code></para>
<para>In hbm.xml, use the
<literal><timestamp></literal>
Show replies by thread