Package org.jdbi.v3.postgres
Class PostgresTypes
- java.lang.Object
-
- org.jdbi.v3.postgres.PostgresTypes
-
- All Implemented Interfaces:
JdbiConfig<PostgresTypes>
public class PostgresTypes extends java.lang.Object implements JdbiConfig<PostgresTypes>
Handler for PostgreSQL custom types.
-
-
Field Summary
Fields Modifier and Type Field Description private PgLobApilobprivate ConfigRegistryregistryprivate java.util.Map<java.lang.Class<? extends org.postgresql.util.PGobject>,java.lang.String>types
-
Constructor Summary
Constructors Modifier Constructor Description PostgresTypes()privatePostgresTypes(PostgresTypes that)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddTypesToConnection(org.postgresql.PGConnection connection)Add handler for each registered PostgreSQL custom typePostgresTypescreateCopy()Returns a copy of this configuration object.PgLobApigetLobApi()Provide access to Large Object streaming via Postgres specific API.PostgresTypesregisterCustomType(java.lang.Class<? extends org.postgresql.util.PGobject> clazz, java.lang.String typeName)Register a Postgres custom type.(package private) PostgresTypessetLobApi(PgLobApi newLob)voidsetRegistry(ConfigRegistry registry)The registry will inject itself into the configuration object.
-
-
-
Field Detail
-
types
private final java.util.Map<java.lang.Class<? extends org.postgresql.util.PGobject>,java.lang.String> types
-
registry
private ConfigRegistry registry
-
lob
private PgLobApi lob
-
-
Constructor Detail
-
PostgresTypes
public PostgresTypes()
-
PostgresTypes
private PostgresTypes(PostgresTypes that)
-
-
Method Detail
-
setRegistry
public void setRegistry(ConfigRegistry registry)
Description copied from interface:JdbiConfigThe registry will inject itself into the configuration object. This can be useful if you need to look up dependencies. You will get a new registry after being copied.- Specified by:
setRegistryin interfaceJdbiConfig<PostgresTypes>- Parameters:
registry- the registry that owns this configuration object
-
registerCustomType
public PostgresTypes registerCustomType(java.lang.Class<? extends org.postgresql.util.PGobject> clazz, java.lang.String typeName)
Register a Postgres custom type.- Parameters:
clazz- the class implementing the Java representation of the custom type; must extendPGobject.typeName- the Postgres custom type name
-
setLobApi
PostgresTypes setLobApi(PgLobApi newLob)
-
getLobApi
public PgLobApi getLobApi()
Provide access to Large Object streaming via Postgres specific API.- Returns:
- the postgres large object api
-
addTypesToConnection
void addTypesToConnection(org.postgresql.PGConnection connection)
Add handler for each registered PostgreSQL custom type- Parameters:
connection- connection on which to add all registered PostgreSQL custom types
-
createCopy
public PostgresTypes createCopy()
Description copied from interface:JdbiConfigReturns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopyin interfaceJdbiConfig<PostgresTypes>- Returns:
- a copy of this configuration object.
-
-