Class MetaRelation
java.lang.Object
org.pgcodekeeper.core.database.base.schema.meta.MetaStatement
org.pgcodekeeper.core.database.base.schema.meta.MetaRelation
- All Implemented Interfaces:
Serializable,IRelation,ISearchPath,IStatement
Represents a database relation metadata object (table, view, sequence, etc.).
Stores information about relation columns including their names and types.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionMetaRelation(String schemaName, String relationName, DbObjType type) Creates a new relation metadata object.MetaRelation(ObjectLocation object) Creates a new relation metadata object with location information. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumns(List<? extends Pair<String, String>> columns) Sets the columns for this relation.Returns the containing schema of this relation.Gets the columns of this relation as name-type pairs.Returns the schema name of this relation.Methods inherited from class org.pgcodekeeper.core.database.base.schema.meta.MetaStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, compare, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDatabase, getDependencies, getDescendants, getDropSQL, getFilePath, getLibName, getLineNumber, getLocation, getName, getObject, getObjectReference, getObjLength, getOffset, getOwner, getParent, getPrivileges, getQualifiedName, getQuoter, getRenameCommand, getSeparator, getSQL, getStatementType, getTwin, hasChildren, isLib, setComment, setLibName, setLocation, setOwner, shallowCopyMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.pgcodekeeper.core.database.api.schema.ISearchPath
getDatabase, toObjectReferenceMethods inherited from interface org.pgcodekeeper.core.database.api.schema.IStatement
addDependency, appendAlterSQL, appendOwnerSQL, canDrop, canDropBeforeCreate, clearPrivileges, compare, deepCopy, formatSql, getAuthor, getBareName, getChildren, getComment, getCreationSQL, getDependencies, getDescendants, getDropSQL, getLibName, getLocation, getName, getOwner, getParent, getPrivileges, getQualifiedName, getQuotedName, getQuoter, getRenameCommand, getSeparator, getSQL, getStatementType, getTwin, getTypeName, hasChildren, isLib, isOwned, quote, setComment, setLibName, setLocation, setOwner, shallowCopy
-
Constructor Details
-
MetaRelation
Creates a new relation metadata object with location information.- Parameters:
object- the object location information
-
MetaRelation
Creates a new relation metadata object.- Parameters:
schemaName- the schema namerelationName- the relation nametype- the database object type
-
-
Method Details
-
getRelationColumns
Description copied from interface:IRelationGets the columns of this relation as name-type pairs.- Specified by:
getRelationColumnsin interfaceIRelation- Returns:
- a stream of column name and type pairs
-
addColumns
Sets the columns for this relation.- Parameters:
columns- the list of column name-type pairs
-
getContainingSchema
Returns the containing schema of this relation. This operation is not supported for metadata relations.- Specified by:
getContainingSchemain interfaceISearchPath- Returns:
- never returns normally
- Throws:
IllegalStateException- always thrown as this operation is unsupported
-
getSchemaName
Returns the schema name of this relation.- Specified by:
getSchemaNamein interfaceISearchPath- Returns:
- the schema name
-