Interface DecompositionContext


@Incubating public interface DecompositionContext

Context for decomposition operations, providing information about entities being mutated in the current flush.

This allows decomposition logic (e.g., ForeignKeys.Nullifier) to distinguish between:

  • Truly unresolved transient entities (not being inserted in this flush)
  • Entities being inserted in this flush (should not be treated as unresolved)
  • Entities being deleted in this flush (UPDATEs can be skipped)

Implemented by Decomposer and passed to components that need this context.

Since:
8.0
  • Method Details

    • isBeingInsertedInCurrentFlush

      boolean isBeingInsertedInCurrentFlush(Object entity)
      Check if an entity is being inserted in the current flush.
      Parameters:
      entity - the entity to check
      Returns:
      true if the entity has an INSERT action in this flush, false otherwise
    • isBeingDeletedInCurrentFlush

      boolean isBeingDeletedInCurrentFlush(Object entity)
      Check if an entity is being deleted in the current flush.
      Parameters:
      entity - the entity to check
      Returns:
      true if the entity has a DELETE action in this flush, false otherwise
    • getUpdatedAttributeIndexesForDeletedEntity

      default int[] getUpdatedAttributeIndexesForDeletedEntity(Object entity)
      Attribute indexes updated for an entity that is also deleted in the current flush. These attributes may already have been changed in the database before the DELETE executes.
    • getGeneratedIdentifierHandle

      default DelayedValueAccess getGeneratedIdentifierHandle(Object entity)

      Get the generated identifier handle for an entity being inserted in this flush.

      Returns null when the entity identifier is already known, or when the entity is not part of this decomposition context.

    • registerOwnerUpdateCallbacks

      default boolean registerOwnerUpdateCallbacks(Object owner)
      Register owner update callbacks for this flush.
      Returns:
      true when callbacks should be fired by the caller; false when another action already registered them for the same owner.