Interface JpaQuery<T>
-
- Type Parameters:
T- Query result type
- All Superinterfaces:
com.holonplatform.core.datastore.DataTarget.DataTargetSupport<JpaQuery<T>>,com.querydsl.core.types.Expression<T>,com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JpaQuery<T>>,com.querydsl.core.support.ExtendedSubQuery<T>,com.querydsl.core.Fetchable<T>,com.querydsl.core.FetchableQuery<T,com.querydsl.jpa.JPQLQuery<T>>,com.querydsl.core.FilteredClause<com.querydsl.jpa.JPQLQuery<T>>,com.querydsl.jpa.JPQLQuery<T>,com.querydsl.core.Query<com.querydsl.jpa.JPQLQuery<T>>,com.holonplatform.core.query.QueryAggregation.QueryAggregationSupport<JpaQuery<T>>,com.holonplatform.core.query.QueryBuilder<JpaQuery<T>>,com.holonplatform.core.query.QueryFilter.QueryFilterSupport<JpaQuery<T>>,com.holonplatform.core.query.QuerySort.QuerySortSupport<JpaQuery<T>>,Serializable,com.querydsl.core.SimpleQuery<com.querydsl.jpa.JPQLQuery<T>>,com.querydsl.core.types.SubQueryExpression<T>
- All Known Implementing Classes:
DefaultJpaQuery
public interface JpaQuery<T> extends com.holonplatform.core.query.QueryBuilder<JpaQuery<T>>, com.querydsl.jpa.JPQLQuery<T>
QueryDSL JPA query interface.Combines the features of the standard QueryDSL
JPQLQuerywith the HolonQueryBuilder, allowing to seamlessy use the default core query architecture expressions (for exampleDataTarget,QueryFilter,QuerySortandQueryAggregation) for query definition.Provides some convenience methods to obtain query results providing a projection expression, such as
list(Expression),singleResult(Expression),uniqueResult(Expression).The
QueryDslDatastore commodity can be used to obtain a newJpaQueryinstance through theQueryDsl.query()method. Example:JpaQuery q = getDatastore().create(QueryDsl.class).query();
- Since:
- 5.1.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default longcount()Shorter for count(*) on selected entity path.JpaQuery<T>distinct()JpaQuery<T>fetchAll()JpaQuery<T>fetchJoin()<P> JpaQuery<T>from(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)JpaQuery<T>from(com.querydsl.core.types.EntityPath<?>... sources)JpaQuery<T>groupBy(com.querydsl.core.types.Expression<?>... o)JpaQuery<T>having(com.querydsl.core.types.Predicate... o)<P> JpaQuery<T>innerJoin(com.querydsl.core.types.CollectionExpression<?,P> target)<P> JpaQuery<T>innerJoin(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>innerJoin(com.querydsl.core.types.EntityPath<P> target)<P> JpaQuery<T>innerJoin(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>innerJoin(com.querydsl.core.types.MapExpression<?,P> target)<P> JpaQuery<T>innerJoin(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>join(com.querydsl.core.types.CollectionExpression<?,P> target)<P> JpaQuery<T>join(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>join(com.querydsl.core.types.EntityPath<P> target)<P> JpaQuery<T>join(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>join(com.querydsl.core.types.MapExpression<?,P> target)<P> JpaQuery<T>join(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>leftJoin(com.querydsl.core.types.CollectionExpression<?,P> target)<P> JpaQuery<T>leftJoin(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>leftJoin(com.querydsl.core.types.EntityPath<P> target)<P> JpaQuery<T>leftJoin(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>leftJoin(com.querydsl.core.types.MapExpression<?,P> target)<P> JpaQuery<T>leftJoin(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)JpaQuery<T>limit(long limit)default <RT> List<RT>list(com.querydsl.core.types.Expression<RT> projection)Convenience method to execute the query and return results asList.JpaQuery<T>offset(long offset)JpaQuery<T>on(com.querydsl.core.types.Predicate... condition)JpaQuery<T>orderBy(com.querydsl.core.types.OrderSpecifier<?>... o)JpaQuery<T>restrict(com.querydsl.core.QueryModifiers modifiers)<P> JpaQuery<T>rightJoin(com.querydsl.core.types.CollectionExpression<?,P> target)<P> JpaQuery<T>rightJoin(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>rightJoin(com.querydsl.core.types.EntityPath<P> target)<P> JpaQuery<T>rightJoin(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)<P> JpaQuery<T>rightJoin(com.querydsl.core.types.MapExpression<?,P> target)<P> JpaQuery<T>rightJoin(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)JpaQuery<com.querydsl.core.Tuple>select(com.querydsl.core.types.Expression<?>... exprs)<U> JpaQuery<U>select(com.querydsl.core.types.Expression<U> expr)<P> JpaQuery<T>set(com.querydsl.core.types.ParamExpression<P> param, P value)JpaQuery<T>setFlushMode(javax.persistence.FlushModeType flushMode)Set the queryFlushModeType.JpaQuery<T>setHint(String name, Object value)Add a query hint.JpaQuery<T>setLockMode(javax.persistence.LockModeType lockMode)Set the queryLockModeType.default <RT> RTsingleResult(com.querydsl.core.types.Expression<RT> projection)Convenience method to execute the query and return a single result.default <RT> RTuniqueResult(com.querydsl.core.types.Expression<RT> projection)Convenience method to execute the query and return the result, which is expected to be unique.JpaQuery<T>where(com.querydsl.core.types.Predicate... o)-
Methods inherited from interface com.holonplatform.core.datastore.DataTarget.DataTargetSupport
target, target
-
Methods inherited from interface com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder
withExpressionResolver
-
Methods inherited from interface com.querydsl.core.support.ExtendedSubQuery
contains, contains, eq, eq, exists, goe, goe, gt, gt, in, in, isNotNull, isNull, loe, loe, lt, lt, ne, ne, notExists
-
Methods inherited from interface com.querydsl.core.Fetchable
fetch, fetchCount, fetchFirst, fetchOne, fetchResults, iterate, stream
-
Methods inherited from interface com.holonplatform.core.query.QueryAggregation.QueryAggregationSupport
aggregate, aggregate, aggregate
-
Methods inherited from interface com.holonplatform.core.query.QueryBuilder
getQueryConfiguration, limit, offset, parameter, parameter, restrict
-
Methods inherited from interface com.holonplatform.core.query.QueryFilter.QueryFilterSupport
filter, filter, filter
-
-
-
-
Method Detail
-
groupBy
JpaQuery<T> groupBy(com.querydsl.core.types.Expression<?>... o)
- Specified by:
groupByin interfacecom.querydsl.core.Query<T>
-
having
JpaQuery<T> having(com.querydsl.core.types.Predicate... o)
- Specified by:
havingin interfacecom.querydsl.core.Query<T>
-
limit
JpaQuery<T> limit(long limit)
- Specified by:
limitin interfacecom.querydsl.core.SimpleQuery<T>
-
offset
JpaQuery<T> offset(long offset)
- Specified by:
offsetin interfacecom.querydsl.core.SimpleQuery<T>
-
restrict
JpaQuery<T> restrict(com.querydsl.core.QueryModifiers modifiers)
- Specified by:
restrictin interfacecom.querydsl.core.SimpleQuery<T>
-
orderBy
JpaQuery<T> orderBy(com.querydsl.core.types.OrderSpecifier<?>... o)
- Specified by:
orderByin interfacecom.querydsl.core.SimpleQuery<T>
-
set
<P> JpaQuery<T> set(com.querydsl.core.types.ParamExpression<P> param, P value)
- Specified by:
setin interfacecom.querydsl.core.SimpleQuery<T>
-
where
JpaQuery<T> where(com.querydsl.core.types.Predicate... o)
- Specified by:
wherein interfacecom.querydsl.core.FilteredClause<T>
-
from
JpaQuery<T> from(com.querydsl.core.types.EntityPath<?>... sources)
- Specified by:
fromin interfacecom.querydsl.jpa.JPQLQuery<T>
-
from
<P> JpaQuery<T> from(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
fromin interfacecom.querydsl.jpa.JPQLQuery<T>
-
innerJoin
<P> JpaQuery<T> innerJoin(com.querydsl.core.types.EntityPath<P> target)
- Specified by:
innerJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
innerJoin
<P> JpaQuery<T> innerJoin(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
innerJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
innerJoin
<P> JpaQuery<T> innerJoin(com.querydsl.core.types.CollectionExpression<?,P> target)
- Specified by:
innerJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
innerJoin
<P> JpaQuery<T> innerJoin(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
innerJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
innerJoin
<P> JpaQuery<T> innerJoin(com.querydsl.core.types.MapExpression<?,P> target)
- Specified by:
innerJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
innerJoin
<P> JpaQuery<T> innerJoin(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
innerJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
join
<P> JpaQuery<T> join(com.querydsl.core.types.EntityPath<P> target)
- Specified by:
joinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
join
<P> JpaQuery<T> join(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
joinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
join
<P> JpaQuery<T> join(com.querydsl.core.types.CollectionExpression<?,P> target)
- Specified by:
joinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
join
<P> JpaQuery<T> join(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
joinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
join
<P> JpaQuery<T> join(com.querydsl.core.types.MapExpression<?,P> target)
- Specified by:
joinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
join
<P> JpaQuery<T> join(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
joinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
leftJoin
<P> JpaQuery<T> leftJoin(com.querydsl.core.types.EntityPath<P> target)
- Specified by:
leftJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
leftJoin
<P> JpaQuery<T> leftJoin(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
leftJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
leftJoin
<P> JpaQuery<T> leftJoin(com.querydsl.core.types.CollectionExpression<?,P> target)
- Specified by:
leftJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
leftJoin
<P> JpaQuery<T> leftJoin(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
leftJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
leftJoin
<P> JpaQuery<T> leftJoin(com.querydsl.core.types.MapExpression<?,P> target)
- Specified by:
leftJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
leftJoin
<P> JpaQuery<T> leftJoin(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
leftJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
rightJoin
<P> JpaQuery<T> rightJoin(com.querydsl.core.types.EntityPath<P> target)
- Specified by:
rightJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
rightJoin
<P> JpaQuery<T> rightJoin(com.querydsl.core.types.EntityPath<P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
rightJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
rightJoin
<P> JpaQuery<T> rightJoin(com.querydsl.core.types.CollectionExpression<?,P> target)
- Specified by:
rightJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
rightJoin
<P> JpaQuery<T> rightJoin(com.querydsl.core.types.CollectionExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
rightJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
rightJoin
<P> JpaQuery<T> rightJoin(com.querydsl.core.types.MapExpression<?,P> target)
- Specified by:
rightJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
rightJoin
<P> JpaQuery<T> rightJoin(com.querydsl.core.types.MapExpression<?,P> target, com.querydsl.core.types.Path<P> alias)
- Specified by:
rightJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
on
JpaQuery<T> on(com.querydsl.core.types.Predicate... condition)
- Specified by:
onin interfacecom.querydsl.jpa.JPQLQuery<T>
-
fetchJoin
JpaQuery<T> fetchJoin()
- Specified by:
fetchJoinin interfacecom.querydsl.jpa.JPQLQuery<T>
-
select
<U> JpaQuery<U> select(com.querydsl.core.types.Expression<U> expr)
-
select
JpaQuery<com.querydsl.core.Tuple> select(com.querydsl.core.types.Expression<?>... exprs)
-
setLockMode
JpaQuery<T> setLockMode(javax.persistence.LockModeType lockMode)
Set the queryLockModeType.- Parameters:
lockMode- Lock mode- Returns:
- this
-
setFlushMode
JpaQuery<T> setFlushMode(javax.persistence.FlushModeType flushMode)
Set the queryFlushModeType.- Parameters:
flushMode- Flush mode- Returns:
- this
-
setHint
JpaQuery<T> setHint(String name, Object value)
Add a query hint.- Parameters:
name- Query hint namevalue- Query hint value- Returns:
- this
-
list
default <RT> List<RT> list(com.querydsl.core.types.Expression<RT> projection)
Convenience method to execute the query and return results asList. An empty list is returned when no result is found.- Type Parameters:
RT- Result type- Parameters:
projection- Projection- Returns:
- Query results
List
-
singleResult
default <RT> RT singleResult(com.querydsl.core.types.Expression<RT> projection)
Convenience method to execute the query and return a single result. For multiple results, only the first one is returned.- Type Parameters:
RT- Result type- Parameters:
projection- Projection- Returns:
- The single (first) query result,
nullif no results available
-
uniqueResult
default <RT> RT uniqueResult(com.querydsl.core.types.Expression<RT> projection)
Convenience method to execute the query and return the result, which is expected to be unique.- Type Parameters:
RT- Result type- Parameters:
projection- Projection- Returns:
- The unique query result,
nullif no results available - Throws:
com.querydsl.core.NonUniqueResultException- if there is more than one result
-
count
default long count()
Shorter for count(*) on selected entity path.- Returns:
- Count result
-
-