hibernate语句
SELECT WebInfo.id , WebInfo.title, WebInfo.isuer, WebInfo.isdate,Group.name  FROM WebInfo INNER JOIN Group ON WebInfo.goupid = Group.id 
现在显示错误,2个表连接查询

解决方案 »

  1.   

    显示错误
    Request processing failed; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: Group near line 1,用改成别名吗? 直接用也可以吧
      

  2.   

    hibernate在执行的时候需要使用select么,应该是不用写select的吧
      

  3.   

    我改成下面的也不行
    SELECT w.id, w.title, w.isuer, w.isdate,g.name FROM WebInfo w, Group g where w.group.id = g.id
      

  4.   

    WebInfo , Group 两个类之间有配置映射关系吗?
      

  5.   


    首先 w.group.id  应该是 groupid,另外贴出hibernate语句查询的完整语句。
      

  6.   

    Group  是个关键字吧,你的表名还叫group?
    试试下边两个步骤
    1、先把group 名字改了  如 grouppp
    2、再试试这个对不对 ELECT WebInfo.id , WebInfo.title, WebInfo.isuer, WebInfo.isdate,ttt.name  FROM WebInfo INNER JOIN   Webinfo.grouppp  ttt (这个是 在WebInfo表中的 private Grouppp gourppp 属性)