Record Class CollectionMutationInput
java.lang.Object
java.lang.Record
org.hibernate.action.queue.spi.CollectionMutationInput
- Record Components:
collection- The collection wrapper being processedtransition- The selected logical transitionloadedEndpoint- The endpoint associated with loaded state, if anycurrentEndpoint- The endpoint associated with current state, if anyemptySnapshot- Whether the loaded snapshot is known to be emptyremovalSkipped- Whether physical removal is suppressed by database cascadehasQueuedOperations- Whether an uninitialized collection has delayed operationsaffectedOwner- Explicit affected owner when it cannot be derived from a collection wrapperaffectedOwnerId- Explicit affected-owner identifier when it cannot be derived from a wrapper
@Incubating(since="8.0",
group="action-queue")
public record CollectionMutationInput(@Nullable PersistentCollection<?> collection, @Nonnull CollectionTransition transition, @Nullable CollectionEndpoint loadedEndpoint, @Nullable CollectionEndpoint currentEndpoint, boolean emptySnapshot, boolean removalSkipped, boolean hasQueuedOperations, @Nullable Object affectedOwner, @Nullable Object affectedOwnerId)
extends Record
Queue-neutral collection mutation input produced by flush visitation.
This input deliberately precedes lifecycle preparation and delta freezing. In particular,
retaining it while deciding whether a speculative auto-flush is required has no callback or
event side effects. findAffectedQuerySpace(Set) performs the conservative query-space
test needed for that decision without materializing an intermediate set.
- Since:
- 8.0
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionMutationInput(PersistentCollection<?> collection, CollectionTransition transition, CollectionEndpoint loadedEndpoint, CollectionEndpoint currentEndpoint, boolean emptySnapshot, boolean hasQueuedOperations) Creates input whose affected owner will be derived from its collection wrapper.CollectionMutationInput(PersistentCollection<?> collection, CollectionTransition transition, CollectionEndpoint loadedEndpoint, CollectionEndpoint currentEndpoint, boolean emptySnapshot, boolean removalSkipped, boolean hasQueuedOperations, Object affectedOwner, Object affectedOwnerId) Creates an instance of aCollectionMutationInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theaffectedOwnerrecord component.Returns the value of theaffectedOwnerIdrecord component.Returns the value of thecollectionrecord component.Returns the value of thecurrentEndpointrecord component.booleanReturns the value of theemptySnapshotrecord component.final booleanIndicates whether some other object is "equal to" this one.findAffectedQuerySpace(Set<? extends Serializable> tables) Finds a query space potentially affected by this input.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thehasQueuedOperationsrecord component.Returns the value of theloadedEndpointrecord component.booleanReturns the value of theremovalSkippedrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetransitionrecord component.static CollectionMutationInputwrapperlessRemoval(CollectionPersister persister, Object key, Object affectedOwner, Object affectedOwnerId) Creates a wrapper-less removal input with the existing no-collection-event lifecycle.
-
Constructor Details
-
CollectionMutationInput
public CollectionMutationInput(@Nonnull PersistentCollection<?> collection, @Nonnull CollectionTransition transition, @Nullable CollectionEndpoint loadedEndpoint, @Nullable CollectionEndpoint currentEndpoint, boolean emptySnapshot, boolean hasQueuedOperations) Creates input whose affected owner will be derived from its collection wrapper. -
CollectionMutationInput
public CollectionMutationInput(@Nullable PersistentCollection<?> collection, @Nonnull CollectionTransition transition, @Nullable CollectionEndpoint loadedEndpoint, @Nullable CollectionEndpoint currentEndpoint, boolean emptySnapshot, boolean removalSkipped, boolean hasQueuedOperations, @Nullable Object affectedOwner, @Nullable Object affectedOwnerId) Creates an instance of aCollectionMutationInputrecord class.- Parameters:
collection- the value for thecollectionrecord componenttransition- the value for thetransitionrecord componentloadedEndpoint- the value for theloadedEndpointrecord componentcurrentEndpoint- the value for thecurrentEndpointrecord componentemptySnapshot- the value for theemptySnapshotrecord componentremovalSkipped- the value for theremovalSkippedrecord componenthasQueuedOperations- the value for thehasQueuedOperationsrecord componentaffectedOwner- the value for theaffectedOwnerrecord componentaffectedOwnerId- the value for theaffectedOwnerIdrecord component
-
-
Method Details
-
wrapperlessRemoval
public static CollectionMutationInput wrapperlessRemoval(@Nonnull CollectionPersister persister, @Nonnull Object key, @Nullable Object affectedOwner, @Nullable Object affectedOwnerId) Creates a wrapper-less removal input with the existing no-collection-event lifecycle.- Since:
- 8.0
-
findAffectedQuerySpace
Finds a query space potentially affected by this input.
Both the loaded and current endpoints are considered because a role change may affect either side. No intermediate collection of query spaces is allocated.
- Parameters:
tables- The query spaces relevant to the pending operation- Returns:
- a matching query space, or
nullwhen this input does not affect any
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
collection
Returns the value of thecollectionrecord component.- Returns:
- the value of the
collectionrecord component
-
transition
Returns the value of thetransitionrecord component.- Returns:
- the value of the
transitionrecord component
-
loadedEndpoint
Returns the value of theloadedEndpointrecord component.- Returns:
- the value of the
loadedEndpointrecord component
-
currentEndpoint
Returns the value of thecurrentEndpointrecord component.- Returns:
- the value of the
currentEndpointrecord component
-
emptySnapshot
public boolean emptySnapshot()Returns the value of theemptySnapshotrecord component.- Returns:
- the value of the
emptySnapshotrecord component
-
removalSkipped
public boolean removalSkipped()Returns the value of theremovalSkippedrecord component.- Returns:
- the value of the
removalSkippedrecord component
-
hasQueuedOperations
public boolean hasQueuedOperations()Returns the value of thehasQueuedOperationsrecord component.- Returns:
- the value of the
hasQueuedOperationsrecord component
-
affectedOwner
Returns the value of theaffectedOwnerrecord component.- Returns:
- the value of the
affectedOwnerrecord component
-
affectedOwnerId
Returns the value of theaffectedOwnerIdrecord component.- Returns:
- the value of the
affectedOwnerIdrecord component
-