大家帮忙看看,这条HQL语句错在哪?
"select cl.szcontainerCode as clcode,el.lenterId as eldt from ContainerLog as cl,EnterLeaveLog as el where cl.enterLeaveLog.lenterId=el.lenterId"
结果出错,excpetion:
org.springframework.orm.hibernate.HibernateQueryException: , expected in SELECT [select cl.szcontainerCode as clcode, el.lenterId as eldt from com.cenin.depot.hibernate.ContainerLog as cl,com.cenin.depot.hibernate.EnterLeaveLog as el where cl.enterLeaveLog.lenterId=el.lenterId];
nested exception is net.sf.hibernate.QueryException: , expected in SELECT [select cl.szcontainerCode as clcode, el.lenterId as eldt from com.cenin.depot.hibernate.ContainerLog as cl,com.cenin.depot.hibernate.EnterLeaveLog as el where cl.enterLeaveLog.lenterId=el.lenterId]
所是少","? 可是明明有","呀,如果把上面select中的前两个as去掉,变成下这样:
"select cl.szcontainerCode, el.lenterId from ContainerLog as cl,EnterLeaveLog as el where cl.enterLeaveLog.lenterId=el.lenterId"
就没问题了,但是得到的Object里没有字段名,用起来不方便....
请大家帮忙看看,这问题出在哪里呢,谢谢~~!