Record Class AuditChangeSet.CollectionChange<C>
java.lang.Object
java.lang.Record
org.hibernate.audit.spi.AuditChangeSet.CollectionChange<C>
- Type Parameters:
C- the collection audit handler type- Record Components:
collection- the collection wrapper whose final state will be auditedownerId- the collection owner identifieroriginalSnapshot- the original collection snapshot, ornullfor a new collectioncollectionAuditHandler- the execution-specific handler used to consume this change
- Enclosing class:
AuditChangeSet<E,C>
public static record AuditChangeSet.CollectionChange<C>(PersistentCollection<?> collection, Object ownerId, Object originalSnapshot, C collectionAuditHandler)
extends Record
A collection audit change.
The change stores the original snapshot captured before flush replaces it. Consumers compare that snapshot with the collection wrapper's final state to produce row-level ADD and DEL audit mutations.
- Since:
- 8.0
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionChange(PersistentCollection<?> collection, Object ownerId, Object originalSnapshot, C collectionAuditHandler) Creates an instance of aCollectionChangerecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thecollectionrecord component.Returns the value of thecollectionAuditHandlerrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoriginalSnapshotrecord component.ownerId()Returns the value of theownerIdrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CollectionChange
public CollectionChange(PersistentCollection<?> collection, Object ownerId, Object originalSnapshot, C collectionAuditHandler) Creates an instance of aCollectionChangerecord class.- Parameters:
collection- the value for thecollectionrecord componentownerId- the value for theownerIdrecord componentoriginalSnapshot- the value for theoriginalSnapshotrecord componentcollectionAuditHandler- the value for thecollectionAuditHandlerrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
collection
Returns the value of thecollectionrecord component.- Returns:
- the value of the
collectionrecord component
-
ownerId
-
originalSnapshot
Returns the value of theoriginalSnapshotrecord component.- Returns:
- the value of the
originalSnapshotrecord component
-
collectionAuditHandler
Returns the value of thecollectionAuditHandlerrecord component.- Returns:
- the value of the
collectionAuditHandlerrecord component
-