Class ForeignKey

java.lang.Object
io.github.mfvanek.pg.model.index.ForeignKey
All Implemented Interfaces:
TableNameAware

@Immutable public class ForeignKey extends Object implements TableNameAware
A representation of foreign key in a database.
See Also:
  • Method Details

    • getTableName

      @Nonnull public String getTableName()
      Gets table name.
      Specified by:
      getTableName in interface TableNameAware
      Returns:
      table name
    • getConstraintName

      @Nonnull public String getConstraintName()
      Gets the name of foreign key constraint.
      Returns:
      the name of foreign key
    • getColumnsInConstraint

      @Nonnull public List<Column> getColumnsInConstraint()
      Gets columns of foreign key constraint.
      Returns:
      columns of foreign key constraint
      See Also:
    • equals

      public final boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • 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)