可选的<timestamp>元素指明了表中包含时间戳数据。 这用来作为版本的替代。时间戳本质上是一种对乐观锁定的一种不是特别安全的实现。当然, 有时候应用程序可能在其他方面使用时间戳。
<timestamp>
<timestamp column="timestamp_column" name="propertyName" access="field|property|ClassName" unsaved-value="null|undefined" source="vm|db" generated="never|always" node="element-name|@attribute-name|element/@attribute|." />
column
name
Date
Timestamp
access
property
unsaved-value
null
undefined
source
vm
Dialect(方言)
generated
never
注意,<timestamp> 和<version type="timestamp">是等价的。并且<timestamp source="db">和<version type="dbtimestamp">是等价的。
<version type="timestamp">
<timestamp source="db">
<version type="dbtimestamp">