org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 3解决方法
2013-09-13 17:32
791 查看
在写sql的时候可能会出现以下sql语句:
如果这是HQL,那么这段代码就是错误的,因为HQL不支持ON这个字符,如果要做关联关系就必须将On改为where:
select a.name,b.age from TableA a left join TableB b on a.id=b.id
如果这是HQL,那么这段代码就是错误的,因为HQL不支持ON这个字符,如果要做关联关系就必须将On改为where:
select a.name,b.age from TableA a left join TableB b where a.id=b.id
相关文章推荐
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: on near line 1解决方案
- org.hibernate.hql.internal.ast.QuerySyntaxExceptionunexpected token: on near line 1
- org.hibernate.hql.internal.ast.QuerySyntaxExceptionunexpected token: on near line 1
- org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: * near line 1, column 8
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token 异常解决
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: ( near line 1, column 16
- org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: b near line 1, column 49...
- org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: u near line 1, column 55 [fro
- 求帮助org.hibernate.hql.ast.QuerySyntaxException: unexpected token: id near line 1, column 35 [from com
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token 的解决
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: from near line 1, column 17 [select co
- 异常积累:org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token:
- org.hibernate.hql.ast.QuerySyntaxException: unexpected token: where near line
- org.hibernate.hql.ast.QuerySyntaxException: Unable to locate appropriate constructor on class XXX解决
- HQL子查询报错:org.hibernate.hql.ast.QuerySyntaxException: unexpected token...
- Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token:
- ClassNotFoundException: org.hibernate.hql.ast.HqlToken 解决方法与原因
- org.hibernate.hql.ast.QuerySyntaxException: Unable to locate appropriate constructor on class xxx
- 每日一得-org.hibernate.hql.ast.QuerySyntaxException: Path expected for join!错误解决办法
- ClassNotFoundException: org.hibernate.hql.ast.HqlToken 解决方法与原因