org.hibernate.hql.ast.QuerySyntaxException
程序员文章站
2022-04-13 08:48:28
...
执行hibernateTemplate.find()方法时出现:org.hibernate.hql.ast.QuerySyntaxException,即查询语法异常
下面为我的hql:
String hql = "SELECT DISTINCT f FROM Function f";
hql += "LEFT OUTER JOIN f.roles r";
hql += "LEFT OUTER JOIN r.users u";
hql += "WHERE u.id = ?";
检查发现每一行末尾没有加空格,导致hql拼接后语法异常。
上一篇: 说明文档
推荐阅读
-
org.hibernate.hql.ast.QuerySyntaxException
-
【转】org.hibernate.hql.ast.QuerySyntaxException: User is not mapped [from User]
-
org.hibernate.hql.ast.QuerySyntaxException: is not mapped [from ]怎么解决
-
org.hibernate.hql.ast.QuerySyntaxException
-
org.hibernate.hql.ast.QuerySyntaxException
-
org.hibernate.hql.ast.QuerySyntaxException
-
org.hibernate.hql.ast.QuerySyntaxException: xxx is not mapped