public class UpdateAllQuery extends ModifyAllQuery
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");
| Modifier and Type | Field and Description |
|---|---|
protected java.util.HashMap |
m_updateClauses |
defaultBuilder, INVALIDATE_CACHE, isPreparedUsingTempStorage, NO_CACHE, referenceClass, referenceClassName, resultforceBatchStatementExecution, modifyRowaccessor, arguments, argumentTypeNames, argumentTypes, argumentValues, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, cascadePolicy, CascadePrivateParts, descriptor, flushOnExecute, isPrepared, isUserDefined, name, NoCascading, properties, queryMechanism, session, sessionName, shouldBindAllParameters, shouldCacheStatement, shouldCloneCall, shouldMaintainCache, shouldPrepare, shouldUseWrapperPolicy, translationRowFalse, True, Undefined| Constructor and Description |
|---|
UpdateAllQuery()
PUBLIC:
Constructs a default update all query.
|
UpdateAllQuery(java.lang.Class referenceClass)
PUBLIC:
Constructs an update all query for the Class type specified.
|
UpdateAllQuery(java.lang.Class referenceClass,
Expression selectionCriteria)
PUBLIC:
Constructs an update all query for the specified Class type and selection criteria.
|
UpdateAllQuery(java.lang.Class referenceClass,
ExpressionBuilder expressionBuilder)
PUBLIC:
Constructs an update all query for the Class type specified and the given
ExpressionBuilder.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addUpdate(Expression field,
Expression value)
PUBLIC:
Adds the update (SET) clause to the query.
|
void |
addUpdate(Expression field,
java.lang.Object value)
PUBLIC:
Adds the update (SET) clause to the query.
|
void |
addUpdate(java.lang.String attributeName,
Expression value)
PUBLIC:
Adds the update (SET) clause to the query.
|
void |
addUpdate(java.lang.String attributeName,
java.lang.Object value)
PUBLIC:
Adds the update (SET) clause to the query.
|
protected void |
addUpdateInternal(java.lang.Object fieldObject,
java.lang.Object valueObject)
INTERNAL:
|
java.lang.Object |
executeDatabaseQuery()
INTERNAL:
Issue the SQL to the database and then merge into the cache.
|
java.util.HashMap |
getUpdateClauses()
INTERNAL:
Return the updates stored for an update all query
|
protected void |
initializeQuerySpecificDefaultBuilder()
INTERNAL:
Initialize the expression builder which should be used for this query.
|
boolean |
isUpdateAllQuery()
INTERNAL:
Return true if this is an update all query.
|
protected void |
prepare()
INTERNAL:
|
clonedQueryExecutionComplete, executeInUnitOfWork, getCacheUsage, getExpressionBuilder, getReferenceClass, getReferenceClassName, initializeDefaultBuilder, invalidateCache, isModifyQuery, isPreparedUsingTempStorage, mergeChangesIntoSharedCache, setCacheUsage, setExpressionBuilder, setIsPreparedUsingTempStorage, setReferenceClass, setReferenceClassName, setShouldDeferExecutionInUOW, shouldDeferExecutionInUOW, shouldInvalidateCacheforceBatchStatementExecution, getModifyRow, setForceBatchStatementExecution, setModifyRowaddArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildSelectionCriteria, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkDescriptor, checkEarlyReturn, checkForCustomQuery, checkPrepare, clone, convertClassNamesToClasses, deploymentSetShouldMaintainCache, deploymentShouldMaintainCache, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, getAccessor, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getEJBQLString, getFlushOnExecute, getName, getProperties, getProperty, getQueryMechanism, getSelectionCriteria, getSession, getSessionName, getShouldBindAllParameters, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isDataModifyQuery, isDataReadQuery, isDeleteAllQuery, isDeleteObjectQuery, isExpressionQuery, isInsertObjectQuery, isModifyAllQuery, isObjectBuildingQuery, isObjectLevelModifyQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isSQLCallQuery, isUpdateObjectQuery, isUserDefined, isWriteObjectQuery, maintainCache, prepareCall, prepareCustomQuery, prepareForExecution, prepareForRemoteExecution, removeProperty, rowFromArguments, setAccessor, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setEJBQLString, setFlushOnExecute, setIsPrepared, setIsUserDefined, setName, setProperties, setProperty, setQueryMechanism, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldUseWrapperPolicy, setSQLStatement, setSQLString, setTranslationRow, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldUseWrapperPolicy, toStringpublic 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 - ExpressionBuilderpublic 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 valueprotected void addUpdateInternal(java.lang.Object fieldObject,
java.lang.Object valueObject)
public java.lang.Object executeDatabaseQuery()
throws DatabaseException
executeDatabaseQuery in class DatabaseQueryDatabaseException - - an error has occurred on the database.public java.util.HashMap getUpdateClauses()
public boolean isUpdateAllQuery()
isUpdateAllQuery in class DatabaseQueryprotected void prepare()
throws QueryException
prepare in class DatabaseQueryQueryExceptionprotected void initializeQuerySpecificDefaultBuilder()
initializeQuerySpecificDefaultBuilder in class ModifyAllQuery