Class JooqHelper$

java.lang.Object
csw.database.javadsl.JooqHelper$

public class JooqHelper$ extends Object
A java helper wrapping few of the Jooq operations. JOOQ is a library that provides the mechanism to communicate with Database server. To know in detail about Jooq please refer {@link https://www.jooq.org/learn/}.
  • Field Details

    • MODULE$

      public static final JooqHelper$ MODULE$
      Static reference to the singleton instance of this Scala object.
  • Constructor Details

    • JooqHelper$

      public JooqHelper$()
  • Method Details

    • executeBatch

      public CompletableFuture<int[]> executeBatch(org.jooq.Queries queries)
      Executes the batch of queries asynchronously. It wraps the Jooq's DSLContext#executeBatch() in a CompletableFuture and sends the entire batch of queries to database server for execution.

      Parameters:
      queries - A Jooq type that represents a set of queries to execute in batch
      Returns:
      A completable future that completes with an array of integers. The integer, if it is greater than or equal to zero, indicates that the command was processed successfully and is an update count giving the number of rows in the database that were affected by the command's execution.
    • fetchAsync

      public <R> CompletableFuture<List<R>> fetchAsync(org.jooq.ResultQuery<org.jooq.Record> query, Class<R> klass)
      Fetches the result in a CompletableFuture. It is a wrapper on Jooq's ResultQuery#fetchAsync().

      Parameters:
      query - the select query to fetch the data from database
      klass - the class of type 'R' used to cast the result data
      Returns:
      a CompletableFuture that completes with a list of data 'R'