Class QueryBuilder<T>

java.lang.Object
de.chojo.sqlutil.base.DataHolder
de.chojo.sqlutil.wrapper.QueryBuilder<T>
Type Parameters:
T - type of query return type
All Implemented Interfaces:
DataSourceProvider, ConfigurationStage<T>, InsertStage, QueryStage<T>, ResultStage<T>, RetrievalStage<T>, StatementStage<T>, UpdateStage

public class QueryBuilder<T> extends DataHolder implements ConfigurationStage<T>, QueryStage<T>, StatementStage<T>, ResultStage<T>, RetrievalStage<T>, InsertStage
This query builder can be used to execute one or more queries onto a database via a connection provided by a datasource.

The query builder is a stage organized object. Every call will be invoked on a stage of the same query builder.

You may execute as many updates as you want. You may only get the returned results of one query, which must be the last.

All methods which are not labeled with a Sync suffix will be executed in an async context. Async method will provide a callback via a CompletableFuture.

All queries will be executed in an atomic transaction. This means that data will be only written if all queries are executed successfully. This behaviour can be changed by calling QueryBuilderConfig.Builder.notAtomic() ()} on config creation.

Any exception thrown while executing queries will be wrapped into an QueryExecutionException. This exception was created on query submission to the query builder. Not that this is not the execution, which may be called on another thread. This exception will help you to trace back async calls.

Any SQLException thrown inside the query builder will not be thrown but logged by default.