In Hibernate, I created a query using JOIN
to join two tables. The query executes fine in Oracles SQL Developer. However, if I add it to a @NamedQuery
, the server starts with this error:
Error in named query: loadFooByAnother: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: ON near line 1, column xxx
My named query is:
SELECT foo FROM FooTable foo JOIN BarTable bar
ON foo.something=bar.somethingId
WHERE bar.anotherId=:another
Is it not possible to use JOIN .. ON
syntax in Hibernate?