Record Class MultiTableMutationSupport

java.lang.Object
java.lang.Record
org.hibernate.dialect.mutation.spi.MultiTableMutationSupport
Record Components:
mutationStrategyKind - the fallback for update and delete
insertStrategyKind - the fallback for insert

@SPI({USE,SUPPLY}) public record MultiTableMutationSupport(MultiTableMutationStrategyKind mutationStrategyKind, MultiTableMutationStrategyKind insertStrategyKind) extends Record

Immutable selection of Hibernate's fallback strategy families for SQM mutations of multi-table entities.

A custom Dialect should return a stable, non-null profile from Dialect.getMultiTableMutationSupport(). Update and delete share mutationStrategyKind, while insert independently uses insertStrategyKind. Use forBoth(MultiTableMutationStrategyKind) or a named profile when both operations use the same family, and invoke the canonical constructor when they differ.

These values select Hibernate-owned fallback implementations. Supply a genuinely custom execution strategy through the query-engine mutation or insert strategy setting instead of depending on Hibernate's internal strategy implementations.

Since:
8.0
See Also:
  • Field Details

    • CTE

      public static final MultiTableMutationSupport CTE
      Use modifiable common-table expressions for both operation families.
    • LOCAL_TEMPORARY_TABLE

      public static final MultiTableMutationSupport LOCAL_TEMPORARY_TABLE
      Use local temporary tables for both operation families.
    • GLOBAL_TEMPORARY_TABLE

      public static final MultiTableMutationSupport GLOBAL_TEMPORARY_TABLE
      Use global temporary tables for both operation families.
    • PERSISTENT_TABLE

      public static final MultiTableMutationSupport PERSISTENT_TABLE
      Use persistent tables for both operation families.
  • Constructor Details

  • Method Details

    • forBoth

      public static MultiTableMutationSupport forBoth(MultiTableMutationStrategyKind strategyKind)
      Select one strategy kind for both update/delete and insert.
      Parameters:
      strategyKind - the shared non-null strategy kind
      Returns:
      the canonical same-kind profile
    • 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • mutationStrategyKind

      public MultiTableMutationStrategyKind mutationStrategyKind()
      Returns the value of the mutationStrategyKind record component.
      Returns:
      the value of the mutationStrategyKind record component
    • insertStrategyKind

      public MultiTableMutationStrategyKind insertStrategyKind()
      Returns the value of the insertStrategyKind record component.
      Returns:
      the value of the insertStrategyKind record component