Class PgJdbcType
java.lang.Object
org.pgcodekeeper.core.database.pg.jdbc.PgJdbcType
Represents a PostgreSQL data type with schema qualification and array type handling.
Provides methods for generating qualified type names and managing type dependencies.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPgJdbcType(long oid, String typeName, long typelem, long typarray, String parentSchema, String elemname, long lastSysOid) Creates a new JDBC type representation. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds this type as a dependency to the specified statement if it's a user type.Returns the full type name with empty target schema.getFullName(String targetSchemaName) Returns the full type name with schema qualification and array notation.Returns the schema-qualified type name with empty target schema.getSchemaQualifiedName(String targetSchemaName) Returns the schema-qualified type name, applying aliases for pg_catalog types.Returns the ObjectReference representation containing the type's schema and name.
-
Field Details
-
DATA_TYPE_ALIASES
-
-
Constructor Details
-
PgJdbcType
public PgJdbcType(long oid, String typeName, long typelem, long typarray, String parentSchema, String elemname, long lastSysOid) Creates a new JDBC type representation. Array types have names beginning with underscore and have 0 in typarray column. Vector types have non-zero typarray values and are not converted to simple arrays.- Parameters:
oid- the type OIDtypeName- the type nametypelem- the element type OID for arraystyparray- the array type OIDparentSchema- the schema containing this typeelemname- the element type name for arrayslastSysOid- the last system OID for dependency checking
-
-
Method Details
-
getSchemaQualifiedName
Returns the schema-qualified type name, applying aliases for pg_catalog types.- Parameters:
targetSchemaName- the target schema name for qualification comparison- Returns:
- the qualified type name
-
getSchemaQualifiedName
Returns the schema-qualified type name with empty target schema.- Returns:
- the qualified type name
-
getFullName
Returns the full type name with schema qualification and array notation. If the type's schema differs from targetSchemaName, the returned name is schema-qualified. Array types have "[]" appended to the end.- Parameters:
targetSchemaName- the target schema name for qualification comparison- Returns:
- the full type name with array notation if applicable
-
getFullName
Returns the full type name with empty target schema.- Returns:
- the full type name with array notation if applicable
-
toReference
Returns the ObjectReference representation containing the type's schema and name.- Returns:
- the ObjectReference for this type
-
addTypeDepcy
Adds this type as a dependency to the specified statement if it's a user type.- Parameters:
st- the statement to add the dependency to
-