Class EntityProjectionQuery<E extends BaseEntity,R>
- java.lang.Object
-
- com.github.collinalpert.java2db.queries.SingleEntityProjectionQuery<E,R>
-
- com.github.collinalpert.java2db.queries.EntityProjectionQuery<E,R>
-
- Type Parameters:
E- The entity which the query is supposed to be executed for.R- The return type of the projection this query represents.
- All Implemented Interfaces:
Queryable<R>,SingleQueryable<R>
- Direct Known Subclasses:
AsyncEntityProjectionQuery
public class EntityProjectionQuery<E extends BaseEntity,R> extends SingleEntityProjectionQuery<E,R> implements Queryable<R>
A query which represents a projection from anEntityQueryto a single column on the database.- Author:
- Collin Alpert
-
-
Field Summary
-
Fields inherited from class com.github.collinalpert.java2db.queries.SingleEntityProjectionQuery
returnType
-
-
Constructor Summary
Constructors Constructor Description EntityProjectionQuery(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> projection, EntityQuery<E> originalQuery)
-
Method Summary
-
Methods inherited from class com.github.collinalpert.java2db.queries.SingleEntityProjectionQuery
first, getQuery
-
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.SingleQueryable
first, getQuery
-
-
-
-
Constructor Detail
-
EntityProjectionQuery
public EntityProjectionQuery(com.github.collinalpert.lambda2sql.functions.SqlFunction<E,R> projection, EntityQuery<E> originalQuery)
-
-
Method Detail
-
toList
public java.util.List<R> toList()
Description copied from interface:QueryableExecutes the query and returns the result as aList- Specified by:
toListin interfaceQueryable<E extends BaseEntity>- Returns:
- A list of entities representing the result rows.
-
toStream
public java.util.stream.Stream<R> toStream()
Description copied from interface:QueryableExecutes the query and returns the result as aStream- Specified by:
toStreamin interfaceQueryable<E extends BaseEntity>- Returns:
- A list of entities representing the result rows.
-
-