persistence@glassfish.java.net

JPQL: fix unqualified field access in UPDATE/DELETE queries

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Fri, 10 Nov 2006 14:53:04 +0100

Hi Tom, hi Jielin,

attached you find my changes to fix issue 1382: "Error on unqualified
field access in bulk UPDATE and DELETE":
  https://glassfish.dev.java.net/issues/show_bug.cgi?id=1382

The current compiler throws an exception for the following query:
  UPDATE Customer SET name = 'CHANGED' WHERE name = 'Michael Bouschen'
It cannot resolve the access of field name in the WHERE clause.

The fix is to qualify any field access using the abstract schema name as
variable name. I added a method to the superclass of the parse tree
nodes that is called for UPDATE/DELETE queries and replaces an
unqualified attribute access by a DotNode.

Regards Michael