Class EntityAuditSupport
Shared construction and binding support for audited entity JDBC mutations.
This support deliberately stops at the mutation-model boundary. Legacy
coordinators consume the generated mutation groups through the normal
mutation executor, while the graph queue turns the same groups into
FlushOperations. Keeping the support here avoids teaching either
execution path about the other.
The main invariants guarded by this type are:
- Audit table resolution follows the entity table mappings, including secondary tables and inheritance layouts.
- Validity-strategy transaction-end updates are generated before the new
audit insert and restrict on
REVEND is null. - Generated graph table descriptors describe the physical audit table used by the JDBC mutation operation, not the original entity table.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordExecution-agnostic plan for one per-table audit insert operation belonging to a logical audited entity change.static final recordA resolved per-table audit mutation operation.static final recordExecution-agnostic plan for closing the previous validity audit row. -
Constructor Summary
ConstructorsConstructorDescriptionEntityAuditSupport(EntityPersister entityPersister, SessionFactoryImplementor factory) -
Method Summary
Modifier and TypeMethodDescriptionvoidbindAuditInsertValues(int tableIndex, Object id, Object[] values, boolean[] propertyInclusions, ModificationType modificationType, Object changesetId, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) voidbindAuditInsertValues(int tableIndex, Object id, Object[] values, boolean[] propertyInclusions, ModificationType modificationType, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) voidbindTransactionEndValues(int tableIndex, Object id, Object changesetId, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) voidbindTransactionEndValues(int tableIndex, Object id, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) boolean[]The per-property audit inclusion mask.resolveAuditInsertMutationGroup(boolean[] propertyInclusions, Object entity, SharedSessionContractImplementor session) resolveAuditInsertPlans(boolean[] propertyInclusions, Object entity, SharedSessionContractImplementor session) Resolve the per-table audit insert plans for an audited entity change.boolean[]resolvePropertyInclusions(Object entity, Object[] values, SharedSessionContractImplementor session) Resolve the per-table validity-strategy transaction-end update plans.static booleanverifyTransactionEndOutcome(int affectedRowCount, ModificationType modificationType, String entityName, Object id)
-
Constructor Details
-
EntityAuditSupport
-
-
Method Details
-
getEntityPersister
-
getAuditedPropertyMask
public boolean[] getAuditedPropertyMask()The per-property audit inclusion mask.
The returned array is owned by this support instance and must be treated as read-only by callers. It is exposed directly because the legacy audit coordinator keeps a reference for compatibility with its existing shape. Code that needs to alter the mask should first clone it, as [#resolvePropertyInclusions(Object, Object[], SharedSessionContractImplementor)] does.
-
getStaticAuditInsertMutationGroup
-
getTransactionEndUpdateMutationGroup
-
resolveTransactionEndUpdatePlans
Resolve the per-table validity-strategy transaction-end update plans.
The returned plans describe the update operations needed to close the previous audit rows. Queue-specific code decides how to execute them.
-
verifyTransactionEndOutcome
public static boolean verifyTransactionEndOutcome(int affectedRowCount, ModificationType modificationType, String entityName, Object id)
-