org.jbpm.services.task.persistence

## Class TaskQueryCriteriaUtil

- java.lang.Object
- - org.jbpm.query.jpa.impl.QueryCriteriaUtil
  - - org.jbpm.services.task.persistence.TaskQueryCriteriaUtil

-     public class TaskQueryCriteriaUtil
      extends org.jbpm.query.jpa.impl.QueryCriteriaUtil

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static Map<Class,Map<String,javax.persistence.metamodel.Attribute>>` | `criteriaAttributes`
    `static org.slf4j.Logger` | `logger`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `` | `TaskQueryCriteriaUtil(JPATaskPersistenceContext persistenceContext)`
    `protected` | `TaskQueryCriteriaUtil(Map<Class,Map<String,javax.persistence.metamodel.Attribute>> criteriaAttributes)` This protected constructor (and the following persistence-related) protected methods are used in the kie-remote-services module

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected <T> List<T>` | `createQueryAndCallApplyMetaCriteriaAndGetResult(org.jbpm.query.jpa.data.QueryWhere queryWhere, javax.persistence.criteria.CriteriaQuery<T> criteriaQuery, javax.persistence.criteria.CriteriaBuilder builder)`
    `List<TaskSummaryImpl>` | `doCriteriaQuery(String userId, org.kie.api.task.UserGroupCallback userGroupCallback, org.jbpm.query.jpa.data.QueryWhere queryWhere)`
    `protected javax.persistence.criteria.CriteriaBuilder` | `getCriteriaBuilder()`
    `protected <T> javax.persistence.criteria.Expression` | `getEntityField(javax.persistence.criteria.CriteriaQuery<T> query, String listId, javax.persistence.metamodel.Attribute attr)`
    `protected javax.persistence.EntityManager` | `getEntityManager()`
    `static <F,T> javax.persistence.criteria.Expression` | `getJoinedEntityField(javax.persistence.criteria.From<?,F> grandparentJoin, javax.persistence.metamodel.Attribute<?,T> parentJoinAttr, javax.persistence.metamodel.SingularAttribute fieldAttr)` This retrieves the correct field (`Expression`) that should be used when building the `Predicate`.
    `protected <T,R> javax.persistence.criteria.Expression` | `getOrderByExpression(javax.persistence.criteria.CriteriaQuery<R> query, Class<T> queryType, String orderByListId)`
    `protected <R,T> javax.persistence.criteria.Predicate` | `implSpecificCreatePredicateFromSingleCriteria(javax.persistence.criteria.CriteriaQuery<R> query, javax.persistence.criteria.CriteriaBuilder builder, Class queryType, org.jbpm.query.jpa.data.QueryCriteria criteria, org.jbpm.query.jpa.data.QueryWhere queryWhere)`
    `protected boolean` | `initializeCriteriaAttributes()`
    `protected void` | `joinTransaction()`
    `static <T> javax.persistence.criteria.Expression` | `taskImplSpecificGetEntityField(javax.persistence.criteria.CriteriaQuery<T> query, javax.persistence.criteria.Root<TaskImpl> taskRoot, javax.persistence.criteria.Join<TaskImpl,TaskDataImpl> taskDataJoin, javax.persistence.criteria.Join<TaskImpl,PeopleAssignmentsImpl> peopleAssignJoin, String listId, javax.persistence.metamodel.Attribute attr)`
    `static <Q,T> javax.persistence.criteria.Predicate` | `taskSpecificCreatePredicateFromSingleCriteria(javax.persistence.criteria.CriteriaQuery<Q> query, javax.persistence.criteria.CriteriaBuilder builder, org.jbpm.query.jpa.data.QueryCriteria criteria)`

    - ### Methods inherited from class org.jbpm.query.jpa.impl.QueryCriteriaUtil

      `addCriteria, addCriteria, applyMetaCriteriaToQuery, basicCreatePredicateFromSingleCriteria, convertListToInterfaceList, convertRegexToJPALikeExpression, defaultGetEntityField, doCriteriaQuery, fillCriteriaQuery, getCriteriaAttributes, getRoot`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### logger

          public static final org.slf4j.Logger logger

    - #### criteriaAttributes

          public static final Map<Class,Map<String,javax.persistence.metamodel.Attribute>> criteriaAttributes

  - ### Constructor Detail

    - #### TaskQueryCriteriaUtil

          public TaskQueryCriteriaUtil(JPATaskPersistenceContext persistenceContext)

    - #### TaskQueryCriteriaUtil

          protected TaskQueryCriteriaUtil(Map<Class,Map<String,javax.persistence.metamodel.Attribute>> criteriaAttributes)

      This protected constructor (and the following persistence-related) protected methods are used in the kie-remote-services module
      Parameters:
        `criteriaAttributes` -

  - ### Method Detail

    - #### initializeCriteriaAttributes

          protected boolean initializeCriteriaAttributes()

      Specified by:
        `initializeCriteriaAttributes` in class `org.jbpm.query.jpa.impl.QueryCriteriaUtil`

    - #### getEntityManager

          protected javax.persistence.EntityManager getEntityManager()

    - #### joinTransaction

          protected void joinTransaction()

    - #### getCriteriaBuilder

          protected javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()

      Specified by:
        `getCriteriaBuilder` in class `org.jbpm.query.jpa.impl.QueryCriteriaUtil`

    - #### doCriteriaQuery

          public List<TaskSummaryImpl> doCriteriaQuery(String userId,
                                              org.kie.api.task.UserGroupCallback userGroupCallback,
                                              org.jbpm.query.jpa.data.QueryWhere queryWhere)

    - #### getEntityField

          protected <T> javax.persistence.criteria.Expression getEntityField(javax.persistence.criteria.CriteriaQuery<T> query,
                                                                 String listId,
                                                                 javax.persistence.metamodel.Attribute attr)

      Overrides:
        `getEntityField` in class `org.jbpm.query.jpa.impl.QueryCriteriaUtil`

    - #### taskImplSpecificGetEntityField

          public static <T> javax.persistence.criteria.Expression taskImplSpecificGetEntityField(javax.persistence.criteria.CriteriaQuery<T> query,
                                                                                 javax.persistence.criteria.Root<TaskImpl> taskRoot,
                                                                                 javax.persistence.criteria.Join<TaskImpl,TaskDataImpl> taskDataJoin,
                                                                                 javax.persistence.criteria.Join<TaskImpl,PeopleAssignmentsImpl> peopleAssignJoin,
                                                                                 String listId,
                                                                                 javax.persistence.metamodel.Attribute attr)

    - #### getJoinedEntityField

          public static <F,T> javax.persistence.criteria.Expression getJoinedEntityField(javax.persistence.criteria.From<?,F> grandparentJoin,
                                                                         javax.persistence.metamodel.Attribute<?,T> parentJoinAttr,
                                                                         javax.persistence.metamodel.SingularAttribute fieldAttr)

      This retrieves the correct field (`Expression`) that should be used when building the `Predicate`. This field is necessary because of the amount of joins and the complexity in the human-task schema.
      Parameters:
        `grandparentJoin` - This is the parent join, for example the join between TaskDataImpl -> PeopleAssignments
        `parentJoinAttr` - This is the `Attribute` with the information over the join (from the parent) that we need to create, for example the `SingularAttribute`<`PeopleAssignmentsImpl`, `OrganizationalEntityImpl`> `Attribute`.
        `fieldAttr` - This is the `Attribute` with the actual attribute that we create an `Expression` to build a `Predicate` for, for example the `OrganizationalEntityImpl_.id` field.
      Returns:
        an `Expression` that can be used in a predicate with the values/parameters from a `QueryCriteria` instance

    - #### implSpecificCreatePredicateFromSingleCriteria

          protected <R,T> javax.persistence.criteria.Predicate implSpecificCreatePredicateFromSingleCriteria(javax.persistence.criteria.CriteriaQuery<R> query,
                                                                                                 javax.persistence.criteria.CriteriaBuilder builder,
                                                                                                 Class queryType,
                                                                                                 org.jbpm.query.jpa.data.QueryCriteria criteria,
                                                                                                 org.jbpm.query.jpa.data.QueryWhere queryWhere)

      Specified by:
        `implSpecificCreatePredicateFromSingleCriteria` in class `org.jbpm.query.jpa.impl.QueryCriteriaUtil`

    - #### taskSpecificCreatePredicateFromSingleCriteria

          public static <Q,T> javax.persistence.criteria.Predicate taskSpecificCreatePredicateFromSingleCriteria(javax.persistence.criteria.CriteriaQuery<Q> query,
                                                                                                 javax.persistence.criteria.CriteriaBuilder builder,
                                                                                                 org.jbpm.query.jpa.data.QueryCriteria criteria)

    - #### createQueryAndCallApplyMetaCriteriaAndGetResult

          protected <T> List<T> createQueryAndCallApplyMetaCriteriaAndGetResult(org.jbpm.query.jpa.data.QueryWhere queryWhere,
                                                                    javax.persistence.criteria.CriteriaQuery<T> criteriaQuery,
                                                                    javax.persistence.criteria.CriteriaBuilder builder)

      Specified by:
        `createQueryAndCallApplyMetaCriteriaAndGetResult` in class `org.jbpm.query.jpa.impl.QueryCriteriaUtil`

    - #### getOrderByExpression

          protected <T,R> javax.persistence.criteria.Expression getOrderByExpression(javax.persistence.criteria.CriteriaQuery<R> query,
                                                                         Class<T> queryType,
                                                                         String orderByListId)

      Overrides:
        `getOrderByExpression` in class `org.jbpm.query.jpa.impl.QueryCriteriaUtil`

Copyright © 2001–2015 JBoss by Red Hat. All rights reserved.