org.hibernate.engine
public class: VersionValue [javadoc |
source]
java.lang.Object
org.hibernate.engine.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 |
---|
public static final VersionValue | NULL | Assume the transient instance is newly instantiated if the version
is null, otherwise assume it is a detached instance. |
public static final VersionValue | UNDEFINED | Assume the transient instance is newly instantiated if the version
is null, otherwise defer to the identifier unsaved-value. |
public static final VersionValue | NEGATIVE | Assume the transient instance is newly instantiated if the version
is negative, otherwise assume it is a detached instance. |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.hibernate.engine.VersionValue Detail: |
public Object getDefaultValue(Object currentValue) {
return value;
}
|
public Boolean isUnsaved(Object version) throws MappingException {
if ( log.isTraceEnabled() ) log.trace("version unsaved-value: " + value);
return version==null || version.equals(value) ? Boolean.TRUE : Boolean.FALSE;
}
Does the given version belong to a new instance? |
public String toString() {
return "version unsaved-value: " + value;
}
|