Package overit.geocall.sql.batch
Class BatchBuilderImpl
java.lang.Object
overit.geocall.sql.batch.BatchBuilderImpl
- All Implemented Interfaces:
BatchBuilder
Default
BatchBuilder implementation.-
Field Summary
Fields inherited from interface overit.geocall.sql.batch.BatchBuilder
DEFAULT_BATCH_SIZE -
Method Summary
Modifier and TypeMethodDescriptionadd(@NotNull CommandContext commandContext) Adds the providedCommandContextto the batch command list.batchSize(int batchSize) Sets the value of theBatch.getBatchSize()field.build()Creates and returns a newBatchinstance using the attributes set so far.Adds aCommandContextof typeDAO.DELETE_FILTERto the batch command list.Adds aCommandContextof typeDAO.DELETE_PKto the batch command list.Adds aCommandContextof typeDAO.INSERTto the batch command list.statementObserver(@NotNull DBStatementObserver statementObserver) Sets the providedDBStatementObserver.Adds aCommandContextof typeDAO.UPDATE_FILTERto the batch command list.Adds aCommandContextof typeDAO.UPDATE_PKto the batch command list.
-
Method Details
-
insert
Description copied from interface:BatchBuilderAdds aCommandContextof typeDAO.INSERTto the batch command list.- Specified by:
insertin interfaceBatchBuilder- Parameters:
values-Map<String, Object> about the values needed by the insert command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
update
public BatchBuilder update(@NotNull @NotNull Map<String, Object> filters, @NotNull @NotNull Map<String, Object> values) Description copied from interface:BatchBuilderAdds aCommandContextof typeDAO.UPDATE_FILTERto the batch command list.- Specified by:
updatein interfaceBatchBuilder- Parameters:
filters-Map<String, Object> about the filters needed by the update command.values-Map<String, Object> about the values needed by the update command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
updatePk
public BatchBuilder updatePk(@NotNull @NotNull Map<String, Object> filters, @NotNull @NotNull Map<String, Object> values) Description copied from interface:BatchBuilderAdds aCommandContextof typeDAO.UPDATE_PKto the batch command list.- Specified by:
updatePkin interfaceBatchBuilder- Parameters:
filters-Map<String, Object> about the filters needed by the update command.values-Map<String, Object> about the values needed by the update command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
delete
Description copied from interface:BatchBuilderAdds aCommandContextof typeDAO.DELETE_FILTERto the batch command list.- Specified by:
deletein interfaceBatchBuilder- Parameters:
filters-Map<String, Object> about the filters needed by the delete command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
deletePk
Description copied from interface:BatchBuilderAdds aCommandContextof typeDAO.DELETE_PKto the batch command list.- Specified by:
deletePkin interfaceBatchBuilder- Parameters:
filters-Map<String, Object> about the filters needed by the delete command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
add
Description copied from interface:BatchBuilderAdds the providedCommandContextto the batch command list.- Specified by:
addin interfaceBatchBuilder- Parameters:
commandContext-CommandContextto add to the batch command list.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
batchSize
Description copied from interface:BatchBuilderSets the value of theBatch.getBatchSize()field.- Specified by:
batchSizein interfaceBatchBuilder- Parameters:
batchSize- size of the batch (useful for executing the batch whenever the batch size reaches this value).- Returns:
- a reference to this
BatchBuilderto call other methods.
-
statementObserver
Description copied from interface:BatchBuilderSets the providedDBStatementObserver.- Specified by:
statementObserverin interfaceBatchBuilder- Parameters:
statementObserver-DBStatementObserverto be added to the generatedBatch.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
build
Description copied from interface:BatchBuilderCreates and returns a newBatchinstance using the attributes set so far.- Specified by:
buildin interfaceBatchBuilder- Returns:
- a new
Batchinstance using the attributes set so far.
-