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, org.checkerframework.checker.nullness.qual.Nullable

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 @Nullable Object

Constructor Summary

AccessConstructor and Description
protected
public
IdentifierValue(Object 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 @Nullable Object
public @Nullable Boolean
isUnsaved(@Nullable Object id)

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 @Nullable Object value

Constructor Detail

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

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

Method Detail

getDefaultValueback to summary
public @Nullable Object getDefaultValue(@Nullable Object currentValue)
Annotations
@Override
isUnsavedback to summary
public @Nullable Boolean isUnsaved(@Nullable Object id)

Does the given identifier belong to a new instance?

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