PUBLIC: A Query Class used to perform a bulk update using TopLink's expression framework. This class is provided to help optimize performance. It can be used in place of reading in all the objects to be changed and issuing single updates per instance. With this approach a single SQL UPDATE statement can be issued and then, based on the Expression provided, any objects in the cache that are effected by the update can be invalidated.
Notes:
- By default, if a UOW is being used, this query will be deferred until the UOW commits.
- UpdateAllQuery does not support foreign key updates unless the relationship is 1-1 (without back pointers.)
Example of Usage: Adding an area code.
UpdateAllQuery updateQuery = new UpdateAllQuery(Employee.class);
updateQuery.setSelectionCriteria(eb.get("areaCode").isNull());
updateQuery.addUpdate(eb.get("areaCode"), "613");
@author Guy Pelletier
@date March 1, 2004