org.hibernate.engine
Class VersionValue
java.lang.Objectorg.hibernate.engine.VersionValue
public class VersionValue
extends java.lang.Object
A strategy for determining if a version value is an 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.
static VersionValue | NEGATIVE- Assume the transient instance is newly instantiated if the version
is negative, otherwise assume it is a detached instance.
|
static VersionValue | NULL- Assume the transient instance is newly instantiated if the version
is null, otherwise assume it is a detached instance.
|
static VersionValue | UNDEFINED- Assume the transient instance is newly instantiated if the version
is null, otherwise defer to the identifier unsaved-value.
|
VersionValue()
|
VersionValue(Object value)- Assume the transient instance is newly instantiated if
its version is null or equal to 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.
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.
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
getDefaultValue
public Object getDefaultValue(Object currentValue)
isUnsaved
public Boolean isUnsaved(Object version)
throws MappingException Does the given version belong to a new instance?
version - version to check
- true is unsaved, false is saved, null is undefined
toString
public String toString()