Class Table

    • Constructor Detail

      • Table

        public Table​(java.lang.String schemaName,
                     java.lang.String name,
                     int version,
                     java.util.Collection<ColumnBase> columns,
                     PrimaryKeyDef pk,
                     IdentityDef identity,
                     java.util.Collection<IndexDef> indexes,
                     java.util.Collection<ForeignKeyConstraint> fkConstraints,
                     Tablespace tablespace,
                     java.util.List<IDatabaseObject> dependencies,
                     java.util.Map<java.lang.String,​java.lang.String> tags,
                     java.util.Collection<GroupPrivilege> privileges,
                     java.util.List<Migration> migrations,
                     java.util.List<With> withs,
                     java.util.List<CheckConstraint> checkConstraints,
                     DistributionType distributionType,
                     java.lang.String distributionColumnName,
                     boolean create)
        Public constructor
        Parameters:
        schemaName -
        name -
        version -
        columns -
        pk -
        identity -
        indexes -
        fkConstraints -
        accessControlVar -
        tablespace -
        dependencies -
        tags -
        privileges -
        migrations -
        withs -
        checkConstraints -
        distributionType -
        distributionColumnName -
        create -
    • Method Detail

      • getPrimaryKey

        public PrimaryKeyDef getPrimaryKey()
        Getter for the primary key definition, or null if there isn't one
        Returns:
      • getIdentity

        public IdentityDef getIdentity()
        Getter for the identity definition, or null if there isn't one
        Returns:
      • isCreate

        public boolean isCreate()
        Getter for the create flag
        Returns:
        whether the table should be created or not
      • getDistributionType

        public DistributionType getDistributionType()
        Getter for the table's distributionType
        Returns:
      • apply

        public void apply​(ISchemaAdapter target,
                          SchemaApplyContext context)
        Description copied from interface: IDatabaseObject
        Apply the DDL for this object to the target database
        Parameters:
        target - the database target
        context - context to control the schema apply process
      • apply

        public void apply​(java.lang.Integer priorVersion,
                          ISchemaAdapter target,
                          SchemaApplyContext context)
        Description copied from interface: IDatabaseObject
        Apply migration logic to bring the target database to the current level of this object
        target - the database target
        context - to control the schema apply process
      • grantGroupPrivileges

        protected void grantGroupPrivileges​(ISchemaAdapter target,
                                            java.util.Set<Privilege> group,
                                            java.lang.String toUser)
        Description copied from class: BaseObject
        Internal method which can be override by different object types which may need to call a different grant method on the adapter
        Overrides:
        grantGroupPrivileges in class BaseObject
      • drop

        public void drop​(ISchemaAdapter target)
        Description copied from interface: IDatabaseObject
        DROP this object from the target database
      • builder

        public static Table.Builder builder​(java.lang.String schemaName,
                                            java.lang.String tableName)
        Create a builder for Table.
        Parameters:
        schemaName -
        tableName -
        Returns:
      • exists

        public boolean exists​(ISchemaAdapter target)
        return true if the table already exists in the target
        Parameters:
        target -
        Returns: