[hibernate-dev] HQL Grammar for "ON" joins...

James Carman james at carmanconsulting.com
Thu Sep 20 12:25:00 EDT 2007


Well, how difficult would it be to get the HQL_ANTLR_2 branch
mavenized so that it mimics the layout of the trunk?  Wouldn't that
branch, as it currently sits, be very difficult to merge back into the
trunk?  Could we make a copy of the trunk to another branch so that we
can copy over your changes into it (I can't do that because I don't
have write permissions)?  Then, we can work on that mavenized branch.

On 9/20/07, Steve Ebersole <steve at hibernate.org> wrote:
> On Thursday 20 September 2007 09:14:47 am James Carman wrote:
> > What do you guys think about this...
> >
> > fromClause
> >
> >       : FROM^ { weakKeywords(); } fromRange ( onJoin | pathJoin | COMMA! {
> >
> > weakKeywords(); } fromRange )*
> >       ;
> >
> > onJoin
> >
> >     : ( ( ( LEFT | RIGHT ) (OUTER)? ) | FULL | INNER )? JOIN^
> >
> >       identifier asAlias ON^ logicalExpression
> >     ;
> >
> > pathJoin
> >
> >     : ( ( ( LEFT | RIGHT ) (OUTER)? ) | FULL | INNER )? JOIN^ (FETCH)?
> >
> >         path (asAlias)? (propertyFetch)? (withClause)?
> >     ;
> >
> > The "pathJoin" is basically what we currently support.  The "onJoin"
> > is what we want to support.  Does it look correct to you?
> > _______________________________________________
> > hibernate-dev mailing list
> > hibernate-dev at lists.jboss.org
> > https://lists.jboss.org/mailman/listinfo/hibernate-dev
>
> At a bare minimum this would not work because the identifier sub-rule result
> (recognized after JOIN) would need to be resolved before allowing the lexer
> to continue on to the resolution of the logicalExpression sub-rule.
>
> But even more basic, I don't think "identifier" is the correct sub-rule here.
> It would catch imported entity name scenarios, but obviously fail on
> non-imported entity names (aka FQN).
>
> Have you looked the grammars I started for the re-work of the query parser?
> It is obviously more work to go this route, but much more correct imo.
>
> http://viewvc.jboss.org/cgi-bin/viewvc.cgi/hibernate/core/branches/HQL_ANTLR_2/g2/
>



More information about the hibernate-dev mailing list