Spring data jpa高级查询,部分字段查询,过滤查询,空字符过滤

        @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 query = em.createQuery(hql, WorkflowTask.class);


 
  
 
  
return query.getResultList();

你可能感兴趣的:(java)