类 IdentifierValue
- java.lang.Object
-
- org.hibernate.engine.spi.IdentifierValue
-
- 所有已实现的接口:
UnsavedValueStrategy
public class IdentifierValue extends Object implements UnsavedValueStrategy
A strategy for determining if an identifier value is an identifier 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 IdentifierValueANYAlways assume the transient instance is newly instantiatedstatic IdentifierValueNONENever assume the transient instance is newly instantiatedstatic IdentifierValueNULLAssume the transient instance is newly instantiated if the identifier is null.static IdentifierValueUNDEFINEDAssume nothing.
-
构造器概要
构造器 限定符 构造器 说明 protectedIdentifierValue()IdentifierValue(Serializable value)Assume the transient instance is newly instantiated if its identifier is null or equal to value
-
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 SerializablegetDefaultValue(Object currentValue)Get a default value meant to indicate transience.BooleanisUnsaved(Object id)Does the given identifier belong to a new instance?StringtoString()
-
-
-
字段详细资料
-
ANY
public static final IdentifierValue ANY
Always assume the transient instance is newly instantiated
-
NONE
public static final IdentifierValue NONE
Never assume the transient instance is newly instantiated
-
NULL
public static final IdentifierValue NULL
Assume the transient instance is newly instantiated if the identifier is null.
-
UNDEFINED
public static final IdentifierValue UNDEFINED
Assume nothing.
-
-
构造器详细资料
-
IdentifierValue
protected IdentifierValue()
-
IdentifierValue
public IdentifierValue(Serializable value)
Assume the transient instance is newly instantiated if its identifier is null or equal to value
-
-
方法详细资料
-
isUnsaved
public Boolean isUnsaved(Object id)
Does the given identifier belong to a new instance?- 指定者:
isUnsaved在接口中UnsavedValueStrategy- 参数:
id- 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.
-
getDefaultValue
public Serializable getDefaultValue(Object currentValue)
从接口复制的说明:UnsavedValueStrategyGet a default value meant to indicate transience.- 指定者:
getDefaultValue在接口中UnsavedValueStrategy- 参数:
currentValue- The current state value.- 返回:
- The default transience value.
-
-