public final class IdentifierGeneratorHelper extends Object
IdentifierGenerator
framework.Modifier and Type | Class and Description |
---|---|
static class |
IdentifierGeneratorHelper.BasicHolder |
static class |
IdentifierGeneratorHelper.BigDecimalHolder |
static class |
IdentifierGeneratorHelper.BigIntegerHolder |
Modifier and Type | Field and Description |
---|---|
static Serializable |
POST_INSERT_INDICATOR
Marker object returned from
IdentifierGenerator.generate(org.hibernate.engine.spi.SessionImplementor, java.lang.Object) to indicate that the entity's identifier will
be generated as part of the datbase insertion. |
static Serializable |
SHORT_CIRCUIT_INDICATOR
Marker object returned from
IdentifierGenerator.generate(org.hibernate.engine.spi.SessionImplementor, java.lang.Object) to indicate that we should short-circuit any
continued generated id checking. |
Modifier and Type | Method and Description |
---|---|
static Number |
createNumber(long value,
Class clazz)
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,
String identifier,
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,
String identifier,
Type type)
Get the generated identifier when using identity columns
|
static IntegralDataTypeHolder |
getIntegralDataTypeHolder(Class integralType) |
public static final Serializable SHORT_CIRCUIT_INDICATOR
IdentifierGenerator.generate(org.hibernate.engine.spi.SessionImplementor, java.lang.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 static final Serializable POST_INSERT_INDICATOR
IdentifierGenerator.generate(org.hibernate.engine.spi.SessionImplementor, java.lang.Object)
to indicate that the entity's identifier will
be generated as part of the datbase insertion.public static Serializable getGeneratedIdentity(ResultSet rs, String identifier, Type type) throws SQLException, HibernateException
rs
- The result set from which to extract the the generated identity.identifier
- The name of the identifier columntype
- The expected type mapping for the identity value.SQLException
- Can be thrown while accessing the result setHibernateException
- Indicates a problem reading back a generated identity value.public static Serializable get(ResultSet rs, String identifier, Type type) throws SQLException, IdentifierGenerationException
rs
- The result set from which to extract the value.identifier
- The name of the identifier columntype
- The expected type of the value.SQLException
- Indicates problems access the result setIdentifierGenerationException
- Indicates an unknown type.@Deprecated public static Number createNumber(long value, Class clazz) throws IdentifierGenerationException
holders
instead.value
- The primitive value to wrap.clazz
- The Java numeric type in which to wrap the value.IdentifierGenerationException
- Indicates an unhandled 'clazz'.public static IntegralDataTypeHolder getIntegralDataTypeHolder(Class integralType)
public static long extractLong(IntegralDataTypeHolder holder)
public static BigInteger extractBigInteger(IntegralDataTypeHolder holder)
public static BigDecimal extractBigDecimal(IntegralDataTypeHolder holder)
Copyright © 2016 JBoss by Red Hat. All rights reserved.