Class PgCompositeType
java.lang.Object
org.pgcodekeeper.core.database.base.schema.AbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
org.pgcodekeeper.core.database.pg.schema.PgAbstractType
org.pgcodekeeper.core.database.pg.schema.PgCompositeType
- All Implemented Interfaces:
ICompositeType,ISearchPath,IStatement,IType,IHashable
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an attribute to this composite type.voidappendAlterComments(AbstractStatement 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(IStatement 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 list of all attributes.getAttrType(String attrName) Returns the type of the specified attribute.Methods inherited from class org.pgcodekeeper.core.database.pg.schema.PgAbstractType
appendAlterSQL, getCreationSQLMethods inherited from class org.pgcodekeeper.core.database.pg.schema.PgAbstractStatement
addPrivilege, appendDefaultPrivileges, appendOwnerSQL, formatSql, getQuoter, getRenameCommand, isOwnedMethods inherited from class org.pgcodekeeper.core.database.base.schema.AbstractStatement
addDependency, appendPrivileges, canDrop, canDropBeforeCreate, checkComments, clearPrivileges, compareChildren, deepCopy, equals, fillChildrenList, fillDescendantsList, getAuthor, getBareName, getChildren, getComment, getDependencies, getDescendants, getDropSQL, getDropSQL, getLibName, getLocation, getName, getObjectState, getObjectState, getOwner, getParent, getPrivileges, getQualifiedName, getSeparator, getSQL, getTwin, hasChildren, hashCode, isLib, setAuthor, setComment, setLibName, setLocation, setOwner, setParent, shallowCopy, toStringMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getContainingSchema, getDatabase, getSchemaName, toObjectReferenceMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IType
getStatementType
-
Constructor Details
-
PgCompositeType
Creates a new PostgreSQL composite type.- Parameters:
name- type name
-
-
Method Details
-
appendComments
Description copied from class:AbstractStatementAppends comment SQL to the script if this statement has comments.- Overrides:
appendCommentsin classAbstractStatement- Parameters:
script- the SQL script to append comments to
-
appendAlterComments
Description copied from class:AbstractStatementAppends ALTER comment SQL if the comment has changed.- Overrides:
appendAlterCommentsin classAbstractStatement- 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
Description copied from interface:ICompositeTypeReturns list of all attributes.- Specified by:
getAttrsin interfaceICompositeType- Returns:
- list of attributes
-
addAttr
Adds an attribute to this composite type.- Parameters:
attr- attribute to add
-
getAttrType
Description copied from interface:ICompositeTypeReturns the type of the specified attribute.- Specified by:
getAttrTypein interfaceICompositeType- Parameters:
attrName- the attribute name- Returns:
- the attribute type, or null if not found
-
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- Parameters:
hasher- the hasher instance to use for hash computation
-
compare
Description copied from class:AbstractStatementThis method does not account for nested child PgStatements. Shallow version ofAbstractStatement.equals(Object)- Specified by:
comparein interfaceIStatement- Overrides:
comparein classAbstractStatement
-