当前位置: 代码迷 >> Java Web开发 >> hibernate中如何不能用inner join啊
  详细解决方案

hibernate中如何不能用inner join啊

热度:118   发布时间:2016-04-17 13:22:13.0
hibernate中怎么不能用inner join啊?
在hibernate中我查询两张表中的数据,我这样写查询语句,但就是抱错
select   t.name,t.type,s.name   from   Ren   t   inner   join   Type   s   on   t.type=s.id
错误如下:
org.hibernate.hql.ast.QuerySyntaxException:   unexpected   token:   on   near   line   1,   column   64   [select   t.name,t.type,s.name   from   liubi.Ren   t   inner   join   Type   s   on   t.type=s.id]

------解决方案--------------------
select t.name,t.type,s.name from Ren t inner join t.type s

------解决方案--------------------
select t.name,t.type,s.name from Ren t , Type s where t.type=s.id
  相关解决方案