org.jbpm.services.task.audit.service

## Class TaskAuditQueryModificationService

- java.lang.Object
- - org.jbpm.services.task.audit.service.TaskAuditQueryModificationService

- All Implemented Interfaces:
    org.jbpm.query.jpa.service.QueryModificationService

      public class TaskAuditQueryModificationService
      extends Object
      implements org.jbpm.query.jpa.service.QueryModificationService

  A `QueryModificationService` instace for the jbpm-human-task-audit module

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TaskAuditQueryModificationService()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `accepts(String listId)`
    `<R> javax.persistence.criteria.Predicate` | `createPredicate(org.jbpm.query.jpa.data.QueryCriteria criteria, javax.persistence.criteria.CriteriaQuery<R> query, javax.persistence.criteria.CriteriaBuilder builder)`
    `void` | `optimizeCriteria(List<org.jbpm.query.jpa.data.QueryCriteria> criteriaList)` This method combines multiple intersecting `TaskVariableImpl` criteria in order to make sure that the number of (`TaskVariableImpl`) subqueries created is minimal.
    `void` | `optimizeCriteria(org.jbpm.query.jpa.data.QueryWhere queryWhere)`

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

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

- - ### Constructor Detail

    - #### TaskAuditQueryModificationService

          public TaskAuditQueryModificationService()

  - ### Method Detail

    - #### accepts

          public boolean accepts(String listId)

      Specified by:
        `accepts` in interface `org.jbpm.query.jpa.service.QueryModificationService`

    - #### optimizeCriteria

          public void optimizeCriteria(org.jbpm.query.jpa.data.QueryWhere queryWhere)

      Specified by:
        `optimizeCriteria` in interface `org.jbpm.query.jpa.service.QueryModificationService`

    - #### optimizeCriteria

          public void optimizeCriteria(List<org.jbpm.query.jpa.data.QueryCriteria> criteriaList)

      This method combines multiple intersecting `TaskVariableImpl` criteria in order to make sure that the number of (`TaskVariableImpl`) subqueries created is minimal. The following logic is applied: Go through the given list of `QueryCriteria` and if an intersecting group or criteria contains multiple `TaskVariableImpl` criteria, then replace those task variable criteria with a single "combined" task variable criteria. This is then later processed correctly so as to create only one subquery. Obviously, if we run into a group criteria, recurse. Continue to go through the criteria list until we've reached the end of the list: the loop might have broken off earlier because it hit a union criteria and stopped to process group of intersecting task variable criteria that had already been found. With the successive loops, all intersecting groups containing task variable criteria will have been removed, allowing the last loop to reach the end of the list.
      Parameters:
        `criteriaList` - The list of `QueryCriteria` to process

    - #### createPredicate

          public <R> javax.persistence.criteria.Predicate createPredicate(org.jbpm.query.jpa.data.QueryCriteria criteria,
                                                                          javax.persistence.criteria.CriteriaQuery<R> query,
                                                                          javax.persistence.criteria.CriteriaBuilder builder)

      Specified by:
        `createPredicate` in interface `org.jbpm.query.jpa.service.QueryModificationService`

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