Interface IConstraint

All Superinterfaces:
ISearchPath, IStatement, ISubElement
All Known Subinterfaces:
IConstraintFk, IConstraintPk
All Known Implementing Classes:
ChConstraint, MetaConstraint, MsConstraint, MsConstraintCheck, MsConstraintFk, MsConstraintPk, PgConstraint, PgConstraintCheck, PgConstraintExclude, PgConstraintFk, PgConstraintNotNull, PgConstraintPk

public interface IConstraint extends ISubElement
Interface for database table constraints. Provides common functionality for all constraint types including primary keys, foreign keys, unique constraints, and check constraints.
  • Method Details

    • isPrimaryKey

      default boolean isPrimaryKey()
      Checks if this constraint is a primary key constraint.
      Returns:
      true if this is a primary key constraint
    • getDefinition

      String getDefinition()
      Gets the SQL definition of this constraint.
      Returns:
      the constraint definition
    • getColumns

      Collection<String> getColumns()
      Gets the columns involved in this constraint.
      Returns:
      a collection of column names
    • containsColumn

      boolean containsColumn(String name)
      Checks if this constraint involves the specified column.
      Parameters:
      name - the column name to check
      Returns:
      true if the column is part of this constraint
    • getTableName

      String getTableName()
      Gets the name of the table this constraint belongs to.
      Returns:
      the table name
    • getStatementType

      default DbObjType getStatementType()
      Description copied from interface: IStatement
      Gets the type of this database object.
      Specified by:
      getStatementType in interface IStatement
      Returns:
      the database object type