Record Class ForeignKeyConstraintRequest
java.lang.Object
java.lang.Record
org.hibernate.dialect.constraint.spi.ForeignKeyConstraintRequest
@SPI(USE)
public record ForeignKeyConstraintRequest(String constraintName, List<String> sourceColumnNames, @Nullable String referencedTableName, List<String> targetColumnNames, boolean referencesPrimaryKey, @Nullable String explicitDefinition)
extends Record
Describes one foreign-key constraint to be added to an existing table.
Use structured(String, List, String, List, boolean) for mapping-model foreign keys and explicit(String, String) for an
explicitly supplied SQL definition. Rendered identifiers and SQL fragments
are consumed verbatim.
- Since:
- 8.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theconstraintNamerecord component.final booleanIndicates whether some other object is "equal to" this one.static ForeignKeyConstraintRequestReturns the value of theexplicitDefinitionrecord component.final inthashCode()Returns a hash code value for this object.booleanReturns the value of thereferencedTableNamerecord component.booleanReturns the value of thereferencesPrimaryKeyrecord component.Returns the value of thesourceColumnNamesrecord component.static ForeignKeyConstraintRequeststructured(String constraintName, List<String> sourceColumnNames, String referencedTableName, List<String> targetColumnNames, boolean referencesPrimaryKey) Returns the value of thetargetColumnNamesrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
ForeignKeyConstraintRequest
public ForeignKeyConstraintRequest(String constraintName, List<String> sourceColumnNames, @Nullable String referencedTableName, List<String> targetColumnNames, boolean referencesPrimaryKey, @Nullable String explicitDefinition) Creates an instance of aForeignKeyConstraintRequestrecord class.- Parameters:
constraintName- the value for theconstraintNamerecord componentsourceColumnNames- the value for thesourceColumnNamesrecord componentreferencedTableName- the value for thereferencedTableNamerecord componenttargetColumnNames- the value for thetargetColumnNamesrecord componentreferencesPrimaryKey- the value for thereferencesPrimaryKeyrecord componentexplicitDefinition- the value for theexplicitDefinitionrecord component
-
-
Method Details
-
structured
-
explicit
public static ForeignKeyConstraintRequest explicit(String constraintName, String explicitDefinition) -
isExplicitDefinition
public boolean isExplicitDefinition() -
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
constraintName
Returns the value of theconstraintNamerecord component.- Returns:
- the value of the
constraintNamerecord component
-
sourceColumnNames
-
referencedTableName
-
targetColumnNames
-
referencesPrimaryKey
public boolean referencesPrimaryKey()Returns the value of thereferencesPrimaryKeyrecord component.- Returns:
- the value of the
referencesPrimaryKeyrecord component
-
explicitDefinition
-