@PersistenceContext
private EntityManager em;
String hql = "select new WorkflowTask(taskId,versionNum,instanceId,sysId,templateId,templateName,version,taskProcessStatus,taskBusinessStatus,"
+ "reviewer,assistantReviewer,executant,preNodeName,nodeName,nodeId,taskCreateTime,taskModifyTime,taskType,taskTransferType,taskAssistantType,parentInstanceId,standby1,standby2,standby3,standby4,standby5,relationInstanceId,delegateId,rate,nextRealTaskId,nextPrototypeTaskId,acttaskid,parentstate,reviewerExpression,childFirstTaskId) "
+ "from WorkflowTask where 1=1 "+whereHql +" order by taskCreateTime DESC";
TypedQuery<WorkflowTask> query = em.createQuery(hql, WorkflowTask.class);
</pre><pre name="code" class="java">
</pre><pre name="code" class="java">return query.getResultList();