Class ForeignKey

    • Constructor Detail

      • ForeignKey

        public ForeignKey()
    • Method Detail

      • getExportIdentifier

        public String getExportIdentifier()
        Description copied from interface: Exportable
        Get a unique identifier to make sure we are not exporting the same database structure multiple times.
        Returns:
        The exporting identifier.
      • disableCreation

        public void disableCreation()
      • isCreationEnabled

        public boolean isCreationEnabled()
      • getReferencedTable

        public Table getReferencedTable()
      • alignColumns

        public void alignColumns()
        Validates that column span of the foreign key and the primary key is the same.

        Furthermore it aligns the length of the underlying tables columns.

      • getReferencedEntityName

        public String getReferencedEntityName()
      • setReferencedEntityName

        public void setReferencedEntityName​(String referencedEntityName)
      • getKeyDefinition

        public String getKeyDefinition()
      • setKeyDefinition

        public void setKeyDefinition​(String keyDefinition)
      • setOnDeleteAction

        public void setOnDeleteAction​(OnDeleteAction onDeleteAction)
      • isPhysicalConstraint

        public boolean isPhysicalConstraint()
      • getReferencedColumns

        public List<Column> getReferencedColumns()
        Returns the referenced columns if the foreignkey does not refer to the primary key
      • isReferenceToPrimaryKey

        public boolean isReferenceToPrimaryKey()
        Does this foreignkey reference the primary key of the reference table
      • addReferencedColumns

        public void addReferencedColumns​(List<Column> referencedColumns)
      • generatedConstraintNamePrefix

        public String generatedConstraintNamePrefix()
        Specified by:
        generatedConstraintNamePrefix in class Constraint
        Returns:
        String The prefix to use in generated constraint names. Examples: "UK_", "FK_", and "PK_".