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

public final class MetaRelation extends MetaStatement implements IRelation
Represents a database relation metadata object (table, view, sequence, etc.). Stores information about relation columns including their names and types.
See Also:
  • Constructor Details

    • MetaRelation

      public MetaRelation(ObjectLocation object)
      Creates a new relation metadata object with location information.
      Parameters:
      object - the object location information
    • MetaRelation

      public MetaRelation(String schemaName, String relationName, DbObjType type)
      Creates a new relation metadata object.
      Parameters:
      schemaName - the schema name
      relationName - the relation name
      type - the database object type
  • Method Details

    • getRelationColumns

      public Stream<Pair<String,String>> getRelationColumns()
      Description copied from interface: IRelation
      Gets the columns of this relation as name-type pairs.
      Specified by:
      getRelationColumns in interface IRelation
      Returns:
      a stream of column name and type pairs
    • addColumns

      public void addColumns(List<? extends Pair<String,String>> columns)
      Sets the columns for this relation.
      Parameters:
      columns - the list of column name-type pairs
    • getContainingSchema

      public ISchema getContainingSchema()
      Returns the containing schema of this relation. This operation is not supported for metadata relations.
      Specified by:
      getContainingSchema in interface ISearchPath
      Returns:
      never returns normally
      Throws:
      IllegalStateException - always thrown as this operation is unsupported
    • getSchemaName

      public String getSchemaName()
      Returns the schema name of this relation.
      Specified by:
      getSchemaName in interface ISearchPath
      Returns:
      the schema name