Top Description Constructors Methods
org.hibernate.engine.internal

public Class UnsavedValueFactory

extends Object
Class Inheritance
Imports
java.io.Serializable, java.lang.reflect.Constructor, org.hibernate.InstantiationException, .MappingException, org.hibernate.engine.spi.IdentifierValue, .VersionValue, org.hibernate.property.access.spi.Getter, org.hibernate.type.IdentifierType, .PrimitiveType, .Type, .VersionType

Helper for dealing with unsaved value handling
Author
Gavin King

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static IdentifierValue

Returns:

The appropriate IdentifierValue
getUnsavedIdentifierValue
(String
The mapping defined unsaved value
unsavedValue
,
Getter
The getter for the entity identifier attribute
identifierGetter
,
Type
The mapping type for the identifier
identifierType
,
Constructor<T>
The constructor for the entity
constructor
)

Return an IdentifierValue for the specified unsaved-value.

public static VersionValue

Returns:

The appropriate VersionValue
getUnsavedVersionValue
(String
The mapping defined unsaved value
versionUnsavedValue
,
Getter
The version attribute getter
versionGetter
,
VersionType<T>
The mapping type for the version
versionType
,
Constructor<T>
The constructor for the entity
constructor
)

Return an IdentifierValue for the specified unsaved-value.

private static Object

Returns:

The instantiated object
instantiate
(Constructor<T>
The constructor
constructor
)

Instantiate a class using the provided Constructor

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

UnsavedValueFactoryback to summary
private UnsavedValueFactory()

Method Detail

getUnsavedIdentifierValueback to summary
public static IdentifierValue getUnsavedIdentifierValue(String unsavedValue, Getter identifierGetter, Type identifierType, Constructor<T> constructor)

Return an IdentifierValue for the specified unsaved-value. If none is specified, guess the unsaved value by instantiating a test instance of the class and reading it's id property, or if that is not possible, using the java default value for the type

Parameters
unsavedValue:String

The mapping defined unsaved value

identifierGetter:Getter

The getter for the entity identifier attribute

identifierType:Type

The mapping type for the identifier

constructor:Constructor<T>

The constructor for the entity

Returns:IdentifierValue

The appropriate IdentifierValue

getUnsavedVersionValueback to summary
public static VersionValue getUnsavedVersionValue(String versionUnsavedValue, Getter versionGetter, VersionType<T> versionType, Constructor<T> constructor)

Return an IdentifierValue for the specified unsaved-value. If none is specified, guess the unsaved value by instantiating a test instance of the class and reading it's version property value, or if that is not possible, using the java default value for the type

Parameters
versionUnsavedValue:String

The mapping defined unsaved value

versionGetter:Getter

The version attribute getter

versionType:VersionType<T>

The mapping type for the version

constructor:Constructor<T>

The constructor for the entity

Returns:VersionValue

The appropriate VersionValue

instantiateback to summary
private static Object instantiate(Constructor<T> constructor)

Instantiate a class using the provided Constructor

Parameters
constructor:Constructor<T>

The constructor

Returns:Object

The instantiated object

Exceptions
InstantiationException:
if something went wrong