|
Oracle Fusion Middleware Java API Reference for Oracle TopLink 11g Release 1 (11.1.1) B32476-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.toplink.queryframework.DatabaseQuery
oracle.toplink.queryframework.ModifyQuery
oracle.toplink.queryframework.ModifyAllQuery
oracle.toplink.queryframework.UpdateAllQuery
public class UpdateAllQuery
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:
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");
Field Summary |
---|
Fields inherited from class oracle.toplink.queryframework.ModifyAllQuery |
---|
INVALIDATE_CACHE, NO_CACHE |
Fields inherited from class oracle.toplink.queryframework.DatabaseQuery |
---|
CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading |
Constructor Summary | |
---|---|
UpdateAllQuery() Constructs a default update all query. |
|
UpdateAllQuery(java.lang.Class referenceClass) Constructs an update all query for the Class type specified. |
|
UpdateAllQuery(java.lang.Class referenceClass, Expression selectionCriteria) Constructs an update all query for the specified Class type and selection criteria. |
|
UpdateAllQuery(java.lang.Class referenceClass, ExpressionBuilder expressionBuilder) Constructs an update all query for the Class type specified and the given ExpressionBuilder. |
Method Summary | |
---|---|
void |
addUpdate(Expression field, Expression value) Adds the update (SET) clause to the query. |
void |
addUpdate(Expression field, java.lang.Object value) Adds the update (SET) clause to the query. |
void |
addUpdate(java.lang.String attributeName, Expression value) Adds the update (SET) clause to the query. |
void |
addUpdate(java.lang.String attributeName, java.lang.Object value) Adds the update (SET) clause to the query. |
Methods inherited from class oracle.toplink.queryframework.ModifyAllQuery |
---|
getCacheUsage, getExpressionBuilder, getReferenceClass, isModifyQuery, setCacheUsage, setReferenceClass, setShouldDeferExecutionInUOW, shouldDeferExecutionInUOW |
Methods inherited from class oracle.toplink.queryframework.ModifyQuery |
---|
forceBatchStatementExecution, setForceBatchStatementExecution |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public UpdateAllQuery()
public UpdateAllQuery(java.lang.Class referenceClass)
referenceClass
- Classpublic UpdateAllQuery(java.lang.Class referenceClass, Expression selectionCriteria)
referenceClass
- Class type to be consideredselectionCriteria
- Expressionpublic UpdateAllQuery(java.lang.Class referenceClass, ExpressionBuilder expressionBuilder)
referenceClass
- Class type to be consideredbuilder
- ExpressionBuilderMethod Detail |
---|
public void addUpdate(Expression field, java.lang.Object value)
field
- Expression Object level representation of a database query 'where' clausevalue
- Object, the new valuepublic void addUpdate(java.lang.String attributeName, java.lang.Object value)
attributeName
- String, the name of the attributevalue
- Object, the new valuepublic void addUpdate(Expression field, Expression value)
field
- Expression, representation of a database query 'where' clause that describes the fieldvalue
- Expression, representation of a database query 'where' clause that describes the new valuepublic void addUpdate(java.lang.String attributeName, Expression value)
attributeName
- String, the name of the attributevalue
- Expression, the new value
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |