FileDocCategorySizeDatePackage
IdentifierValue.javaAPI DocHibernate 3.2.53007Sat Jun 04 23:31:34 BST 2005org.hibernate.engine

IdentifierValue

public class IdentifierValue extends Object
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.
author
Gavin King

Fields Summary
private static final Log
log
private final Serializable
value
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.
Constructors Summary
protected IdentifierValue()

	
	  
		this.value = null;
	
public IdentifierValue(Serializable value)
Assume the transient instance is newly instantiated if its identifier is null or equal to value

		this.value = value;
	
Methods Summary
public java.io.SerializablegetDefaultValue(java.io.Serializable currentValue)

		return value;
	
public java.lang.BooleanisUnsaved(java.io.Serializable id)
Does the given identifier belong to a new instance?

		if ( log.isTraceEnabled() ) log.trace("id unsaved-value: " + value);
		return id==null || id.equals(value) ? Boolean.TRUE : Boolean.FALSE;
	
public java.lang.StringtoString()

		return "identifier unsaved-value: " + value;