Class GeneratedValuesProcessor
- java.lang.Object
-
- org.hibernate.metamodel.mapping.internal.GeneratedValuesProcessor
-
@Incubating public class GeneratedValuesProcessor extends Object
Responsible for retrieving database-generated attribute values after aninsert
orupdate
statement is executed.The values might have been retrieved early by an instance of
GeneratedValuesMutationDelegate
, which case thegeneratedValues
parameter ofprocessGeneratedValues(java.lang.Object, java.lang.Object, java.lang.Object[], org.hibernate.generator.values.GeneratedValues, org.hibernate.engine.spi.SharedSessionContractImplementor)
will already contain the values we need and this processor handles only thesetting of entity attributes
.Note that the primary key / id attribute is always handled by the delegate.
- See Also:
OnExecutionGenerator
-
-
Constructor Summary
Constructors Constructor Description GeneratedValuesProcessor(EntityPersister entityDescriptor, List<AttributeMapping> generatedAttributes, EventType timing, SessionFactoryImplementor sessionFactory)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description EntityMappingType
getEntityDescriptor()
static List<AttributeMapping>
getGeneratedAttributes(EntityMappingType entityDescriptor, EventType timing)
Find attributes generated by anOnExecutionGenerator
.List<AttributeMapping>
getGeneratedValuesToSelect()
JdbcParametersList
getJdbcParameters()
JdbcOperationQuerySelect
getJdbcSelect()
SelectStatement
getSelectStatement()
void
processGeneratedValues(Object entity, Object id, Object[] state, GeneratedValues generatedValues, SharedSessionContractImplementor session)
Obtain the generated values, and populate the snapshot and the fields of the entity instance.
-
-
-
Constructor Detail
-
GeneratedValuesProcessor
public GeneratedValuesProcessor(EntityPersister entityDescriptor, List<AttributeMapping> generatedAttributes, EventType timing, SessionFactoryImplementor sessionFactory)
-
-
Method Detail
-
getGeneratedAttributes
public static List<AttributeMapping> getGeneratedAttributes(EntityMappingType entityDescriptor, EventType timing)
Find attributes generated by anOnExecutionGenerator
.- Returns:
- a list of
AttributeMapping
s.
-
processGeneratedValues
public void processGeneratedValues(Object entity, Object id, Object[] state, GeneratedValues generatedValues, SharedSessionContractImplementor session)
Obtain the generated values, and populate the snapshot and the fields of the entity instance.
-
getSelectStatement
public SelectStatement getSelectStatement()
-
getGeneratedValuesToSelect
public List<AttributeMapping> getGeneratedValuesToSelect()
-
getJdbcParameters
public JdbcParametersList getJdbcParameters()
-
getEntityDescriptor
public EntityMappingType getEntityDescriptor()
-
getJdbcSelect
public JdbcOperationQuerySelect getJdbcSelect()
-
-