Class ForeignKeyConstraint


  • public class ForeignKeyConstraint
    extends Constraint
    Represents a FOREIGN KEY constraint referencing the primary key of a parent table
    • Constructor Summary

      Constructors 
      Constructor Description
      ForeignKeyConstraint​(java.lang.String constraintName, boolean enforced, boolean self, java.lang.String targetSchema, java.lang.String targetTable, java.lang.String targetColumnName, java.lang.String... column)  
      ForeignKeyConstraint​(java.lang.String constraintName, boolean enforced, java.lang.String targetSchema, java.lang.String targetTable, java.lang.String targetColumnName, java.lang.String... column)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void apply​(java.lang.String schemaName, java.lang.String name, ISchemaAdapter target, DistributionType sourceDistributionType)
      Apply the FK constraint to the given target
      java.util.List<java.lang.String> getColumns()
      Getter for the target schema name
      java.lang.String getQualifiedTargetName()  
      java.lang.String getTargetColumnName()
      returns the target column name
      java.lang.String getTargetSchema()
      Getter for the target schema name
      java.lang.String getTargetTable()
      Getter for the target table name
      boolean includesColumn​(java.lang.String columnName)
      Return true if the list of columns includes the column name, ignoring case
      boolean isEnforced()
      Getter for the enforced boolean flag
      boolean isSelf()  
      boolean isTargetReference()
      Is the target table distributed as a REFERENCE table (Citus)
      void setTargetReference​(boolean flag)
      Set the flag to indicate if the target table is a reference type
      • Methods inherited from class java.lang.Object

        clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ForeignKeyConstraint

        public ForeignKeyConstraint​(java.lang.String constraintName,
                                    boolean enforced,
                                    boolean self,
                                    java.lang.String targetSchema,
                                    java.lang.String targetTable,
                                    java.lang.String targetColumnName,
                                    java.lang.String... column)
        Parameters:
        constraintName -
        enforced -
        self -
        targetSchema -
        targetTable -
        targetColumName -
        column -
      • ForeignKeyConstraint

        public ForeignKeyConstraint​(java.lang.String constraintName,
                                    boolean enforced,
                                    java.lang.String targetSchema,
                                    java.lang.String targetTable,
                                    java.lang.String targetColumnName,
                                    java.lang.String... column)
    • Method Detail

      • getTargetColumnName

        public java.lang.String getTargetColumnName()
        returns the target column name
        Returns:
      • isSelf

        public boolean isSelf()
      • isTargetReference

        public boolean isTargetReference()
        Is the target table distributed as a REFERENCE table (Citus)
        Returns:
      • setTargetReference

        public void setTargetReference​(boolean flag)
        Set the flag to indicate if the target table is a reference type
        Parameters:
        flag -
      • getTargetTable

        public java.lang.String getTargetTable()
        Getter for the target table name
        Returns:
      • isEnforced

        public boolean isEnforced()
        Getter for the enforced boolean flag
        Returns:
      • getTargetSchema

        public java.lang.String getTargetSchema()
        Getter for the target schema name
        Returns:
      • getColumns

        public java.util.List<java.lang.String> getColumns()
        Getter for the target schema name
        Returns:
      • getQualifiedTargetName

        public java.lang.String getQualifiedTargetName()
      • apply

        public void apply​(java.lang.String schemaName,
                          java.lang.String name,
                          ISchemaAdapter target,
                          DistributionType sourceDistributionType)
        Apply the FK constraint to the given target
        Parameters:
        schemaName -
        name -
        target -
        sourceDistributionType -
      • includesColumn

        public boolean includesColumn​(java.lang.String columnName)
        Return true if the list of columns includes the column name, ignoring case
        Parameters:
        distributionColumnName -
        Returns: