public final class

IdentifierGeneratorHelper

extends Object
java.lang.Object
   ↳ org.hibernate.id.IdentifierGeneratorHelper

Class Overview

Factory and helper methods for IdentifierGenerator framework.

Summary

Nested Classes
class IdentifierGeneratorHelper.BasicHolder  
class IdentifierGeneratorHelper.BigDecimalHolder  
class IdentifierGeneratorHelper.BigIntegerHolder  
Fields
public static final Serializable POST_INSERT_INDICATOR Marker object returned from generate(SessionImplementor, Object) to indicate that the entity's identifier will be generated as part of the datbase insertion.
public static final Serializable SHORT_CIRCUIT_INDICATOR Marker object returned from generate(SessionImplementor, Object) to indicate that we should short-circuit any continued generated id checking.
Public Methods
static Number createNumber(long value, Class clazz)
This method is deprecated. Use the holders instead.
static BigDecimal extractBigDecimal(IntegralDataTypeHolder holder)
static BigInteger extractBigInteger(IntegralDataTypeHolder holder)
static long extractLong(IntegralDataTypeHolder holder)
static Serializable get(ResultSet rs, Type type)
Extract the value from the result set (which is assumed to already have been positioned to the apopriate row) and wrp it in the appropriate Java numeric type.
static Serializable getGeneratedIdentity(ResultSet rs, Type type)
Get the generated identifier when using identity columns
static IntegralDataTypeHolder getIntegralDataTypeHolder(Class integralType)
[Expand]
Inherited Methods
From class java.lang.Object

Fields

public static final Serializable POST_INSERT_INDICATOR

Marker object returned from generate(SessionImplementor, Object) to indicate that the entity's identifier will be generated as part of the datbase insertion.

public static final Serializable SHORT_CIRCUIT_INDICATOR

Marker object returned from generate(SessionImplementor, Object) to indicate that we should short-circuit any continued generated id checking. Currently this is only used in the case of the foreign generator as a way to signal that we should use the associated entity's id value.

Public Methods

public static Number createNumber (long value, Class clazz)

This method is deprecated.
Use the holders instead.

Wrap the given value in the given Java numeric class.

Parameters
value The primitive value to wrap.
clazz The Java numeric type in which to wrap the value.
Returns
  • The wrapped type.
Throws
IdentifierGenerationException Indicates an unhandled 'clazz'.

public static BigDecimal extractBigDecimal (IntegralDataTypeHolder holder)

public static BigInteger extractBigInteger (IntegralDataTypeHolder holder)

public static long extractLong (IntegralDataTypeHolder holder)

public static Serializable get (ResultSet rs, Type type)

Extract the value from the result set (which is assumed to already have been positioned to the apopriate row) and wrp it in the appropriate Java numeric type.

Parameters
rs The result set from which to extract the value.
type The expected type of the value.
Returns
  • The extracted value.
Throws
SQLException Indicates problems access the result set
IdentifierGenerationException Indicates an unknown type.

public static Serializable getGeneratedIdentity (ResultSet rs, Type type)

Get the generated identifier when using identity columns

Parameters
rs The result set from which to extract the the generated identity.
type The expected type mapping for the identity value.
Returns
  • The generated identity value
Throws
SQLException Can be thrown while accessing the result set
HibernateException Indicates a problem reading back a generated identity value.

public static IntegralDataTypeHolder getIntegralDataTypeHolder (Class integralType)