Top Description Fields Constructors Methods
org.hibernate.engine.spi

public Class IdentifierValue

extends Object
implements UnsavedValueStrategy
Class Inheritance
All Implemented Interfaces
org.hibernate.engine.spi.UnsavedValueStrategy
Imports
java.io.Serializable, org.hibernate.internal.CoreLogging, org.jboss.logging.Logger

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

Field Summary

Modifier and TypeField and Description
public static final IdentifierValue
ANY

Always assume the transient instance is newly instantiated

private static final Logger
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.

private final Serializable

Constructor Summary

AccessConstructor and Description
protected
public
IdentifierValue(Serializable value)

Assume the transient instance is newly instantiated if its identifier is null or equal to value

Method Summary

Modifier and TypeMethod and Description
public Serializable
getDefaultValue(Object
The current state value.
currentValue
)

Implements org.hibernate.engine.spi.UnsavedValueStrategy.getDefaultValue.

Get a default value meant to indicate transience.
public Boolean
isUnsaved(Object
The value to be tested
id
)

Implements org.hibernate.engine.spi.UnsavedValueStrategy.isUnsaved.

Does the given identifier belong to a new instance?
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

ANYback to summary
public static final IdentifierValue ANY

Always assume the transient instance is newly instantiated

LOGback to summary
private static final Logger LOG
NONEback to summary
public static final IdentifierValue NONE

Never assume the transient instance is newly instantiated

NULLback to summary
public static final IdentifierValue NULL

Assume the transient instance is newly instantiated if the identifier is null.

UNDEFINEDback to summary
public static final IdentifierValue UNDEFINED

Assume nothing.

valueback to summary
private final Serializable value

Constructor Detail

IdentifierValueback to summary
protected IdentifierValue()
IdentifierValueback to summary
public IdentifierValue(Serializable value)

Assume the transient instance is newly instantiated if its identifier is null or equal to value

Method Detail

getDefaultValueback to summary
public Serializable getDefaultValue(Object currentValue)

Implements org.hibernate.engine.spi.UnsavedValueStrategy.getDefaultValue.

Doc from org.hibernate.engine.spi.UnsavedValueStrategy.getDefaultValue.

Get a default value meant to indicate transience.

Parameters
currentValue:Object

The current state value.

Returns:Serializable

The default transience value.

Annotations
@Override
isUnsavedback to summary
public Boolean isUnsaved(Object id)

Implements org.hibernate.engine.spi.UnsavedValueStrategy.isUnsaved.

Does the given identifier belong to a new instance?

Parameters
id:Object

Doc from org.hibernate.engine.spi.UnsavedValueStrategy.isUnsaved.

The value to be tested

Returns:Boolean

Doc from org.hibernate.engine.spi.UnsavedValueStrategy.isUnsaved.

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.

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override