Record Class EntityTableDescriptor

java.lang.Object
java.lang.Record
org.hibernate.action.queue.spi.meta.EntityTableDescriptor
Record Components:
name - Table name from the mapping model.
relativePosition - Position within the target's grouping of tables.
columns - The columns contained on this table.
attributes - The attributes mapped to this table.
attributeColumnIndexes - A mapping of attribute to the indices (relative to columns()) for the columns that attribute maps to.
All Implemented Interfaces:
Serializable, TableDescriptor

@Incubating public record EntityTableDescriptor(String name, int relativePosition, boolean isIdentifierTable, boolean isOptional, boolean isInverse, boolean isSelfReferential, boolean hasUniqueConstraints, boolean cascadeDeleteEnabled, TableMapping.MutationDetails insertDetails, TableMapping.MutationDetails updateDetails, TableMapping.MutationDetails deleteDetails, List<ColumnDescriptor> columns, List<AttributeMapping> attributes, Map<AttributeMapping, List<Integer>> attributeColumnIndexes, TableKeyDescriptor keyDescriptor) extends Record implements TableDescriptor, Serializable

Immutable descriptor for a table involved in a mutation.

Provides metadata needed for mutation execution.

Since:
8.0
See Also:
  • Constructor Details

    • EntityTableDescriptor

      public EntityTableDescriptor(String name, int relativePosition, boolean isIdentifierTable, boolean isOptional, boolean isInverse, boolean isSelfReferential, boolean hasUniqueConstraints, boolean cascadeDeleteEnabled, TableMapping.MutationDetails insertDetails, TableMapping.MutationDetails updateDetails, TableMapping.MutationDetails deleteDetails, List<ColumnDescriptor> columns, List<AttributeMapping> attributes, Map<AttributeMapping, List<Integer>> attributeColumnIndexes, TableKeyDescriptor keyDescriptor)
      Creates an instance of a EntityTableDescriptor record class.
      Parameters:
      name - the value for the name record component
      relativePosition - the value for the relativePosition record component
      isIdentifierTable - the value for the isIdentifierTable record component
      isOptional - the value for the isOptional record component
      isInverse - the value for the isInverse record component
      isSelfReferential - the value for the isSelfReferential record component
      hasUniqueConstraints - the value for the hasUniqueConstraints record component
      cascadeDeleteEnabled - the value for the cascadeDeleteEnabled record component
      insertDetails - the value for the insertDetails record component
      updateDetails - the value for the updateDetails record component
      deleteDetails - the value for the deleteDetails record component
      columns - the value for the columns record component
      attributes - the value for the attributes record component
      attributeColumnIndexes - the value for the attributeColumnIndexes record component
      keyDescriptor - the value for the keyDescriptor record component
  • Method Details

    • forEachAttributeColumn

      public void forEachAttributeColumn(AttributeMapping attribute, Consumer<ColumnDescriptor> consumer)
    • forAllColumns

      public void forAllColumns(Consumer<ColumnDescriptor> consumer)
    • findColumn

      public ColumnDescriptor findColumn(String columnName)
      Find column by name. Returns null if not found.
    • findColumns

      public List<ColumnDescriptor> findColumns(String... columnNames)
      Find columns by names. Returns empty if none found.
    • findColumns

      public List<ColumnDescriptor> findColumns(Collection<String> columnNames)
      Find columns by names. Returns empty if none found.
    • getRelativePosition

      public int getRelativePosition()
      Description copied from interface: TableDescriptor
      This table's relative position within its "table group".
      Specified by:
      getRelativePosition in interface TableDescriptor
    • 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.
    • name

      public String name()
      Returns the value of the name record component.
      Specified by:
      name in interface TableDescriptor
      Returns:
      the value of the name record component
    • relativePosition

      public int relativePosition()
      Returns the value of the relativePosition record component.
      Returns:
      the value of the relativePosition record component
    • isIdentifierTable

      public boolean isIdentifierTable()
      Returns the value of the isIdentifierTable record component.
      Returns:
      the value of the isIdentifierTable record component
    • isOptional

      public boolean isOptional()
      Returns the value of the isOptional record component.
      Specified by:
      isOptional in interface TableDescriptor
      Returns:
      the value of the isOptional record component
      See Also:
    • isInverse

      public boolean isInverse()
      Returns the value of the isInverse record component.
      Returns:
      the value of the isInverse record component
    • isSelfReferential

      public boolean isSelfReferential()
      Returns the value of the isSelfReferential record component.
      Specified by:
      isSelfReferential in interface TableDescriptor
      Returns:
      the value of the isSelfReferential record component
    • hasUniqueConstraints

      public boolean hasUniqueConstraints()
      Returns the value of the hasUniqueConstraints record component.
      Specified by:
      hasUniqueConstraints in interface TableDescriptor
      Returns:
      the value of the hasUniqueConstraints record component
    • cascadeDeleteEnabled

      public boolean cascadeDeleteEnabled()
      Returns the value of the cascadeDeleteEnabled record component.
      Specified by:
      cascadeDeleteEnabled in interface TableDescriptor
      Returns:
      the value of the cascadeDeleteEnabled record component
    • insertDetails

      public TableMapping.MutationDetails insertDetails()
      Returns the value of the insertDetails record component.
      Specified by:
      insertDetails in interface TableDescriptor
      Returns:
      the value of the insertDetails record component
    • updateDetails

      public TableMapping.MutationDetails updateDetails()
      Returns the value of the updateDetails record component.
      Specified by:
      updateDetails in interface TableDescriptor
      Returns:
      the value of the updateDetails record component
    • deleteDetails

      public TableMapping.MutationDetails deleteDetails()
      Returns the value of the deleteDetails record component.
      Specified by:
      deleteDetails in interface TableDescriptor
      Returns:
      the value of the deleteDetails record component
    • columns

      public List<ColumnDescriptor> columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • attributes

      public List<AttributeMapping> attributes()
      Returns the value of the attributes record component.
      Returns:
      the value of the attributes record component
    • attributeColumnIndexes

      public Map<AttributeMapping, List<Integer>> attributeColumnIndexes()
      Returns the value of the attributeColumnIndexes record component.
      Returns:
      the value of the attributeColumnIndexes record component
    • keyDescriptor

      public TableKeyDescriptor keyDescriptor()
      Returns the value of the keyDescriptor record component.
      Specified by:
      keyDescriptor in interface TableDescriptor
      Returns:
      the value of the keyDescriptor record component