hibernate语句
SELECT WebInfo.id , WebInfo.title, WebInfo.isuer, WebInfo.isdate,Group.name FROM WebInfo INNER JOIN Group ON WebInfo.goupid = Group.id
现在显示错误,2个表连接查询
SELECT WebInfo.id , WebInfo.title, WebInfo.isuer, WebInfo.isdate,Group.name FROM WebInfo INNER JOIN Group ON WebInfo.goupid = Group.id
现在显示错误,2个表连接查询
解决方案 »
- hql语句查询不出属性
- 请教javascript得到一个blob类型的数据 如何显示成一张图片
- hibernate映射问题
- JSP include 的子页面数据加载问题
- entitybean 返回問題
- compass 查询负数范围的问题
- 有关ie下js动态创建form表单上传文件无法获得问题 急请教大虾帮忙
- static的问题
- MyEclipse和eclipse有什么联系和不同?
- 在线等待:请问 在 Struts 中使用 validation 验证,怎么访问非默认的属性文件里的 KEY ?
- 如何循环每次插入1000条数据,每条数据有35个字段,要求每个字段生成数据不能重复!
- java web 页面第一次加载的时候查询出User表中的所有数据,当用户点击查询的时候,显示根据条件查询出的数据
Request processing failed; nested exception is org.hibernate.hql.ast.QuerySyntaxException: unexpected token: Group near line 1,用改成别名吗? 直接用也可以吧
SELECT w.id, w.title, w.isuer, w.isdate,g.name FROM WebInfo w, Group g where w.group.id = g.id
首先 w.group.id 应该是 groupid,另外贴出hibernate语句查询的完整语句。
试试下边两个步骤
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 属性)