回复 6# cathy
查了一下平台源代码,应该是平台的事情。
报错信息如下:
- 11:08:20,031 ERROR JDBCExceptionReporter:78 - 如果指定了 SELECT DISTINCT,那么 ORDER BY 子句中的项就必须出现在选择列表中。
- 11:08:20,031 WARN JDBCExceptionReporter:54 - SQL Warning: 145, SQLState: S1000
- 11:08:20,031 WARN JDBCExceptionReporter:55 - Preparing the statement failed: 如果指定了 SELECT DISTINCT,那么 ORDER BY 子句中的项就必须出现在选择列表中。
- 11:08:20,031 ERROR DispatcherUtils:245 - Could not execute action
- org.hibernate.exception.GenericJDBCException: could not execute query
- at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
- at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
- at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
- at org.hibernate.loader.Loader.doList(Loader.java:2214)
- at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2095)
- at org.hibernate.loader.Loader.list(Loader.java:2090)
- at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:375)
- at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:338)
- at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:172)
- at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1121)
- at org.hibernate.impl.QueryImpl.list(QueryImpl.java:79)
- at cn.myapps.base.dao.HibernateBaseDAO.getDatas(HibernateBaseDAO.java:239)
- at cn.myapps.base.dao.HibernateBaseDAO.getDatas(HibernateBaseDAO.java:95)
- at cn.myapps.core.workflow.statelabel.dao.HibernateStateLabelDAO.queryStates(HibernateStateLabelDAO.java:34)
- at cn.myapps.core.workflow.statelabel.ejb.StateLabelProcessBean.doQueryState(StateLabelProcessBean.java:29)
复制代码 再看看这句异常: at cn.myapps.core.workflow.statelabel.dao.HibernateStateLabelDAO.queryStates(HibernateStateLabelDAO.java:34)
第34行的代码包括:
跟踪里面的hql的内容:- select distinct vo.value from
- cn.myapps.core.workflow.statelabel.ejb.StateLabel vo where applicationid='11df-
- feb0-6688bb14-8521-99fd4ea7469e' order by orderNo
复制代码 将cn.myapps.core.workflow.statelabel.ejb.StateLabel 换成:T_STATELABEL后,sql语句变成:- select distinct vo.value from
- T_STATELABEL vo where applicationid='11df-
- feb0-6688bb14-8521-99fd4ea7469e' order by orderNo
复制代码 在ms sql server的查询分析器里面确实执行不了这样一条语句呀?
请问怎么解决的?
直接修改cn.myapps.core.workflow.statelabel.dao.HibernateStateLabelDAO.queryStates的代码么?会不会产生其他问题? |