Package org.pgcodekeeper.core.schema.pg
Class AbstractRegularTable
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.PgStatementContainer
org.pgcodekeeper.core.schema.AbstractTable
org.pgcodekeeper.core.schema.pg.AbstractPgTable
org.pgcodekeeper.core.schema.pg.AbstractRegularTable
- All Implemented Interfaces:
IHashable,IOptionContainer,IRelation,ISearchPath,ISimpleOptionContainer,IStatement,IStatementContainer
- Direct Known Subclasses:
PartitionGpTable,PartitionPgTable,SimplePgTable,TypedPgTable
public abstract class AbstractRegularTable
extends AbstractPgTable
implements ISimpleOptionContainer
Base PostgreSQL regular table implementation.
Provides common functionality for standard PostgreSQL tables including
logging, tablespace, row-level security, partitioning, and Greenplum distribution options.
- Since:
- 4.1.1
- Author:
- galiev_mr
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GOFields inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
GP_OPTION_LIST -
Method Summary
Modifier and TypeMethodDescriptionbooleancompare(PgStatement obj) This method does not account for nested child PgStatements.voidcomputeHash(Hasher hasher) Computes the hash of the implementing object using the provided hasher.getAlterTable(boolean only) Generates beginning of alter table statement.Gets the partition specification for this table.booleanisLogged()Checks if this table is logged (writes to WAL).voidsetDistribution(String distribution) voidsetForceSecurity(boolean isForceSecurity) voidsetLogged(boolean isLogged) voidvoidsetPartitionBy(String partitionBy) voidsetRowSecurity(boolean isRowSecurity) voidsetTablespace(String tablespace) Copies all object properties into a new object and leaves all its children empty.Methods inherited from class org.pgcodekeeper.core.schema.pg.AbstractPgTable
addInherits, appendAlterSQL, appendComments, getColsForMovingData, getCreationSQL, getInherits, getRelationColumns, hasInherits, putTriggerState, setHasOids, sortColumnsMethods inherited from class org.pgcodekeeper.core.schema.AbstractTable
addColumn, addConstraint, addOption, appendMoveDataSql, columnAdder, compareChildren, compareIgnoringColumnOrder, computeChildrenHash, containsColumn, getColumn, getColumns, getConstraint, getConstraints, getOption, getOptions, getStatementType, isRecreatedMethods inherited from class org.pgcodekeeper.core.schema.PgStatementContainer
addChild, addIndex, addPolicy, addRule, addTrigger, getChild, getContainingSchema, getIndex, getIndexes, getPolicies, getPolicy, getRule, getRules, getTrigger, getTriggers, isClusteredMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendAlterComments, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, deepCopy, equals, getAuthor, getBareName, getChildren, getComment, getDbType, getDeps, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSQL, getTwin, getTypeName, hasChildren, hashCode, isLib, isOwned, isSubElement, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, toStringMethods inherited from interface org.pgcodekeeper.core.schema.IOptionContainer
addOption, getOptionsMethods inherited from interface org.pgcodekeeper.core.schema.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.ISimpleOptionContainer
appendOptions, compareOptionsMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName, getStatementType
-
Method Details
-
getAlterTable
Description copied from class:AbstractTableGenerates beginning of alter table statement.- Specified by:
getAlterTablein classAbstractTable- Parameters:
only- if true, append 'ONLY' to statement- Returns:
- alter table statement beginning in String format
-
setMethod
-
isLogged
public boolean isLogged()Checks if this table is logged (writes to WAL).- Returns:
- true if logged, false if unlogged
-
setLogged
public void setLogged(boolean isLogged) -
setTablespace
-
setRowSecurity
public void setRowSecurity(boolean isRowSecurity) -
setForceSecurity
public void setForceSecurity(boolean isForceSecurity) -
getPartitionBy
Gets the partition specification for this table.- Returns:
- partition by clause or null if not partitioned
-
setPartitionBy
-
setDistribution
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classAbstractPgTable
-
shallowCopy
Description copied from class:PgStatementCopies all object properties into a new object and leaves all its children empty.- Overrides:
shallowCopyin classAbstractPgTable- Returns:
- shallow copy of a DB object.
-
computeHash
Description copied from interface:IHashableComputes the hash of the implementing object using the provided hasher. The implementation should call appropriateputmethods on the hasher for all fields that should contribute to the hash value.- Specified by:
computeHashin interfaceIHashable- Overrides:
computeHashin classAbstractPgTable- Parameters:
hasher- the hasher instance to use for hash computation
-