java.lang.Object
org.pgcodekeeper.core.database.base.schema.meta.MetaContainer
All Implemented Interfaces:
IMetaContainer

public class MetaContainer extends Object implements IMetaContainer
Container for database metadata objects organized by type and schema. Provides efficient lookup and storage of functions, operators, relations, constraints, casts, and composite types from database schemas.
  • Constructor Details

    • MetaContainer

      public MetaContainer()
  • Method Details

    • addStatement

      public void addStatement(IStatement st)
      Adds a statement to the appropriate collection based on its type.
      Parameters:
      st - the statement to add
    • containsCastImplicit

      public boolean containsCastImplicit(String source, String target)
      Description copied from interface: IMetaContainer
      Checks if there is an implicit cast from source to target type.
      Specified by:
      containsCastImplicit in interface IMetaContainer
      Parameters:
      source - the source data type
      target - the target data type
      Returns:
      true if an implicit cast exists, false otherwise
    • findRelation

      public IRelation findRelation(String schemaName, String relationName)
      Description copied from interface: IMetaContainer
      Finds a relation by schema and name.
      Specified by:
      findRelation in interface IMetaContainer
      Parameters:
      schemaName - the schema name
      relationName - the relation name
      Returns:
      the relation, or null if not found
    • getRelations

      public Map<String,Map<String,IRelation>> getRelations()
      Description copied from interface: IMetaContainer
      Returns all relations grouped by schema name.
      Specified by:
      getRelations in interface IMetaContainer
      Returns:
      unmodifiable map of relations
    • findFunction

      public IFunction findFunction(String schemaName, String functionName)
      Description copied from interface: IMetaContainer
      Finds a function by schema and name.
      Specified by:
      findFunction in interface IMetaContainer
      Parameters:
      schemaName - the schema name
      functionName - the function name
      Returns:
      the function, or null if not found
    • availableFunctions

      public Collection<IFunction> availableFunctions(String schemaName)
      Description copied from interface: IMetaContainer
      Returns available functions in the specified schema.
      Specified by:
      availableFunctions in interface IMetaContainer
      Parameters:
      schemaName - the schema name
      Returns:
      unmodifiable collection of functions
    • findOperator

      public IOperator findOperator(String schemaName, String operatorName)
      Description copied from interface: IMetaContainer
      Finds an operator by schema and name.
      Specified by:
      findOperator in interface IMetaContainer
      Parameters:
      schemaName - the schema name
      operatorName - the operator name
      Returns:
      the operator, or null if not found
    • findType

      public ICompositeType findType(String schemaName, String typeName)
      Description copied from interface: IMetaContainer
      Finds composite type by schema and name.
      Specified by:
      findType in interface IMetaContainer
      Parameters:
      schemaName - the schema name
      typeName - the type name
      Returns:
      the composite type, or null if not found
    • availableOperators

      public Collection<IOperator> availableOperators(String schemaName)
      Description copied from interface: IMetaContainer
      Returns available operators in the specified schema.
      Specified by:
      availableOperators in interface IMetaContainer
      Parameters:
      schemaName - the schema name
      Returns:
      unmodifiable collection of operators
    • getPrimaryKeys

      public Collection<IConstraintPk> getPrimaryKeys(String schemaName, String tableName)
      Description copied from interface: IMetaContainer
      Returns primary keys for the specified table.
      Specified by:
      getPrimaryKeys in interface IMetaContainer
      Parameters:
      schemaName - the schema name
      tableName - the table name
      Returns:
      collection of primary keys for the table