persistence@glassfish.java.net

Patch fixing issues with UPDATE and constructor EJBQL queries

From: Michael Bouschen <Michael.Bouschen_at_Sun.COM>
Date: Fri, 18 Nov 2005 14:45:35 +0100

Hi Tom, hi Shelly,

attached you find a patch for two EJBQL issues:

(1) An EJBQL constructor query fails in the container because the EJBQL
compiler cannot find the constructor class. The same query works in a
J2SE environment. I talked to Tom and Sahoo and both think using the
thread context class loader should work for dynamic queries. Sahoo and I
are not sure about named queries, we do not know when they are compiled
and whether the context class loader is set in this environment.
Tom, do you know?

(2) The EJBQLParser does not accept an arithmetic expression in the SET
clause of an UPDATE statement:
   UPDATE Employee e SET e.salary = e.salary * 10.0.
I changed the corresponding rule in the EJBQLParser.

The attached jar includes the changed source and the class files, such
that it can be used as a patch.

Tom,
please have a look at the source changes.

Shelly,
please try the patch and let me know whether it works on your side.

Thanks!

Regards Michael