Class TaskSummaryQueryCriteriaUtil
- java.lang.Object
-
- org.jbpm.query.jpa.impl.QueryCriteriaUtil
-
- org.jbpm.services.task.persistence.AbstractTaskQueryCriteriaUtil
-
- org.jbpm.services.task.persistence.TaskSummaryQueryCriteriaUtil
-
public class TaskSummaryQueryCriteriaUtil extends AbstractTaskQueryCriteriaUtil
-
-
Field Summary
Fields Modifier and Type Field Description static Map<Class,Map<String,javax.persistence.metamodel.Attribute>>
criteriaAttributes
static org.slf4j.Logger
logger
-
Fields inherited from class org.jbpm.services.task.persistence.AbstractTaskQueryCriteriaUtil
persistenceContext
-
-
Constructor Summary
Constructors Constructor Description TaskSummaryQueryCriteriaUtil()
TaskSummaryQueryCriteriaUtil(org.kie.internal.task.api.TaskPersistenceContext persistenceContext)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<org.kie.api.task.model.TaskSummary>
doCriteriaQuery(String userId, org.kie.api.task.UserGroupCallback userGroupCallback, org.jbpm.query.jpa.data.QueryWhere queryWhere)
protected <T> javax.persistence.criteria.Expression
getEntityField(javax.persistence.criteria.CriteriaQuery<T> query, String listId, javax.persistence.metamodel.Attribute attr)
static <F,T>
javax.persistence.criteria.ExpressiongetJoinedEntityField(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 thePredicate
.protected <T,R>
javax.persistence.criteria.ExpressiongetOrderByExpression(javax.persistence.criteria.CriteriaQuery<R> query, Class<T> queryType, String orderByListId)
protected <R,T>
javax.persistence.criteria.PredicateimplSpecificCreatePredicateFromSingleCriteria(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()
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.PredicatetaskSpecificCreatePredicateFromSingleCriteria(javax.persistence.criteria.CriteriaQuery<Q> query, javax.persistence.criteria.CriteriaBuilder builder, org.jbpm.query.jpa.data.QueryCriteria criteria, org.jbpm.query.jpa.data.QueryWhere queryWhere)
-
Methods inherited from class org.jbpm.services.task.persistence.AbstractTaskQueryCriteriaUtil
closeEntityManager, createQueryAndCallApplyMetaCriteriaAndGetResult, getCriteriaBuilder, getEntityManager, joinTransaction
-
Methods inherited from class org.jbpm.query.jpa.impl.QueryCriteriaUtil
addCriteria, addCriteria, applyMetaCriteriaToQuery, basicCreatePredicateFromSingleCriteria, convertListToInterfaceList, convertRegexToJPALikeExpression, defaultGetEntityField, doCriteriaQuery, fillCriteriaQuery, getCriteriaAttributes, getRoot, initialize
-
-
-
-
Method Detail
-
initializeCriteriaAttributes
protected boolean initializeCriteriaAttributes()
- Overrides:
initializeCriteriaAttributes
in classAbstractTaskQueryCriteriaUtil
-
doCriteriaQuery
public List<org.kie.api.task.model.TaskSummary> 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 classorg.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 thePredicate
. 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 -> PeopleAssignmentsparentJoinAttr
- This is theAttribute
with the information over the join (from the parent) that we need to create, for example theSingularAttribute
<PeopleAssignmentsImpl
,OrganizationalEntityImpl
>Attribute
.fieldAttr
- This is theAttribute
with the actual attribute that we create anExpression
to build aPredicate
for, for example theOrganizationalEntityImpl_.id
field.- Returns:
- an
Expression
that can be used in a predicate with the values/parameters from aQueryCriteria
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)
- Overrides:
implSpecificCreatePredicateFromSingleCriteria
in classAbstractTaskQueryCriteriaUtil
-
getOrderByExpression
protected <T,R> javax.persistence.criteria.Expression getOrderByExpression(javax.persistence.criteria.CriteriaQuery<R> query, Class<T> queryType, String orderByListId)
- Overrides:
getOrderByExpression
in classorg.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, org.jbpm.query.jpa.data.QueryWhere queryWhere)
-
-