This EJBQL2 query:
FROM Foo foo, IN(foo.bars) bar
Is exactly equivalent to this HQL/EJBQL3 query:
FROM Foo foo JOIN foo.bars bar
Joshua Davis wrote:
Okay, that worked so I'm committing it. The new rule seems a little strange to me, but perhaps I don't understand what it's supposed to do.
fromClause : FROM fromClass ( ( COMMA (fromClass | collectionValuedPathDeclaration) ) | (joinType) )*
So..."FROM foo f, bar b, IN (red.blue.green) q" will parse because the IN (path) alias rule applies only after a comma? Does that mean the "IN (red.green.blue) q" is a join that applies to "bar b"? If so, it seems a little strange to have a comma in there.
Joshua Davis wrote:
I'm taking a look at it now. The weakKeyword() setting may be able to do this, but I'm not sure how much lookahead is being used after the comma.
Alexey Loubyansky wrote:
Hi Joshua,
I committed another hack in this area. Could you please look at it?
The problem is when I add an alternative to fromClass (in my case it's a
collection valued path declaration, i.e. 'IN(path) id') and in a query
after the first fromClass and comma there is another fromClass with
class name matching a keyword (e.g. Order) I get a no viable alternative
exception. So, below is a hack I came up with. Can you think of a nicer
workaround?
Thanks.
fromClause
! : FROM^ fromClass ( ( COMMA! fromClass ) | ( joinType ) )*
;
--- 218,233 ----
fromClause
! : FROM^ fromClass
! ( ( COMMA!
! ( fromClass | collectionValuedPathDeclaration )
! exception
! catch [RecognitionException ex]
! {
! // alex: this is bad. if there was no viable alternative,
! // i assume it was a class name which was recognized as a
keyword.
! // so call fromClass that is supposed to take care of
resolving the conflict.
! fromClass();
! }
! ) | ( joinType ) )*
;
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel
-- Gavin King +61 410 534 454 +1 404 822 8349 callto://gavinking
Hibernate [EMAIL PROTECTED] http://hibernate.org
JBoss Inc [EMAIL PROTECTED] http://jboss.com
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel