Class UniqueConstraint

  • All Implemented Interfaces:
    Comparable<Constraint>

    public class UniqueConstraint
    extends Constraint
    Table unique constraint for one or more columns
    Since:
    3.3.0
    Author:
    osbornb
    • Constructor Detail

      • UniqueConstraint

        public UniqueConstraint()
        Constructor
      • UniqueConstraint

        public UniqueConstraint​(String name)
        Constructor
        Parameters:
        name - constraint name
      • UniqueConstraint

        public UniqueConstraint​(Integer order)
        Constructor
        Parameters:
        order - constraint order
        Since:
        5.0.0
      • UniqueConstraint

        public UniqueConstraint​(String name,
                                Integer order)
        Constructor
        Parameters:
        name - constraint name
        order - constraint order
        Since:
        5.0.0
      • UniqueConstraint

        public UniqueConstraint​(UserColumn... columns)
        Constructor
        Parameters:
        columns - columns
      • UniqueConstraint

        public UniqueConstraint​(String name,
                                UserColumn... columns)
        Constructor
        Parameters:
        name - constraint name
        columns - columns
      • UniqueConstraint

        public UniqueConstraint​(UniqueConstraint userUniqueConstraint)
        Copy Constructor
        Parameters:
        userUniqueConstraint - user unique constraint
    • Method Detail

      • buildSql

        public String buildSql()
        Build the constraint SQL
        Specified by:
        buildSql in class Constraint
        Returns:
        sql constraint
      • add

        public void add​(UserColumn... columns)
        Add columns
        Parameters:
        columns - columns
      • getColumns

        public List<UserColumn> getColumns()
        Get the columns
        Returns:
        columns