我有一个联合查询
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)
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。