public class PostgreSQLCatalogInspector
extends java.lang.Object
This class acts as the centralized catalog reader of the schema generator. It isolates
all read operations against system catalogs like pg_class, pg_attribute,
and information_schema.
Architectural Benefits:
PostgreSQLMigrationContext to drastically reduce JDBC roundtrips.CBOSchema.SQL_IDENTIFIER_MAXLENGTH).| Constructor and Description |
|---|
PostgreSQLCatalogInspector(PostgreSQL pg,
PostgreSQLMigrationContext ctx) |
| Modifier and Type | Method and Description |
|---|---|
java.util.Map<java.lang.String,PostgreSQLColumn> |
getColumnsForTable(java.lang.String tableName)
Gets the columns we currently *have* in the given database table by querying JDBC metadata.
|
java.lang.String |
getTableNameForOid(long tableOid)
Resolves a PostgreSQL OID to its human-readable table name using the cached map.
|
java.lang.Long |
getTableOidForName(java.lang.String tableName)
Retrieves the OID for a specific table name from the pre-populated lookup map.
|
void |
initNotNullConstraintInfo(java.lang.String columnName)
Initializes a set of table names that have a NOT NULL constraint for a specific column.
|
void |
initTablesMaps(boolean forceUpdate)
Retrieves info about all currently existing tables from the PostgreSQL
database and populates the internal lookup maps (tablesPerName and tablesPerOid).
|
public PostgreSQLCatalogInspector(PostgreSQL pg, PostgreSQLMigrationContext ctx)
public void initTablesMaps(boolean forceUpdate)
Defends against Identifier Truncation schema conflicts by throwing an exception if two tables map to the same truncated 63-character name.
forceUpdate - Forces a refresh of the internal cache if true.public void initNotNullConstraintInfo(java.lang.String columnName)
public java.util.Map<java.lang.String,PostgreSQLColumn> getColumnsForTable(java.lang.String tableName)
Uses isolated ResultSets to prevent conflicts with subsequent database operations.
tableName - The SQL table name to inspect.public java.lang.Long getTableOidForName(java.lang.String tableName)
tableName - The exact SQL table name to look up.public java.lang.String getTableNameForOid(long tableOid)
tableOid - The PostgreSQL OID.Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.