Guys, I’d like to slightly change how the new parser handles a couple of exotic (redundant) constructs. Basically, what I want, is that the first phase of parsing produces a HQL AST with a much simpler canonical form, with less Kinds of Things. So, for example:

 

  • “elements(foo.collection)” would be replaced with “(from foo.collection)”
  • “indices (foo.collection)” would be replaced with “(select index(x) from foo.collection x)”

 

So far, so good, I already managed to implement this in hql.g, it was straightforward. But I also want:

 

  • “from Foo foo where foo.map[key] = ‘blah’” to be transformed to “from Foo foo join foo.map x where index(x) = ‘blah’

 

And now I gotta problem. Trouble is that it seems quite difficult to stick new join clauses onto the from clause, when we discover stuff further down the tree.

 

Can this even be done?

-- 
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

-- 
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

Reply via email to