public class TypeRegistry extends Object
| Modifier and Type | Class and Description |
|---|---|
private static class |
TypeRegistry.SqlTypeMapper
Allows to obtain the SQL type corresponding to PG types.
|
| Constructor and Description |
|---|
TypeRegistry(PostgresConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
private void |
addType(PostgresType type) |
int |
citextArrayOid() |
int |
citextOid() |
private PostgresType.Builder |
createTypeBuilderFromResultSet(ResultSet rs) |
int |
geographyArrayOid() |
int |
geographyOid() |
int |
geometryArrayOid() |
int |
geometryOid() |
PostgresType |
get(int oid) |
PostgresType |
get(String name) |
private static Map<String,String> |
getLongTypeNames() |
int |
hstoreArrayOid() |
int |
hstoreOid() |
private PostgresType |
loadType(PreparedStatement statement) |
int |
ltreeArrayOid() |
int |
ltreeOid() |
static String |
normalizeTypeName(String typeName)
Converts a type name in long (readable) format like
boolean to s standard
data type name like bool. |
private void |
prime()
Prime the
TypeRegistry with all existing database types |
private PostgresType |
resolveUnknownType(int lookupOid) |
private PostgresType |
resolveUnknownType(String name) |
private static final org.slf4j.Logger LOGGER
public static final String TYPE_NAME_GEOGRAPHY
public static final String TYPE_NAME_GEOMETRY
public static final String TYPE_NAME_CITEXT
public static final String TYPE_NAME_HSTORE
public static final String TYPE_NAME_LTREE
public static final String TYPE_NAME_HSTORE_ARRAY
public static final String TYPE_NAME_GEOGRAPHY_ARRAY
public static final String TYPE_NAME_GEOMETRY_ARRAY
public static final String TYPE_NAME_CITEXT_ARRAY
public static final String TYPE_NAME_LTREE_ARRAY
public static final int NO_TYPE_MODIFIER
public static final int UNKNOWN_LENGTH
public static final int DOMAIN_TYPE
private static final String CATEGORY_ARRAY
private static final String CATEGORY_ENUM
private static final String SQL_ENUM_VALUES
private static final String SQL_TYPES
private static final String SQL_NAME_LOOKUP
private static final String SQL_OID_LOOKUP
private final Map<String,PostgresType> nameToType
private final Map<Integer,PostgresType> oidToType
private final Connection connection
private final org.postgresql.core.TypeInfo typeInfo
private final TypeRegistry.SqlTypeMapper sqlTypeMapper
private int geometryOid
private int geographyOid
private int citextOid
private int hstoreOid
private int ltreeOid
private int hstoreArrayOid
private int geometryArrayOid
private int geographyArrayOid
private int citextArrayOid
private int ltreeArrayOid
public TypeRegistry(PostgresConnection connection)
private void addType(PostgresType type)
public PostgresType get(int oid)
oid - - PostgreSQL OIDpublic PostgresType get(String name)
name - - PostgreSQL type namepublic int geometryOid()
GEOMETRY type of this PostgreSQL instancepublic int geographyOid()
GEOGRAPHY type of this PostgreSQL instancepublic int citextOid()
CITEXT type of this PostgreSQL instancepublic int hstoreOid()
HSTORE type of this PostgreSQL instancepublic int ltreeOid()
LTREE type of this PostgreSQL instancepublic int hstoreArrayOid()
HSTORE type of this PostgreSQL instancepublic int geometryArrayOid()
GEOMETRY type of this PostgreSQL instancepublic int geographyArrayOid()
GEOGRAPHY type of this PostgreSQL instancepublic int citextArrayOid()
CITEXT type of this PostgreSQL instancepublic int ltreeArrayOid()
LTREE type of this PostgreSQL instancepublic static String normalizeTypeName(String typeName)
boolean to s standard
data type name like bool.typeName - - a type name in long formatprivate void prime()
throws SQLException
TypeRegistry with all existing database typesSQLExceptionprivate PostgresType.Builder createTypeBuilderFromResultSet(ResultSet rs) throws SQLException
SQLExceptionprivate PostgresType resolveUnknownType(String name)
private PostgresType resolveUnknownType(int lookupOid)
private PostgresType loadType(PreparedStatement statement) throws SQLException
SQLExceptionCopyright © 2021 JBoss by Red Hat. All rights reserved.