Class GeneratedValuesHelper
- java.lang.Object
-
- org.hibernate.generator.values.internal.GeneratedValuesHelper
-
@Internal public class GeneratedValuesHelper extends Object
Factory and helper methods forGeneratedValuesMutationDelegateframework.
-
-
Constructor Summary
Constructors Constructor Description GeneratedValuesHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static GeneratedValuesMappingProducercreateMappingProducer(EntityPersister persister, EventType timing, boolean supportsArbitraryValues, boolean supportsRowId)Utility method that instantiates aJdbcValuesMappingProducerso it can be cached by thedelegateswhen they are instantiated.static BasicValuedModelPartgetActualGeneratedModelPart(BasicValuedModelPart modelPart)static GeneratedValuesgetGeneratedValues(ResultSet resultSet, EntityPersister persister, EventType timing, WrapperOptions wrapperOptions)Reads thegenerated valuesfor the specifiedResultSet.static GeneratedValuesMutationDelegategetGeneratedValuesDelegate(EntityPersister persister, EventType timing)Creates thedelegateused to retrieve database generated values on mutation execution through e.g.static booleannoCustomSql(EntityPersister persister, EventType timing)
-
-
-
Method Detail
-
getGeneratedValues
public static GeneratedValues getGeneratedValues(ResultSet resultSet, EntityPersister persister, EventType timing, WrapperOptions wrapperOptions) throws SQLException
Reads thegenerated valuesfor 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 aJdbcValuesMappingProducerso it can be cached by thedelegateswhen 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 processrowidsfalseif 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 thedelegateused to retrieve database generated values on mutation execution through e.g.insert ... returningsyntax or the JDBCgetGeneratedKeys()API.If the current
Dialectdoesn't support any of the available delegates this method returnsnull.
-
noCustomSql
public static boolean noCustomSql(EntityPersister persister, EventType timing)
-
-