org.hibernate.engine
public class: IdentifierValue [javadoc |
source]
java.lang.Object
org.hibernate.engine.IdentifierValue
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.
Field Summary |
---|
public static final IdentifierValue | ANY | Always assume the transient instance is newly instantiated |
public static final IdentifierValue | NONE | Never assume the transient instance is newly instantiated |
public static final IdentifierValue | NULL | Assume the transient instance is newly instantiated if the identifier
is null. |
public static final IdentifierValue | UNDEFINED | Assume nothing. |
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from org.hibernate.engine.IdentifierValue Detail: |
public Serializable getDefaultValue(Serializable currentValue) {
return value;
}
|
public Boolean isUnsaved(Serializable id) {
if ( log.isTraceEnabled() ) log.trace("id unsaved-value: " + value);
return id==null || id.equals(value) ? Boolean.TRUE : Boolean.FALSE;
}
Does the given identifier belong to a new instance? |
public String toString() {
return "identifier unsaved-value: " + value;
}
|