Package org.jdbi.v3.core.array
Class SqlArrayTypes
java.lang.Object
org.jdbi.v3.core.array.SqlArrayTypes
- All Implemented Interfaces:
JdbiConfig<SqlArrayTypes>
Configuration class for SQL array binding and mapping.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this configuration object.Optional
<SqlArrayType<?>> Obtain anSqlArrayType
for the given array element type in the given contextReturns the strategy used to bind array-type arguments to SQL statements.Returns theJdbiInterceptionChainHolder
for the SqlArrayType inference.Register an array element type that is supported by the JDBC vendor.register
(SqlArrayType<?> arrayType) Register aSqlArrayType
which will have its parameterized type inspected to determine which element type it supports.register
(SqlArrayTypeFactory factory) Register aSqlArrayTypeFactory
.setArgumentStrategy
(SqlArrayArgumentStrategy argumentStrategy) Sets the strategy used when binding array-type arguments to SQL statements.void
setRegistry
(ConfigRegistry registry) The registry will inject itself into the configuration object.
-
Constructor Details
-
SqlArrayTypes
public SqlArrayTypes()
-
-
Method Details
-
getArgumentStrategy
Returns the strategy used to bind array-type arguments to SQL statements.- Returns:
- the strategy used to bind array-type arguments to SQL statements
-
setArgumentStrategy
Sets the strategy used when binding array-type arguments to SQL statements.- Parameters:
argumentStrategy
- the argument strategy to set- Returns:
- this
-
register
Register an array element type that is supported by the JDBC vendor.- Parameters:
elementType
- the array element typesqlTypeName
- the vendor-specific SQL type name for the array type. This value will be passed toConnection.createArrayOf(String, Object[])
to create SQL arrays.- Returns:
- this
-
register
Register aSqlArrayType
which will have its parameterized type inspected to determine which element type it supports.SQL array types
are used to convert array-like arguments into SQL arrays.The parameter must be concretely parameterized; we use the type argument
T
to determine if it applies to a given element type.- Parameters:
arrayType
- theSqlArrayType
- Returns:
- this
- Throws:
UnsupportedOperationException
- if the argument is not a concretely parameterized type
-
register
Register aSqlArrayTypeFactory
. A factory is provided element types and, if it supports it, provides anSqlArrayType
for it.- Parameters:
factory
- the factory- Returns:
- this
-
findFor
Obtain anSqlArrayType
for the given array element type in the given context- Parameters:
elementType
- the array element type.- Returns:
- an
SqlArrayType
for the given element type.
-
setRegistry
Description copied from interface:JdbiConfig
The 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:
setRegistry
in interfaceJdbiConfig<SqlArrayTypes>
- Parameters:
registry
- the registry that owns this configuration object
-
getInferenceInterceptors
@Alpha public JdbiInterceptionChainHolder<SqlArrayType<?>,SqlArrayTypeFactory> getInferenceInterceptors()Returns theJdbiInterceptionChainHolder
for the SqlArrayType inference. This chain allows registration of custom interceptors to change the standard type inference for theregister(SqlArrayType)
method. -
createCopy
Description copied from interface:JdbiConfig
Returns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopy
in interfaceJdbiConfig<SqlArrayTypes>
- Returns:
- a copy of this configuration object.
-