类 VersionValue
- java.lang.Object
-
- org.hibernate.engine.spi.VersionValue
-
- 所有已实现的接口:
UnsavedValueStrategy
public class VersionValue extends Object implements UnsavedValueStrategy
A strategy for determining if a version value is a version of a new transient instance or a previously persistent transient instance. The strategy is determined by the unsaved-value attribute in the mapping file.- 作者:
- Gavin King
-
-
字段概要
字段 修饰符和类型 字段 说明 static VersionValueNEGATIVEAssume the transient instance is newly instantiated if the version is negative, otherwise assume it is a detached instance.static VersionValueNULLAssume the transient instance is newly instantiated if the version is null, otherwise assume it is a detached instance.static VersionValueUNDEFINEDAssume the transient instance is newly instantiated if the version is null, otherwise defer to the identifier unsaved-value.
-
构造器概要
构造器 限定符 构造器 说明 protectedVersionValue()VersionValue(Object value)Assume the transient instance is newly instantiated if its version is null or equal to value
-
-
-
字段详细资料
-
NULL
public static final VersionValue NULL
Assume the transient instance is newly instantiated if the version is null, otherwise assume it is a detached instance.
-
UNDEFINED
public static final VersionValue UNDEFINED
Assume the transient instance is newly instantiated if the version is null, otherwise defer to the identifier unsaved-value.
-
NEGATIVE
public static final VersionValue NEGATIVE
Assume the transient instance is newly instantiated if the version is negative, otherwise assume it is a detached instance.
-
-
构造器详细资料
-
VersionValue
protected VersionValue()
-
VersionValue
public VersionValue(Object value)
Assume the transient instance is newly instantiated if its version is null or equal to value- 参数:
value- value to compare to
-
-
方法详细资料
-
isUnsaved
public Boolean isUnsaved(Object version) throws MappingException
从接口复制的说明:UnsavedValueStrategyMake the transient/detached determination- 指定者:
isUnsaved在接口中UnsavedValueStrategy- 参数:
version- The value to be tested- 返回:
trueindicates the value corresponds to unsaved data (aka, transient state);falseindicates the value does not corresponds to unsaved data (aka, detached state);nullindicates that this strategy was not able to determine conclusively.- 抛出:
MappingException
-
getDefaultValue
public Object getDefaultValue(Object currentValue)
从接口复制的说明:UnsavedValueStrategyGet a default value meant to indicate transience.- 指定者:
getDefaultValue在接口中UnsavedValueStrategy- 参数:
currentValue- The current state value.- 返回:
- The default transience value.
-
-