Package overit.geocall.sql.batch
Interface BatchBuilder
- All Known Implementing Classes:
BatchBuilderImpl
public interface BatchBuilder
Builder useful for building a new instance of
Batch.-
Field Summary
Fields -
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.
-
Field Details
-
DEFAULT_BATCH_SIZE
static final int DEFAULT_BATCH_SIZEDefault batch size.- See Also:
-
-
Method Details
-
insert
Adds aCommandContextof typeDAO.INSERTto the batch command list.- Parameters:
values-Map<String, Object> about the values needed by the insert command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
update
BatchBuilder update(@NotNull @NotNull Map<String, Object> filters, @NotNull @NotNull Map<String, Object> values) Adds aCommandContextof typeDAO.UPDATE_FILTERto the batch command list.- 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
BatchBuilder updatePk(@NotNull @NotNull Map<String, Object> filters, @NotNull @NotNull Map<String, Object> values) Adds aCommandContextof typeDAO.UPDATE_PKto the batch command list.- 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
Adds aCommandContextof typeDAO.DELETE_FILTERto the batch command list.- Parameters:
filters-Map<String, Object> about the filters needed by the delete command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
deletePk
Adds aCommandContextof typeDAO.DELETE_PKto the batch command list.- Parameters:
filters-Map<String, Object> about the filters needed by the delete command.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
add
Adds the providedCommandContextto the batch command list.- Parameters:
commandContext-CommandContextto add to the batch command list.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
batchSize
Sets the value of theBatch.getBatchSize()field.- 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
Sets the providedDBStatementObserver.- Parameters:
statementObserver-DBStatementObserverto be added to the generatedBatch.- Returns:
- a reference to this
BatchBuilderto call other methods.
-
build
Batch build()Creates and returns a newBatchinstance using the attributes set so far.- Returns:
- a new
Batchinstance using the attributes set so far.
-