Class SqlBatchHandler
java.lang.Object
org.jdbi.v3.sqlobject.statement.internal.CustomizingStatementHandler<PreparedBatch>
org.jdbi.v3.sqlobject.statement.internal.SqlBatchHandler
- All Implemented Interfaces:
ExtensionHandler
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate static classprivate static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SqlBatchHandler.ChunkSizeFunctionprivate final Function<PreparedBatch,ResultIterator<?>> private final ResultReturnerprivate final SqlBatchFields inherited from interface org.jdbi.v3.core.extension.ExtensionHandler
EQUALS_HANDLER, HASHCODE_HANDLER, NULL_HANDLER -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) void(package private) PreparedBatchcreateStatement(Handle handle, String locatedSql) determineBatchChunkSize(Class<?> sqlObjectType, Method method) private ResultIterator<?>executeBatch(Handle handle, Supplier<PreparedBatch> preparedBatchSupplier) (package private) TypegetParameterType(Parameter parameter) private intindexOfBatchChunkSizeParameter(Method method) private static StringinvalidReturnTypeMessage(Method method) invoke(HandleSupplier handleSupplier, Object target, Object... args) Gets invoked to return a value for the method that this handler was bound to.private Function<PreparedBatch,ResultIterator<?>> mapToBoolean(Function<PreparedBatch, ResultIterator<?>> modCounts) private static booleanreturnTypeIsValid(Class<?> type) voidwarm(ConfigRegistry config) Called after the method handler is constructed to pre-initialize any important configuration data structures.Methods inherited from class org.jdbi.v3.sqlobject.statement.internal.CustomizingStatementHandler
applyCustomizers, getMethod, locateSql, rowMapperFor, rowReducerFor
-
Field Details
-
sqlBatch
-
batchChunkSize
-
batchIntermediate
-
magic
-
-
Constructor Details
-
SqlBatchHandler
-
-
Method Details
-
warm
Description copied from interface:ExtensionHandlerCalled after the method handler is constructed to pre-initialize any important configuration data structures.- Specified by:
warmin interfaceExtensionHandler- Overrides:
warmin classCustomizingStatementHandler<PreparedBatch>- Parameters:
config- the method configuration to use for warming up
-
mapToBoolean
private Function<PreparedBatch,ResultIterator<?>> mapToBoolean(Function<PreparedBatch, ResultIterator<?>> modCounts) -
determineBatchChunkSize
private SqlBatchHandler.ChunkSizeFunction determineBatchChunkSize(Class<?> sqlObjectType, Method method) -
indexOfBatchChunkSizeParameter
-
createStatement
- Specified by:
createStatementin classCustomizingStatementHandler<PreparedBatch>
-
configureReturner
- Specified by:
configureReturnerin classCustomizingStatementHandler<PreparedBatch>
-
getParameterType
- Overrides:
getParameterTypein classCustomizingStatementHandler<PreparedBatch>
-
invoke
Description copied from interface:ExtensionHandlerGets invoked to return a value for the method that this handler was bound to.- Specified by:
invokein interfaceExtensionHandler- Overrides:
invokein classCustomizingStatementHandler<PreparedBatch>- Parameters:
handleSupplier- AHandleSupplierinstance for accessing the handle and its related objectstarget- The target object on which the handler should operateargs- Optional arguments for the handler- Returns:
- The return value for the method that was bound to the extension handler. Can be null
-
zipArgs
-
executeBatch
private ResultIterator<?> executeBatch(Handle handle, Supplier<PreparedBatch> preparedBatchSupplier) -
returnTypeIsValid
-
invalidReturnTypeMessage
-