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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns a copy of this configuration object.Optional<SqlArrayType<?>> Obtain anSqlArrayTypefor the given array element type in the given contextReturns the strategy used to bind array-type arguments to SQL statements.Returns theJdbiInterceptionChainHolderfor the SqlArrayType inference.Register an array element type that is supported by the JDBC vendor.register(SqlArrayType<?> arrayType) Register aSqlArrayTypewhich 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.voidsetRegistry(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 aSqlArrayTypewhich will have its parameterized type inspected to determine which element type it supports.SQL array typesare used to convert array-like arguments into SQL arrays.The parameter must be concretely parameterized; we use the type argument
Tto 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 anSqlArrayTypefor it.- Parameters:
factory- the factory- Returns:
- this
-
findFor
Obtain anSqlArrayTypefor the given array element type in the given context- Parameters:
elementType- the array element type.- Returns:
- an
SqlArrayTypefor the given element type.
-
setRegistry
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<SqlArrayTypes>- Parameters:
registry- the registry that owns this configuration object
-
getInferenceInterceptors
@Alpha public JdbiInterceptionChainHolder<SqlArrayType<?>,SqlArrayTypeFactory> getInferenceInterceptors()Returns theJdbiInterceptionChainHolderfor 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:JdbiConfigReturns a copy of this configuration object. Changes to the copy should not modify the original, and vice-versa.- Specified by:
createCopyin interfaceJdbiConfig<SqlArrayTypes>- Returns:
- a copy of this configuration object.
-