我JPA (Hibernate)
在我的项目中使用,JOIN
如果不明确设置Entities
.
我记得在TOPLINK
.
询问:
示例 1:
SELECT a FROM
EntityA a
INNER JOIN EntityB b on b.col1=a.col1
INNER JOIN EntityC c on c.col1=b.col1
LEFT JOIN EntityC c on c.col1=a.col1
错误:
Unexpected token "on"
示例 2:
SELECT a FROM
EntityA a
INNER JOIN EntityB b
INNER JOIN EntityC c
LEFT JOIN EntityC c
WHERE b.col1=a.col1 AND c.col1=b.col1 AND c.col1=a.col1
错误:
ERROR o.hibernate.impl.SessionFactoryImpl - Error in named query:
org.hibernate.hql.ast.QuerySyntaxException: Path expected for join!
[SELECT **MY QUERY HERE**]
at org.hibernate.hql.ast.QuerySyntaxException.convert
(QuerySyntaxException.java:54)
~[hibernate3.jar:na]
ERROR org.hibernate.hql.PARSER - Path expected for join!
ERROR org.hibernate.hql.PARSER - Invalid path: 'b.col1'
ERROR org.hibernate.hql.PARSER - Invalid path: 'c.col1'
请不要过多关注实体和列名称,因为它们不是实际名称:)
谢谢你的时间。