Class CollectionAuditSupport
Shared diffing, operation planning, and binding support for audited collection row mutations.
Like EntityAuditSupport, this type keeps audit operation construction
queue-neutral. Legacy collection audit coordinators consume operation groups
through the normal mutation executor, while the graph queue materializes
execution-agnostic plans as FlushOperations during transaction completion.
This type also owns collection-row diffing and owner-entity audit-change
resolution because those are audit semantics shared by both queues.
The main invariants guarded here are:
- Collection audit rows are derived from the collection's original snapshot and final in-memory state.
- Row identity is delegated to
AuditCollectionRowMutationHelperso keyed, indexed, identifier, element, and one-to-many join-column shapes bind consistently. - Validity-strategy transaction-end updates use the same row identity as
audit inserts and restrict on
REVEND is null. - Owner entity
MODaudit changes are resolved here as logical audit changes, not by teaching collection coordinators about graph execution.
- Since:
- 8.0
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordOne row-level collection audit change.static final recordA resolved collection audit mutation operation.static final recordExecution-agnostic plan for inserting collection audit rows.static final recordOwning entity audit change implied by a collection mutation.static final recordExecution-agnostic plan for closing previous validity audit rows. -
Constructor Summary
ConstructorsConstructorDescriptionCollectionAuditSupport(CollectionMutationTarget mutationTarget, SessionFactoryImplementor sessionFactory, boolean[] indexColumnIsSettable, boolean[] elementColumnIsSettable, UnaryOperator<Object> indexIncrementer, AuditMapping auditMapping) -
Method Summary
Modifier and TypeMethodDescriptionvoidbindAuditInsertValues(PersistentCollection<?> collection, Object ownerId, CollectionAuditSupport.AuditCollectionChange change, Object changesetId, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) Bind values for one graph-queue collection audit INSERT.voidbindAuditInsertValues(PersistentCollection<?> collection, Object ownerId, CollectionAuditSupport.AuditCollectionChange change, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) Bind values for one legacy collection audit INSERT.voidbindTransactionEndValues(PersistentCollection<?> collection, Object ownerId, CollectionAuditSupport.AuditCollectionChange change, Object changesetId, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) Bind values for one graph-queue validity-strategy transaction-end UPDATE.voidbindTransactionEndValues(PersistentCollection<?> collection, Object ownerId, CollectionAuditSupport.AuditCollectionChange change, SharedSessionContractImplementor session, JdbcValueBindings jdbcValueBindings) Bind values for one legacy validity-strategy transaction-end UPDATE.Resolve the audit insert plan for row-level collection audit changes.resolveChanges(PersistentCollection<?> collection, Object originalSnapshot) resolveOwnerAuditChange(Object ownerId, PersistentCollection<?> collection, SharedSessionContractImplementor session) Resolve the owning entity change implied by an audited collection change.Resolve the validity-strategy transaction-end plan for collection audit rows.
-
Constructor Details
-
CollectionAuditSupport
public CollectionAuditSupport(CollectionMutationTarget mutationTarget, SessionFactoryImplementor sessionFactory, boolean[] indexColumnIsSettable, boolean[] elementColumnIsSettable, UnaryOperator<Object> indexIncrementer, AuditMapping auditMapping)
-
-
Method Details
-
getMutationTarget
-
getOwnerMutationSupport
-
getAuditInsertOperationGroup
-
getTransactionEndUpdateGroup
-
resolveAuditInsertPlan
Resolve the audit insert plan for row-level collection audit changes.
The returned plan is execution-agnostic. It identifies the JDBC mutation operation that inserts audit rows, while queue-specific code decides how to materialize and execute that operation.
-
resolveTransactionEndUpdatePlan
Resolve the validity-strategy transaction-end plan for collection audit rows.
The returned plan describes the update operation used to close previous audit rows for changed collection-row identities. A
nullresult means the active audit strategy does not require this update. -
resolveChanges
public List<CollectionAuditSupport.AuditCollectionChange> resolveChanges(PersistentCollection<?> collection, Object originalSnapshot)
-