MyException - 我的异常网
当前位置:我的异常网» Java相关 » lang.IllegalArgumentException: org.hibernate.hql

lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException:

www.MyException.Cn  网友分享于:2013-11-11  浏览:3157次
hql 错误 unexpected token: (
碰见了个问题,求大家帮忙解决

2011-03-03 14:52:00 [STDOUT]-[INFO]-[152] ________hql = from is_static t,(select max(s.st_checkmark) checkmark,s.st_loginid from is_static s where s.st_loginid in (select m.ma_pid from is_machine m where 1=1 ) group by s.st_loginid ) a where t.st_loginid = a.st_loginid and t.st_checkmark = a.checkmark 

2011-03-03 14:52:00 [PARSER]-[ERROR]-[33] line 1:18: unexpected token: (

2011-03-03 14:52:00 [WorkConditionManagerCommand]-[INFO]-[1789] java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 18 [from is_static t,(select max(s.st_checkmark) checkmark,s.st_loginid from is_static s where s.st_loginid in (select m.ma_pid from is_machine m where 1=1 ) group by s.st_loginid ) a where t.st_loginid = a.st_loginid and t.st_checkmark = a.checkmark ]

sql里面可以执行,但是这里报"("问题!!


------解决方案--------------------
hql里from后面跟的是对象名,不是表名。
------解决方案--------------------
hql语句里面表名都是反转实体名以及对应实体属性名称

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有