Hibernate has the some different kind of tag in which we found the <version> element is optional and indicates that the table contains versioned data. <version> is particularly useful if you plan to use long transactions. See below for more information:
<version column="version_column" name="propertyName" type="typename" access="field|property|ClassName" unsaved-value="null|negative|undefined" generated="never|always" insert="true|false" node="element-name|@attribute-name|element/@attribute|." />
Tag |
Description |
column (optional) |
defaults to the property name. the name of the column holding the version number. |
Name |
the name of a property of the persistent class. |
type(optional) |
defaults to integer. the type of the version number. |
access(optional) |
defaults to property. the strategy Hibernate uses to access the property value. |
unsaved-value(optional) |
defaults to undefined a version property value that indicates that an instance is newly instantiated (unsaved), distinguishing it from detached instances that were saved or loaded in a previous session. Undefined specifies that the identifier property value should be used. |
Generated (optional) |
defaults to never specifies that this version property value is generated by the database. See the discussion of generated properties for more information. |
insert(optional) |
defaults to true. specifies whether the version column should be included in SQL insert statements. It can be set to false if the database column is defined with a default value of 0. |