com.holonplatform.datastore.jpa.querydsl

## Class JpaQuery<T>

- java.lang.Object
- - com.querydsl.core.support.QueryBase<Q>
  - - com.querydsl.core.support.FetchableQueryBase<T,Q>
    - - com.querydsl.core.support.FetchableSubQueryBase<T,Q>
      - - com.querydsl.jpa.JPAQueryBase<T,Q>
        - - com.querydsl.jpa.impl.AbstractJPAQuery<T,JpaQuery<T>>
          - - com.holonplatform.datastore.jpa.querydsl.JpaQuery<T>

- Type Parameters:
    `T` - Query result type
  All Implemented Interfaces:
    com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JpaQuery<T>>, com.holonplatform.core.query.QueryAggregation.QueryAggregationSupport<JpaQuery<T>>, com.holonplatform.core.query.QueryFilter.QueryFilterSupport<JpaQuery<T>>, com.holonplatform.core.query.QuerySort.QuerySortSupport<JpaQuery<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.core.Query<com.querydsl.jpa.JPQLQuery<T>>, com.querydsl.core.SimpleQuery<com.querydsl.jpa.JPQLQuery<T>>, com.querydsl.core.support.ExtendedSubQuery<T>, com.querydsl.core.types.Expression<T>, com.querydsl.core.types.SubQueryExpression<T>, com.querydsl.jpa.JPQLQuery<T>, Serializable

      public class JpaQuery<T>
      extends com.querydsl.jpa.impl.AbstractJPAQuery<T,JpaQuery<T>>
      implements com.holonplatform.core.query.QueryFilter.QueryFilterSupport<JpaQuery<T>>, com.holonplatform.core.query.QuerySort.QuerySortSupport<JpaQuery<T>>, com.holonplatform.core.query.QueryAggregation.QueryAggregationSupport<JpaQuery<T>>, com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JpaQuery<T>>

  A QueryDSL (www.querydsl.com) `JPQLQuery` extension that supports `Query` clauses and `ExpressionResolver`s.

  Furthermore, some QueryDSL 3.x backward compatibility methods are provided, such as `list(Expression)` and `uniqueResult(Expression)`.

  Since:
    5.0.0
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from class com.querydsl.core.support.QueryBase

      `MDC_PARAMETERS, MDC_QUERY`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `JpaQuery(com.holonplatform.core.ExpressionResolver.ExpressionResolverSupport expressionResolversProvider, javax.persistence.EntityManager entityManager)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `JpaQuery<T>` | `aggregate(com.holonplatform.core.query.QueryAggregation aggregation)`
    `JpaQuery<T>` | `clone(javax.persistence.EntityManager entityManager)`
    `JpaQuery<T>` | `clone(javax.persistence.EntityManager entityManager, com.querydsl.jpa.JPQLTemplates templates)`
    `long` | `count()` Shorter for count(*) on selected entity path
    `JpaQuery<T>` | `filter(com.holonplatform.core.query.QueryFilter filter)`
    `<RT> List<RT>` | `list(com.querydsl.core.types.Expression<RT> projection)` Convenience method for QueryDSL 3.x backward compatibility: execute query and returns results list.
    `JpaQuery<com.querydsl.core.Tuple>` | `select(com.querydsl.core.types.Expression<?>... exprs)` Change the projection of this query
    `<U> JpaQuery<U>` | `select(com.querydsl.core.types.Expression<U> expr)` Change the projection of this query
    `<RT> RT` | `singleResult(com.querydsl.core.types.Expression<RT> projection)` Convenience method for QueryDSL 3.x backward compatibility: return a single result for the given projection or `null` if no result is found.
    `JpaQuery<T>` | `sort(com.holonplatform.core.query.QuerySort sort)`
    `<RT> RT` | `uniqueResult(com.querydsl.core.types.Expression<RT> projection)` Convenience method for QueryDSL 3.x backward compatibility: return a unique result for the given projection or `null` if no result is found.
    `<E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> JpaQuery<T>` | `withExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver)`

    - ### Methods inherited from class com.querydsl.jpa.impl.AbstractJPAQuery

      `clone, createQuery, fetch, fetchCount, fetchOne, fetchResults, iterate, setFlushMode, setHint, setLockMode`

    - ### Methods inherited from class com.querydsl.jpa.JPAQueryBase

      `fetchAll, fetchJoin, from, from, from, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, innerJoin, join, join, join, join, join, join, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, leftJoin, on, on, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, rightJoin, toString`

    - ### Methods inherited from class com.querydsl.core.support.FetchableSubQueryBase

      `accept, contains, contains, eq, eq, exists, getMetadata, getType, goe, goe, gt, gt, hashCode, in, in, isNotNull, isNull, loe, loe, lt, lt, ne, ne, notExists`

    - ### Methods inherited from class com.querydsl.core.support.FetchableQueryBase

      `equals, fetchFirst, transform`

    - ### Methods inherited from class com.querydsl.core.support.QueryBase

      `groupBy, having, orderBy, where`

    - ### Methods inherited from class java.lang.Object

      `getClass, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.core.query.QueryAggregation.QueryAggregationSupport

      `aggregate, aggregate`

    - ### Methods inherited from interface com.querydsl.core.FetchableQuery

      `transform`

    - ### Methods inherited from interface com.querydsl.core.Fetchable

      `fetchFirst`

    - ### 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.types.SubQueryExpression

      `getMetadata`

    - ### Methods inherited from interface com.querydsl.core.types.Expression

      `accept, getType`

- - ### Constructor Detail

    - #### JpaQuery

          public JpaQuery(com.holonplatform.core.ExpressionResolver.ExpressionResolverSupport expressionResolversProvider,
                          javax.persistence.EntityManager entityManager)

      Constructor
      Parameters:
        `expressionResolversProvider` - Optional `ExpressionResolver.ExpressionResolverSupport` to inherit expression resolvers from
        `entityManager` - EntityManager

  - ### Method Detail

    - #### clone

          public JpaQuery<T> clone(javax.persistence.EntityManager entityManager,
                                   com.querydsl.jpa.JPQLTemplates templates)

      Specified by:
        `clone` in class `com.querydsl.jpa.impl.AbstractJPAQuery<T,JpaQuery<T>>`

    - #### clone

          public JpaQuery<T> clone(javax.persistence.EntityManager entityManager)

      Specified by:
        `clone` in class `com.querydsl.jpa.impl.AbstractJPAQuery<T,JpaQuery<T>>`

    - #### select

          public <U> JpaQuery<U> select(com.querydsl.core.types.Expression<U> expr)

      Change the projection of this query
      Specified by:
        `select` in interface `com.querydsl.core.FetchableQuery<T,com.querydsl.jpa.JPQLQuery<T>>`
      Specified by:
        `select` in interface `com.querydsl.jpa.JPQLQuery<T>`
      Type Parameters:
        `U` - Results type
      Parameters:
        `expr` - new projection
      Returns:
        the current object

    - #### select

          public JpaQuery<com.querydsl.core.Tuple> select(com.querydsl.core.types.Expression<?>... exprs)

      Change the projection of this query
      Specified by:
        `select` in interface `com.querydsl.core.FetchableQuery<T,com.querydsl.jpa.JPQLQuery<T>>`
      Specified by:
        `select` in interface `com.querydsl.jpa.JPQLQuery<T>`
      Parameters:
        `exprs` - new projection
      Returns:
        the current object

    - #### count

          public long count()

      Shorter for count(*) on selected entity path
      Returns:
        Count result

    - #### withExpressionResolver

          public <E extends com.holonplatform.core.Expression,R extends com.holonplatform.core.Expression> JpaQuery<T> withExpressionResolver(com.holonplatform.core.ExpressionResolver<E,R> expressionResolver)

      Specified by:
        `withExpressionResolver` in interface `com.holonplatform.core.ExpressionResolver.ExpressionResolverBuilder<JpaQuery<T>>`

    - #### sort

          public JpaQuery<T> sort(com.holonplatform.core.query.QuerySort sort)

      Specified by:
        `sort` in interface `com.holonplatform.core.query.QuerySort.QuerySortSupport<JpaQuery<T>>`

    - #### filter

          public JpaQuery<T> filter(com.holonplatform.core.query.QueryFilter filter)

      Specified by:
        `filter` in interface `com.holonplatform.core.query.QueryFilter.QueryFilterSupport<JpaQuery<T>>`

    - #### aggregate

          public JpaQuery<T> aggregate(com.holonplatform.core.query.QueryAggregation aggregation)

      Specified by:
        `aggregate` in interface `com.holonplatform.core.query.QueryAggregation.QueryAggregationSupport<JpaQuery<T>>`

    - #### list

          public <RT> List<RT> list(com.querydsl.core.types.Expression<RT> projection)

      Convenience method for QueryDSL 3.x backward compatibility: execute query and returns results list. An empty list is returned when no result is found.
      Type Parameters:
        `RT` - Result type
      Parameters:
        `projection` - Projection
      Returns:
        a List over the projection

    - #### singleResult

          public <RT> RT singleResult(com.querydsl.core.types.Expression<RT> projection)

      Convenience method for QueryDSL 3.x backward compatibility: return a single result for the given projection or `null` if no result is found. For multiple results only the first one is returned.
      Type Parameters:
        `RT` - Result type
      Parameters:
        `projection` - Projection
      Returns:
        Single (first) result

    - #### uniqueResult

          public <RT> RT uniqueResult(com.querydsl.core.types.Expression<RT> projection)

      Convenience method for QueryDSL 3.x backward compatibility: return a unique result for the given projection or `null` if no result is found.
      Type Parameters:
        `RT` - Result type
      Parameters:
        `projection` - Projection
      Returns:
        Unique result
      Throws:
        `com.querydsl.core.NonUniqueResultException` - if there is more than one matching result

Copyright © 2017 The Holon Platform. All rights reserved.