Record Class CollectionMutationInput

java.lang.Object
java.lang.Record
org.hibernate.action.queue.spi.CollectionMutationInput
Record Components:
collection - The collection wrapper being processed
transition - The selected logical transition
loadedEndpoint - The endpoint associated with loaded state, if any
currentEndpoint - The endpoint associated with current state, if any
emptySnapshot - Whether the loaded snapshot is known to be empty
removalSkipped - Whether physical removal is suppressed by database cascade
hasQueuedOperations - Whether an uninitialized collection has delayed operations
affectedOwner - Explicit affected owner when it cannot be derived from a collection wrapper
affectedOwnerId - 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 Details

  • 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

      @Nullable public Serializable findAffectedQuerySpace(Set<? extends Serializable> tables)

      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 null when this input does not affect any
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • collection

      @Nullable public PersistentCollection<?> collection()
      Returns the value of the collection record component.
      Returns:
      the value of the collection record component
    • transition

      @Nonnull public CollectionTransition transition()
      Returns the value of the transition record component.
      Returns:
      the value of the transition record component
    • loadedEndpoint

      @Nullable public CollectionEndpoint loadedEndpoint()
      Returns the value of the loadedEndpoint record component.
      Returns:
      the value of the loadedEndpoint record component
    • currentEndpoint

      @Nullable public CollectionEndpoint currentEndpoint()
      Returns the value of the currentEndpoint record component.
      Returns:
      the value of the currentEndpoint record component
    • emptySnapshot

      public boolean emptySnapshot()
      Returns the value of the emptySnapshot record component.
      Returns:
      the value of the emptySnapshot record component
    • removalSkipped

      public boolean removalSkipped()
      Returns the value of the removalSkipped record component.
      Returns:
      the value of the removalSkipped record component
    • hasQueuedOperations

      public boolean hasQueuedOperations()
      Returns the value of the hasQueuedOperations record component.
      Returns:
      the value of the hasQueuedOperations record component
    • affectedOwner

      @Nullable public Object affectedOwner()
      Returns the value of the affectedOwner record component.
      Returns:
      the value of the affectedOwner record component
    • affectedOwnerId

      @Nullable public Object affectedOwnerId()
      Returns the value of the affectedOwnerId record component.
      Returns:
      the value of the affectedOwnerId record component