|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.hibernate.engine.spi.VersionValue
public class VersionValue
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.
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
protected |
VersionValue()
|
|
VersionValue(Object value)
Assume the transient instance is newly instantiated if its version is null or equal to value |
Method Summary | |
---|---|
Object |
getDefaultValue(Object currentValue)
Get a default value meant to indicate transience. |
Boolean |
isUnsaved(Object version)
Make the transient/detached determination |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final VersionValue NULL
public static final VersionValue UNDEFINED
public static final VersionValue NEGATIVE
Constructor Detail |
---|
protected VersionValue()
public VersionValue(Object value)
value
- value to compare toMethod Detail |
---|
public Boolean isUnsaved(Object version) throws MappingException
UnsavedValueStrategy
isUnsaved
in interface UnsavedValueStrategy
version
- The value to be tested
true
indicates the value corresponds to unsaved data (aka, transient state; false
indicates the value does not corresponds to unsaved data (aka, detached state); null
indicates that
this strategy was not able to determine conclusively.
MappingException
public Object getDefaultValue(Object currentValue)
UnsavedValueStrategy
getDefaultValue
in interface UnsavedValueStrategy
currentValue
- The current state value.
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |