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:
AsyncQueryable<E>,Queryable<E>
public class AsyncSingleEntityQuery<E extends BaseEntity> extends SingleEntityQuery<E> implements AsyncQueryable<E>
- Author:
- Collin Alpert
-
Field Summary
Fields inherited from class com.github.collinalpert.java2db.queries.SingleEntityQuery
connectionConfiguration, queryBuilder, queryParameters -
Constructor Summary
Constructors Constructor Description AsyncSingleEntityQuery(Class<E> type, ConnectionConfiguration connectionConfiguration) -
Method Summary
Modifier and Type Method Description AsyncSingleEntityQuery<E>orWhere(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)Sets or appends an OR WHERE clause to the DQL statement.<R> AsyncQueryable<R>project(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> projection)Selects only a single column from a table.AsyncSingleEntityQuery<E>where(com.github.collinalpert.lambda2sql.functions.SqlPredicate<E> predicate)Sets or appends a WHERE clause for the DQL statement.Methods inherited from class com.github.collinalpert.java2db.queries.SingleEntityQuery
first, getQuery, getTableName, toArray, toList, toMap, toSet, toStreamMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.github.collinalpert.java2db.queries.async.AsyncQueryable
firstAsync, firstAsync, toArrayAsync, toArrayAsync, toListAsync, toListAsync, toMapAsync, toMapAsync, toMapAsync, toMapAsync, toSetAsync, toSetAsync, toStreamAsync, toStreamAsync
-
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:
wherein classSingleEntityQuery<E extends BaseEntity>- Parameters:
predicate- The predicate describing the WHERE clause.- Returns:
- This
EntityQueryobject, 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:
orWherein classSingleEntityQuery<E extends BaseEntity>- Parameters:
predicate- The predicate describing the OR WHERE clause.- Returns:
- This
EntityQueryobject, now with an (appended) OR WHERE clause.
-
project
public <R> AsyncQueryable<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:
projectin classSingleEntityQuery<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.
-