use of org.jbpm.services.task.impl.model.TaskImpl in project jbpm by kiegroup.
the class TaskSummaryQueryCriteriaUtil method getEntityField.
/*
* (non-Javadoc)
* @see org.jbpm.query.jpa.impl.QueryCriteriaUtil#getEntityField(javax.persistence.criteria.CriteriaQuery, java.lang.Class, java.lang.String)
*/
@Override
protected <T> Expression getEntityField(CriteriaQuery<T> query, String listId, Attribute attr) {
if (attr == null) {
return null;
}
Root<TaskImpl> taskRoot = null;
Join<TaskImpl, TaskDataImpl> taskDataJoin = null;
Join<TaskImpl, PeopleAssignmentsImpl> peopAssignJoin = null;
for (Root root : query.getRoots()) {
if (TaskImpl.class.equals(root.getJavaType())) {
taskRoot = (Root<TaskImpl>) root;
for (Join<TaskImpl, ?> join : taskRoot.getJoins()) {
if (TaskDataImpl.class.equals(join.getJavaType())) {
taskDataJoin = (Join<TaskImpl, TaskDataImpl>) join;
} else if (PeopleAssignmentsImpl.class.equals(join.getJavaType())) {
peopAssignJoin = (Join<TaskImpl, PeopleAssignmentsImpl>) join;
}
}
}
}
assert taskRoot != null : "Unable to find TaskImpl Root in query!";
if (taskDataJoin == null) {
taskDataJoin = taskRoot.join(TaskImpl_.taskData);
}
assert taskDataJoin != null : "Unable to find TaskDataImpl Join in query!";
return taskImplSpecificGetEntityField(query, taskRoot, taskDataJoin, peopAssignJoin, listId, attr);
}
Aggregations