Class Table

    • Constructor Detail

      • Table

        public Table​(java.lang.String schemaName,
                     java.lang.String name,
                     int version,
                     java.lang.String tenantColumnName,
                     java.util.Collection<ColumnBase> columns,
                     PrimaryKeyDef pk,
                     IdentityDef identity,
                     java.util.Collection<IndexDef> indexes,
                     java.util.Collection<ForeignKeyConstraint> fkConstraints,
                     SessionVariableDef accessControlVar,
                     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)
        Public constructor
        Parameters:
        schemaName -
        name -
        version -
        tenantColumnName -
        columns -
        pk -
        identity -
        indexes -
        fkConstraints -
        accessControlVar -
        tablespace -
        dependencies -
        tags -
        privileges -
        migrations -
        withs -
        checkConstraints -
    • 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:
      • getTenantColumnName

        public java.lang.String getTenantColumnName()
        Getter for the optional tenant id column name
        Returns:
      • apply

        public void apply​(IDatabaseAdapter target)
        Description copied from interface: IDatabaseObject
        Apply the DDL for this object to the target database
        Parameters:
        target - the database target
      • apply

        public void apply​(java.lang.Integer priorVersion,
                          IDatabaseAdapter target)
        Description copied from interface: IDatabaseObject
        Apply migration logic to bring the target database to the current level of this object
        target - the database target
      • 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​(IDatabaseAdapter target)
        return true if the table already exists in the target
        Parameters:
        target -
        Returns: