Class JdbcType

java.lang.Object
org.pgcodekeeper.core.loader.jdbc.JdbcType

public class JdbcType extends Object
Represents a PostgreSQL data type with schema qualification and array type handling. Provides methods for generating qualified type names and managing type dependencies.
  • Field Details

    • DATA_TYPE_ALIASES

      public static final Map<String,String> DATA_TYPE_ALIASES
  • Constructor Details

    • JdbcType

      public JdbcType(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 OID
      typeName - the type name
      typelem - the element type OID for arrays
      typarray - the array type OID
      parentSchema - the schema containing this type
      elemname - the element type name for arrays
      lastSysOid - the last system OID for dependency checking
  • Method Details

    • getSchemaQualifiedName

      public String getSchemaQualifiedName(String targetSchemaName)
      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

      public String getSchemaQualifiedName()
      Returns the schema-qualified type name with empty target schema.
      Returns:
      the qualified type name
    • getFullName

      public String getFullName(String targetSchemaName)
      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

      public String getFullName()
      Returns the full type name with empty target schema.
      Returns:
      the full type name with array notation if applicable
    • getQualifiedName

      public GenericColumn getQualifiedName()
      Returns the GenericColumn representation containing the type's schema and name.
      Returns:
      the GenericColumn for this type
    • addTypeDepcy

      public void addTypeDepcy(PgStatement st)
      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