日期:2014-05-18  浏览次数:20601 次

大神进来看看:HQL不能加括号么?
HQL语句里面不能加括号? 没加之前是对的select entry.cellAddress from com.fuhe.yjh1104.dbaccess.dao.EntryConversionFunction entry  where entry.standReportId = 1277 and entry.entryConversionFunction like '%A3302%33370%' and entry.cellAddress like '%C%' or entry.cellAddress like '%D%' order by entry.reportContentDefinition.id,但是sql不对满足不了要求,现在加了直接hql: select entry.cellAddress from com.fuhe.yjh1104.dbaccess.dao.EntryConversionFunction entry  where entry.standReportId = 1277 and entry.entryConversionFunction like '%A3302%33370%' and (entry.cellAddress like '%C%' or entry.cellAddress like '%D%')order by entry.reportContentDefinition.id 都不对了,请问下该怎么弄,谢谢。
org.springframework.orm.hibernate3.HibernateQueryException: unexpected char: 0xA3 [ select entry.cellAddress from com.fuhe.yjh1104.dbaccess.dao.EntryConversionFunction entry  where entry.standReportId = 1277 and entry.entryConversionFunction like '%A3302%33370%' and (entry.cellAddress like '%C%' or entry.cellAddress like '%D%')order by entry.reportContentDefinition.id]; nested exception is org.hibernate.QueryException: unexpected char: 0xA3 [ select entry.cellAddress from com.fuhe.yjh1104.dbaccess.dao.EntryConversionFunction entry  where entry.standReportId = 1277 and entry.entryConversionFunction like '%A3302%33370%' and (entry.cellAddress like '%C%' or entry.cellAddress like '%D%')order by entry.reportContentDefinition.id]
org.hibernate.QueryException: unexpected char: 0xA3 [ select entry.cellAddress from com.fuhe.yjh1104.dbaccess.dao.EntryConversionFunction entry  where entry.standReportId = 1277 and entry.entryConversionFunction like '%A3302%33370%' and (entry.cellAddress like '%C%' or entry.cellAddress like '%D%')order by entry.reportContentDefinition.id]
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:165)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:83)
at org.hibernate.impl.SessionFactoryImpl.getQuery(SessionFactoryImpl.java:427)
at org.hibernate.impl.SessionImpl.getQueries(SessionImpl.java:884)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:834)
at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
hql