That looks much nicer. Thanks, Joshua.
The IN expression is translated into inner join. There is EJBQLTest
(next to HQLTest) which compares translation results of EJBQL and
equivalent HQL queries. So, you can always look at them to see what is
expected.

Thanks.

> -----Original Message-----
> From: Joshua Davis [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, December 19, 2004 3:39 AM
> To: Joshua Davis
> Cc: Alexey Loubyansky; Hibernate development
> Subject: Re: [Hibernate] introductions of new keywords to ql 
> (Welcome to parser land!)
> 
> 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

Reply via email to