Class GeneratedValuesHelper
- java.lang.Object
-
- org.hibernate.generator.values.internal.GeneratedValuesHelper
-
@Internal public class GeneratedValuesHelper extends Object
Factory and helper methods forGeneratedValuesMutationDelegate
framework.
-
-
Constructor Summary
Constructors Constructor Description GeneratedValuesHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GeneratedValuesMappingProducer
createMappingProducer(EntityPersister persister, EventType timing, boolean supportsArbitraryValues, boolean supportsRowId)
Utility method that instantiates aJdbcValuesMappingProducer
so it can be cached by thedelegates
when they are instantiated.static BasicValuedModelPart
getActualGeneratedModelPart(BasicValuedModelPart modelPart)
static GeneratedValues
getGeneratedValues(ResultSet resultSet, EntityPersister persister, EventType timing, WrapperOptions wrapperOptions)
Reads thegenerated values
for the specifiedResultSet
.static GeneratedValuesMutationDelegate
getGeneratedValuesDelegate(EntityPersister persister, EventType timing)
Creates thedelegate
used to retrieve database generated values on mutation execution through e.g.static boolean
noCustomSql(EntityPersister persister, EventType timing)
-
-
-
Method Detail
-
getGeneratedValues
public static GeneratedValues getGeneratedValues(ResultSet resultSet, EntityPersister persister, EventType timing, WrapperOptions wrapperOptions) throws SQLException
Reads thegenerated values
for the specifiedResultSet
.- Parameters:
resultSet
- The result set from which to extract the generated valuespersister
- The entity type which we're reading the generated values forwrapperOptions
- The session- Returns:
- The generated values
- Throws:
SQLException
- Can be thrown while accessing the result setHibernateException
- Indicates a problem reading back a generated value
-
createMappingProducer
public static GeneratedValuesMappingProducer createMappingProducer(EntityPersister persister, EventType timing, boolean supportsArbitraryValues, boolean supportsRowId)
Utility method that instantiates aJdbcValuesMappingProducer
so it can be cached by thedelegates
when they are instantiated.- Parameters:
persister
- the current entity persistertiming
- the timing of the mutation operationsupportsArbitraryValues
- if we should process arbitrary (non-identifier) generated valuessupportsRowId
- if we should processrowid
sfalse
if we should retrieve the index through the column expression- Returns:
- the instantiated jdbc values mapping producer
-
getActualGeneratedModelPart
public static BasicValuedModelPart getActualGeneratedModelPart(BasicValuedModelPart modelPart)
-
getGeneratedValuesDelegate
public static GeneratedValuesMutationDelegate getGeneratedValuesDelegate(EntityPersister persister, EventType timing)
Creates thedelegate
used to retrieve database generated values on mutation execution through e.g.insert ... returning
syntax or the JDBCgetGeneratedKeys()
API.If the current
Dialect
doesn't support any of the available delegates this method returnsnull
.
-
noCustomSql
public static boolean noCustomSql(EntityPersister persister, EventType timing)
-
-