Package de.chojo.sqlutil.wrapper
Class QueryBuilderConfig.Builder
java.lang.Object
de.chojo.sqlutil.wrapper.QueryBuilderConfig.Builder
- Enclosing class:
- QueryBuilderConfig
Builder for a
QueryBuilderConfig-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()Retrieve a newQueryBuilderConfiginstance.Disable the default logger.Set that the queries are not executed atomic.Sets the query builder as throwing.withExceptionHandler(Consumer<SQLException> exceptionHandler) Sets the query builder exception handler.withExecutor(ExecutorService executorService) Sets the exector service used for the completable futures.
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
throwExceptions
Sets the query builder as throwing. This will cause any occuring exception to be wrapped into anQueryExecutionExceptionand be thrown instead of logged.- Returns:
- The
QueryBuilderConfig.Builderwith the value set.
-
withExceptionHandler
Sets the query builder exception handler. This will only have an effect ifthrowExceptions()is not called.- Parameters:
exceptionHandler- handler for exception- Returns:
- The
QueryBuilderConfig.Builderwith the value set.
-
disableDefaultLogger
Disable the default logger.- Returns:
- builder instance
-
notAtomic
Set that the queries are not executed atomic.When the queries are atomic they will be executed in one transaction. This will cause that no data will be changed if any query fails to execute.
On default queries will be also executed atomic. This method just exists for convenience. No queries will be executed after one query fails in any way.
- Returns:
- The
QueryBuilderConfig.Builderin with the atomic value set.
-
withExecutor
Sets the exector service used for the completable futures.- Parameters:
executorService- executor service- Returns:
- The
QueryBuilderConfig.Builderin with the executor set.
-
build
Retrieve a newQueryBuilderConfiginstance.- Returns:
- config with defined values
-