Class TypeRegistry.SqlTypeMapper

  • Enclosing class:
    TypeRegistry

    private static class TypeRegistry.SqlTypeMapper
    extends Object
    Allows to obtain the SQL type corresponding to PG types. This uses a custom statement instead of going through PgDatabaseMetaData.getTypeInfo() as the latter causes N+1 SELECTs, making it very slow on installations with many custom types.
    Author:
    Gunnar Morling
    • Field Detail

      • SQL_TYPE_DETAILS

        private static final String SQL_TYPE_DETAILS
        Based on org.postgresql.jdbc.TypeInfoCache.getSQLType(String). To emulate the original statement's behavior (which works for single types only), PG's DISTINCT ON extension is used to just return the first entry should a type exist in multiple schemas.
        See Also:
        Constant Field Values
      • typeInfo

        private final org.postgresql.core.TypeInfo typeInfo