Package org.pgcodekeeper.core.schema.pg
Class PgCompositeType
java.lang.Object
org.pgcodekeeper.core.schema.PgStatement
org.pgcodekeeper.core.schema.AbstractType
org.pgcodekeeper.core.schema.pg.PgCompositeType
- All Implemented Interfaces:
IHashable,ISearchPath,IStatement
PostgreSQL composite type implementation.
Represents a composite type consisting of multiple attributes (fields),
similar to a table row structure but used as a data type.
-
Field Summary
Fields inherited from class org.pgcodekeeper.core.schema.PgStatement
GO -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttr(AbstractColumn attr) Adds an attribute to this composite type.voidappendAlterComments(PgStatement newObj, SQLScript script) Appends ALTER comment SQL if the comment has changed.voidappendComments(SQLScript script) Appends comment SQL to the script if this statement has comments.booleancompare(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.Returns an attribute by name.getAttrs()Returns an unmodifiable list of all attributes.Methods inherited from class org.pgcodekeeper.core.schema.AbstractType
appendAlterSQL, getContainingSchema, getCreationSQL, getStatementType, shallowCopyMethods inherited from class org.pgcodekeeper.core.schema.PgStatement
addAllDeps, addDep, addPrivilege, appendOwnerSQL, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, 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.ISearchPath
getDatabase, getSchemaNameMethods inherited from interface org.pgcodekeeper.core.schema.IStatement
getBareName, getComment, getName, getParent, getQualifiedName
-
Constructor Details
-
PgCompositeType
Creates a new PostgreSQL composite type.- Parameters:
name- type name
-
-
Method Details
-
appendComments
Description copied from class:PgStatementAppends comment SQL to the script if this statement has comments.- Overrides:
appendCommentsin classPgStatement- Parameters:
script- the SQL script to append comments to
-
appendAlterComments
Description copied from class:PgStatementAppends ALTER comment SQL if the comment has changed.- Overrides:
appendAlterCommentsin classPgStatement- Parameters:
newObj- the new statement to compare comments withscript- the SQL script to append ALTER comments to
-
getAttr
Returns an attribute by name.- Parameters:
name- attribute name- Returns:
- attribute or null if not found
-
getAttrs
Returns an unmodifiable list of all attributes.- Returns:
- list of attributes
-
addAttr
Adds an attribute to this composite type.- Parameters:
attr- attribute to add
-
compare
Description copied from class:PgStatementThis method does not account for nested child PgStatements. Shallow version ofPgStatement.equals(Object)- Overrides:
comparein classAbstractType
-
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.- Parameters:
hasher- the hasher instance to use for hash computation
-