Package st.orm

Record Class IntegrityViolation.Referenced

java.lang.Object
java.lang.Record
st.orm.IntegrityViolation.Referenced
Record Components:
constraint - the name of the foreign key that references the row, or null when the database reported none.
table - the table that holds the referencing rows, or null when it is not known.
type - the type of the removed row, or null when it is not known.
All Implemented Interfaces:
IntegrityViolation
Enclosing interface:
IntegrityViolation

public static record IntegrityViolation.Referenced(@Nullable String constraint, @Nullable String table, @Nullable Class<? extends Data> type) extends Record implements IntegrityViolation
A row that other rows still reference through a foreign key, so it cannot be removed, or have its key changed. SQL state 23503 as well; the statement and the schema tell it apart from a reference to a missing row. The referencing rows name no field of the removed row.
Since:
1.16
  • Constructor Details

    • Referenced

      public Referenced(@Nullable String constraint, @Nullable String table, @Nullable Class<? extends Data> type)
      Creates an instance of a Referenced record class.
      Parameters:
      constraint - the value for the constraint record component
      table - the value for the table record component
      type - the value for the type record component
  • Method Details

    • 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.
    • constraint

      public @Nullable String constraint()
      Returns the value of the constraint record component.
      Specified by:
      constraint in interface IntegrityViolation
      Returns:
      the value of the constraint record component
    • table

      public @Nullable String table()
      Returns the value of the table record component.
      Specified by:
      table in interface IntegrityViolation
      Returns:
      the value of the table record component
    • type

      public @Nullable Class<? extends Data> type()
      Returns the value of the type record component.
      Specified by:
      type in interface IntegrityViolation
      Returns:
      the value of the type record component