Class MetaContainer
java.lang.Object
org.pgcodekeeper.core.database.base.schema.meta.MetaContainer
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a statement to the appropriate collection based on its type.availableFunctions(String schemaName) Returns available functions in the specified schema.availableOperators(String schemaName) Returns available operators in the specified schema.booleancontainsCastImplicit(String source, String target) Checks if there is an implicit cast from source to target type.findFunction(String schemaName, String functionName) Finds a function by schema and name.findOperator(String schemaName, String operatorName) Finds an operator by schema and name.findRelation(String schemaName, String relationName) Finds a relation by schema and name.Finds composite type by schema and name.getPrimaryKeys(String schemaName, String tableName) Returns primary keys for the specified table.Returns all relations grouped by schema name.
-
Constructor Details
-
MetaContainer
public MetaContainer()
-
-
Method Details
-
addStatement
Adds a statement to the appropriate collection based on its type.- Parameters:
st- the statement to add
-
containsCastImplicit
Description copied from interface:IMetaContainerChecks if there is an implicit cast from source to target type.- Specified by:
containsCastImplicitin interfaceIMetaContainer- Parameters:
source- the source data typetarget- the target data type- Returns:
- true if an implicit cast exists, false otherwise
-
findRelation
Description copied from interface:IMetaContainerFinds a relation by schema and name.- Specified by:
findRelationin interfaceIMetaContainer- Parameters:
schemaName- the schema namerelationName- the relation name- Returns:
- the relation, or null if not found
-
getRelations
Description copied from interface:IMetaContainerReturns all relations grouped by schema name.- Specified by:
getRelationsin interfaceIMetaContainer- Returns:
- unmodifiable map of relations
-
findFunction
Description copied from interface:IMetaContainerFinds a function by schema and name.- Specified by:
findFunctionin interfaceIMetaContainer- Parameters:
schemaName- the schema namefunctionName- the function name- Returns:
- the function, or null if not found
-
availableFunctions
Description copied from interface:IMetaContainerReturns available functions in the specified schema.- Specified by:
availableFunctionsin interfaceIMetaContainer- Parameters:
schemaName- the schema name- Returns:
- unmodifiable collection of functions
-
findOperator
Description copied from interface:IMetaContainerFinds an operator by schema and name.- Specified by:
findOperatorin interfaceIMetaContainer- Parameters:
schemaName- the schema nameoperatorName- the operator name- Returns:
- the operator, or null if not found
-
findType
Description copied from interface:IMetaContainerFinds composite type by schema and name.- Specified by:
findTypein interfaceIMetaContainer- Parameters:
schemaName- the schema nametypeName- the type name- Returns:
- the composite type, or null if not found
-
availableOperators
Description copied from interface:IMetaContainerReturns available operators in the specified schema.- Specified by:
availableOperatorsin interfaceIMetaContainer- Parameters:
schemaName- the schema name- Returns:
- unmodifiable collection of operators
-
getPrimaryKeys
Description copied from interface:IMetaContainerReturns primary keys for the specified table.- Specified by:
getPrimaryKeysin interfaceIMetaContainer- Parameters:
schemaName- the schema nametableName- the table name- Returns:
- collection of primary keys for the table
-