Package io.github.mfvanek.pg.model.index
Class ForeignKey
java.lang.Object
io.github.mfvanek.pg.model.index.ForeignKey
- All Implemented Interfaces:
TableNameAware
A representation of foreign key in a database.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Gets columns of foreign key constraint.Gets the name of foreign key constraint.Gets table name.final int
hashCode()
static ForeignKey
static ForeignKey
static ForeignKey
ofNotNullColumn
(String tableName, String constraintName, String columnName) static ForeignKey
ofNullableColumn
(String tableName, String constraintName, String columnName) toString()
-
Method Details
-
getTableName
Gets table name.- Specified by:
getTableName
in interfaceTableNameAware
- Returns:
- table name
-
getConstraintName
Gets the name of foreign key constraint.- Returns:
- the name of foreign key
-
getColumnsInConstraint
Gets columns of foreign key constraint.- Returns:
- columns of foreign key constraint
- See Also:
-
equals
-
hashCode
public final int hashCode() -
toString
-
of
@Nonnull public static ForeignKey of(@Nonnull String tableName, @Nonnull String constraintName, @Nonnull List<Column> columnsInConstraint) -
ofColumn
@Nonnull public static ForeignKey ofColumn(@Nonnull String tableName, @Nonnull String constraintName, @Nonnull Column column) -
ofNotNullColumn
@Nonnull public static ForeignKey ofNotNullColumn(@Nonnull String tableName, @Nonnull String constraintName, @Nonnull String columnName) -
ofNullableColumn
@Nonnull public static ForeignKey ofNullableColumn(@Nonnull String tableName, @Nonnull String constraintName, @Nonnull String columnName)
-