Class AsyncSingleEntityQuery<E extends BaseEntity>

java.lang.Object
com.github.collinalpert.java2db.queries.SingleEntityQuery<E>
com.github.collinalpert.java2db.queries.async.AsyncSingleEntityQuery<E>
All Implemented Interfaces:
AsyncSingleQueryable<E>, SingleQueryable<E>

public class AsyncSingleEntityQuery<E extends BaseEntity>
extends SingleEntityQuery<E>
implements AsyncSingleQueryable<E>
Author:
Collin Alpert
  • Constructor Details

  • Method Details

    • where

      public AsyncSingleEntityQuery<E> where​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
      Sets or appends a WHERE clause for the DQL statement.
      Overrides:
      where in class SingleEntityQuery<E extends BaseEntity>
      Parameters:
      predicate - The predicate describing the WHERE clause.
      Returns:
      This EntityQuery object, now with an (appended) WHERE clause.
    • orWhere

      public AsyncSingleEntityQuery<E> orWhere​(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)
      Sets or appends an OR WHERE clause to the DQL statement.
      Overrides:
      orWhere in class SingleEntityQuery<E extends BaseEntity>
      Parameters:
      predicate - The predicate describing the OR WHERE clause.
      Returns:
      This EntityQuery object, now with an (appended) OR WHERE clause.
    • project

      public <R> AsyncSingleQueryable<R> project​(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,​R> projection)
      Selects only a single column from a table. This is meant if you don't want to fetch an entire entity from the database.
      Overrides:
      project in class SingleEntityQuery<E extends BaseEntity>
      Type Parameters:
      R - The type of the column you want to retrieve.
      Parameters:
      projection - The column to project to.
      Returns:
      A queryable containing the projection.