开发者社区> 问答> 正文

映射到hbm.xml文件时无法提取ResultSet

我有一个联合查询

SELECT al.C_PERSIST_ID AS id, tkl.C_PERSIST_VERSION AS version, tkl.C_TENANT_ID AS tenantId, tkl.C_MESSAGE AS message, tkl.C_CREATED AS created, tkl.C_INT_STATUS AS statusDB, tkl.C_INT_PRIORITY AS priorityDB,tkl.C_ASSIGNED_PERSON_ID AS assignedPersonId, tkl.C_SOURCE AS name, tkl.C_MAJOR_VERSION AS majorVersion, tkl.C_MINOR_VERSION AS minorVersion, tkl.C_ARCHIVED_FLAG AS archived, tkl.C_DEFINITION_ID AS definitionId,al.C_ALERT_DATETIME AS alertDateTime, al.C_ESCALATION_LEVEL AS escalationLevel, al.C_MAX_ESCALATION_LEVEL AS maxEscalationLevel, al.C_WORKFLOW_TO_START AS workflowToStart al.C_ESCALATED_FLAG AS escalatedDB,al.C_DUEDATE AS dueDate FROM tkl_Alerts al INNER JOIN tkl_TaskList_Items tkl ON al.C_PERSIST_ID = tkl.C_PERSIST_ID LEFT JOIN ( SELECT distinct du.C_TASKLISTITEM_ID FROM tkl_Distribution_Users du WHERE du.C_USER_ID = 'karishma.shaik@infor.com' AND du.C_IS_PERSON = 1) X ON tkl.C_PERSIST_ID = X.C_TASKLISTITEM_ID WHERE tkl.C_ARCHIVED_FLAG = 0 AND tkl.C_INT_STATUS <> 40 AND tkl.C_INT_STATUS <> 50 AND tkl.C_ASSIGNED_PERSON_ID IS NULL AND X.C_TASKLISTITEM_ID IS NOT NULL union

SELECT al.C_PERSIST_ID AS id, tkl.C_PERSIST_VERSION AS version, tkl.C_TENANT_ID AS tenantId, tkl.C_MESSAGE AS message, tkl.C_CREATED AS created, tkl.C_INT_STATUS AS statusDB, tkl.C_INT_PRIORITY AS priorityDB,tkl.C_ASSIGNED_PERSON_ID AS assignedPersonId, tkl.C_SOURCE AS name, tkl.C_MAJOR_VERSION AS majorVersion, tkl.C_MINOR_VERSION AS minorVersion, tkl.C_ARCHIVED_FLAG AS archived, tkl.C_DEFINITION_ID AS definitionId,al.C_ALERT_DATETIME AS alertDateTime, al.C_ESCALATION_LEVEL AS escalationLevel, al.C_MAX_ESCALATION_LEVEL AS maxEscalationLevel, al.C_WORKFLOW_TO_START AS workflowToStart, al.C_ESCALATED_FLAG AS escalatedDB,al.C_DUEDATE AS dueDate FROM tkl_Alerts al INNER JOIN tkl_TaskList_Items tkl ON al.C_PERSIST_ID = tkl.C_PERSIST_ID WHERE tkl.C_ARCHIVED_FLAG = 0 AND tkl.C_INT_STATUS <> 40 AND tkl.C_INT_STATUS <> 50 AND tkl.C_ASSIGNED_PERSON_ID = 'karishma.shaik@infor.com' ORDER BY tkl_Alerts.C_ESCALATION_LEVEL DESC, tkl_Alerts.C_PERSIST_ID DESC 当我将其映射到hbm.xml文件时,出现如下错误:

javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1310) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:277) at com.infor.ion.process.pulseengine.dao.TaskListItemHeaderDao.lambda$executeItemQuery$45(TaskListItemHeaderDao.java:661) at com.infor.ion.persist.multitenant.hibernate.Transactional.doInTransaction(Transactional.java:73) at com.infor.ion.process.pulseengine.dao.TaskListItemHeaderDao.executeItemQuery(TaskListItemHeaderDao.java:655) at com.infor.ion.process.pulseengine.dao.TaskListItemHeaderDao.getMyAlertHeaders(TaskListItemHeaderDao.java:443) at com.infor.ion.process.pulseengine.dao.TaskListItemHeaderDao.getMyAlertHeaders(TaskListItemHeaderDao.java:455) at com.infor.ion.process.pulseengine.logic.TaskListItemHeaderManager$DaoRetry$3.doInRetry(TaskListItemHeaderManager.java:276) at com.infor.ion.process.common.persist.WithRetry.doInRetry(WithRetry.java:77) at com.infor.ion.process.common.persist.WithRetry.doInRetry(WithRetry.java:113) at com.infor.ion.process.pulseengine.logic.TaskListItemHeaderManager$DaoRetry.getMyAlertHeaders(TaskListItemHeaderManager.java:272) at com.infor.ion.process.pulseengine.logic.TaskListItemHeaderManager.getMyAlertHeaders(TaskListItemHeaderManager.java:78) at com.infor.ion.process.pulseengine.logic.PulseUIServiceImpl.getMyAlertHeaders(PulseUIServiceImpl.java:149) at com.infor.ion.process.pulseengine.pulseui.api.services.PulseApiUIProxyService.getMyAlertHeaders(PulseApiUIProxyService.java:178) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)

展开
收起
小六码奴 2019-10-03 19:33:08 922 0
0 条回答
写回答
取消 提交回答
问答标签:
问答地址:
问答排行榜
最热
最新

相关课程

更多

相关电子书

更多
低代码开发师(初级)实战教程 立即下载
冬季实战营第三期:MySQL数据库进阶实战 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载