I'm trying to query (hql) with an extra condition on a join but keep receiving the message:
Code:
Caused by: line 1:74: unexpected token: with
at org.hibernate.hql.antlr.HqlBaseParser.fromJoin(HqlBaseParser.java:1380)
at org.hibernate.hql.antlr.HqlBaseParser.fromClause(HqlBaseParser.java:1053)
at org.hibernate.hql.antlr.HqlBaseParser.selectFrom(HqlBaseParser.java:759)
From a simply query like:
Code:
from Synset s
left join s.terms st
with st.audit.author = 'fdelisle'
In this query, audit is a component in
I'm 100% sure I use the latest rc1 hibernate jars (reviewed my projects settings several times).
I can see in hibernate 3.1 rc1 grammar folder that the file hql.g contains:
Code:
fromJoin
: ( ( ( LEFT | RIGHT ) (OUTER)? ) | FULL | INNER )? JOIN^ (FETCH)?
path (asAlias)? (propertyFetch)? (withClause)?
;
withClause
: WITH^ logicalExpression
;
I know I can use filters to get extra conditions on a join, but the query I'm really concerned with (the one pasted here is a simple example) do something like:
select a from A a
left join a.bs
with bs.field = :condition
left join fetch a.bs <- filter is applied to this collection instance also, and I don't want filtering for these one.
Is there any JUnit test included with this hibernate release testing the With operator so I can try it out?
Thank you very much,
Hibernate version:
3.1 rc1
Mapping documents:
Not relevant
Code between sessionFactory.openSession() and session.close():
Not relevant
Full stack trace of any exception that occurs:
No Exception
Name and version of the database you are using:
Not Relevant
The generated SQL (show_sql=true):
Doesn't reach this point
Debug level Hibernate log excerpt:
Will post on demand.