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
-
-
Field Summary
-
Fields inherited from class com.github.collinalpert.java2db.queries.SingleEntityQuery
aliases, mapper, tableModule, type
-
-
Constructor Summary
Constructors Constructor Description AsyncSingleEntityQuery(java.lang.Class<E> type)
-
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> AsyncSingleQueryable<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
buildWhereClause, first, getQuery, getTableName
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.github.collinalpert.java2db.queries.async.AsyncSingleQueryable
firstAsync, firstAsync
-
Methods inherited from interface com.github.collinalpert.java2db.queries.SingleQueryable
first, getQuery
-
-
-
-
Constructor Detail
-
AsyncSingleEntityQuery
public AsyncSingleEntityQuery(java.lang.Class<E> type)
-
-
Method Detail
-
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> 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:
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.
-
-