Class ForeignKey


  • public final class ForeignKey
    extends Object
    Foreign key class.
    • Method Detail

      • setDeleteRule

        public void setDeleteRule​(FKRule deleteBehaviour)
                           throws ParseException
        Sets rule for deletion.
        Parameters:
        deleteBehaviour - rule for deletion.
        Throws:
        ParseException - When trying to modify the system grain.
      • setUpdateRule

        public void setUpdateRule​(FKRule updateBehaviour)
                           throws ParseException
        Sets rule for update.
        Parameters:
        updateBehaviour - rule for update.
        Throws:
        ParseException - When trying to modify the system grain.
      • getColumns

        public Map<String,​Column<?>> getColumns()
        Unmodified list of columns for the foreign key.
        Returns:
      • getParentTable

        public BasicTable getParentTable()
        Table that the foreign key is part of.
        Returns:
      • getReferencedTable

        public BasicTable getReferencedTable()
        Table that is being referenced by the foreign key.
        Returns:
      • getDeleteRule

        public FKRule getDeleteRule()
        Returns rule for deletion.
        Returns:
      • getUpdateRule

        public FKRule getUpdateRule()
        Returns rule for update.
        Returns:
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • getConstraintName

        public String getConstraintName()
        Returns the name of FK constraint (or generates it if it's not provided).
        Returns:
      • setConstraintName

        public void setConstraintName​(String constraintName)
                               throws ParseException
        Sets name for FK constraint.
        Parameters:
        constraintName - new name of constraint
        Throws:
        ParseException - incorrect name of constraint
      • delete

        public void delete()
                    throws ParseException
        Deletes the foreign key.
        Throws:
        ParseException - When trying to modify the system grain.