select t1.* from Tmodule t1,Tpermission t2 where t1.id=t2.modelId and t2.userId=1
类名,字段都没有错这点大家不用怀疑
关键错误信息:
org.hibernate.hql.ast.QuerySyntaxException: expecting IDENT, found '*' near line 1, column 11 [select t1.* from Tmodule t1,com.cube.housev2.pojo.Tpermission t2 where t1.id=t2.modelId and t2.userId=1]
还是说这种关联查询只能全查出来?
[code="java"]select t1 from Tmodule t1,Tpermission t2 where t1.id=t2.modelId and t2.userId=1
[/code]
把菊花拿掉
你写的 不是SQL么?那你还用什么hibernate呢,直接用JDBC好了。。
HIBERNATE