Package org.hibernate.id
Class IdentifierGeneratorHelper
- java.lang.Object
-
- org.hibernate.id.IdentifierGeneratorHelper
-
public final class IdentifierGeneratorHelper extends Object
Factory and helper methods forIdentifierGenerator
framework.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
IdentifierGeneratorHelper.BasicHolder
static class
IdentifierGeneratorHelper.BigDecimalHolder
static class
IdentifierGeneratorHelper.BigIntegerHolder
-
Field Summary
Fields Modifier and Type Field Description static Serializable
POST_INSERT_INDICATOR
Marker object returned fromIdentifierGenerator.generate(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
to indicate that the entity's identifier will be generated as part of the database insertion.static Serializable
SHORT_CIRCUIT_INDICATOR
Marker object returned fromIdentifierGenerator.generate(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
to indicate that we should short-circuit any continued generated id checking.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static BigDecimal
extractBigDecimal(IntegralDataTypeHolder holder)
static BigInteger
extractBigInteger(IntegralDataTypeHolder holder)
static long
extractLong(IntegralDataTypeHolder holder)
static Object
getGeneratedIdentity(String path, ResultSet resultSet, PostInsertIdentityPersister persister, WrapperOptions wrapperOptions)
Get the generated identifier when using identity columnsstatic IntegralDataTypeHolder
getIntegralDataTypeHolder(Class<?> integralType)
-
-
-
Field Detail
-
SHORT_CIRCUIT_INDICATOR
public static final Serializable SHORT_CIRCUIT_INDICATOR
Marker object returned fromIdentifierGenerator.generate(org.hibernate.engine.spi.SharedSessionContractImplementor, 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.
-
POST_INSERT_INDICATOR
public static final Serializable POST_INSERT_INDICATOR
Marker object returned fromIdentifierGenerator.generate(org.hibernate.engine.spi.SharedSessionContractImplementor, java.lang.Object)
to indicate that the entity's identifier will be generated as part of the database insertion.
-
-
Method Detail
-
getGeneratedIdentity
public static Object getGeneratedIdentity(String path, ResultSet resultSet, PostInsertIdentityPersister persister, WrapperOptions wrapperOptions) throws SQLException
Get the generated identifier when using identity columns- Parameters:
path
- TheNavigableRole.getFullPath()
resultSet
- The result set from which to extract the generated identitywrapperOptions
- The session- Returns:
- The generated identity value
- Throws:
SQLException
- Can be thrown while accessing the result setHibernateException
- Indicates a problem reading back a generated identity value.
-
getIntegralDataTypeHolder
public static IntegralDataTypeHolder getIntegralDataTypeHolder(Class<?> integralType)
-
extractLong
public static long extractLong(IntegralDataTypeHolder holder)
-
extractBigInteger
public static BigInteger extractBigInteger(IntegralDataTypeHolder holder)
-
extractBigDecimal
public static BigDecimal extractBigDecimal(IntegralDataTypeHolder holder)
-
-