Class QueryBuilderFactory

java.lang.Object
de.chojo.sqlutil.wrapper.QueryBuilderFactory

public class QueryBuilderFactory extends Object
This class provides simple methods to create preconfigured QueryBuilder.

The factory will always initialize the QueryBuilder with the plugin, datasource and configuration provided on creation.

This results in a QueryBuilder in the QueryStage and skips the ConfigurationStage.

  • Constructor Details

    • QueryBuilderFactory

      public QueryBuilderFactory(AtomicReference<QueryBuilderConfig> config, DataSource dataSource)
      Crea a new QueryBuilderFactory
      Parameters:
      config - configuration
      dataSource - data source
    • QueryBuilderFactory

      public QueryBuilderFactory(DataSource dataSource)
  • Method Details

    • builder

      public <T> QueryStage<T> builder(Class<T> clazz)
      Create a new query builder with a defined return type. Use it for selects.
      Type Parameters:
      T - type of return type
      Parameters:
      clazz - class of required return type. Doesnt matter if you want a list or single result.
      Returns:
      a new query builder in a QueryStage
    • builder

      public QueryStage<Void> builder()
      Create a new Query builder without a defined return type. Use it for updates.
      Returns:
      a new query builder in a QueryStage
    • source

      public DataSource source()
    • config