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");
INVALIDATE_CACHE, NO_CACHEBATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading| Constructor and Description |
|---|
UpdateAllQuery()
PUBLIC:
Constructs a default update all query.
|
UpdateAllQuery(Class referenceClass)
PUBLIC:
Constructs an update all query for the Class type specified.
|
UpdateAllQuery(Class referenceClass,
Expression selectionCriteria)
PUBLIC:
Constructs an update all query for the specified Class type and selection criteria.
|
UpdateAllQuery(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,
Object value)
PUBLIC:
Adds the update (SET) clause to the query.
|
void |
addUpdate(String attributeName,
Expression value)
PUBLIC:
Adds the update (SET) clause to the query.
|
void |
addUpdate(String attributeName,
Object value)
PUBLIC:
Adds the update (SET) clause to the query.
|
Object |
executeDatabaseQuery()
INTERNAL:
Issue the SQL to the database and then merge into the cache.
|
HashMap |
getUpdateClauses()
INTERNAL:
Return the updates stored for an update all query
|
boolean |
isUpdateAllQuery()
INTERNAL:
Return true if this is an update all query.
|
executeInUnitOfWork, getCacheUsage, getExpressionBuilder, getReferenceClass, getReferenceClassName, isModifyQuery, isPreparedUsingTempStorage, mergeChangesIntoSharedCache, setCacheUsage, setExpressionBuilder, setIsPreparedUsingTempStorage, setReferenceClass, setReferenceClassName, setShouldDeferExecutionInUOW, shouldDeferExecutionInUOWforceBatchStatementExecution, getModifyRow, setForceBatchStatementExecution, setModifyRowaddArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkDescriptor, checkEarlyReturn, checkPrepare, checkPrepare, clone, convertClassNamesToClasses, copyFromQuery, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, extractRemoteResult, getAccessor, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getBatchObjects, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getName, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getRedirector, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isDataModifyQuery, isDataReadQuery, isDefaultPropertiesQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isNativeConnectionRequired, isObjectBuildingQuery, isObjectLevelModifyQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isSQLCallQuery, isUpdateObjectQuery, isUserDefined, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareForExecution, prepareFromQuery, redirectQuery, remoteExecute, removeProperty, replaceValueHoldersIn, retrieveBypassCache, rowFromArguments, setAccessor, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setBatchObjects, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setFlushOnExecute, setHintString, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setJPQLString, setName, setProperties, setProperty, setQueryTimeout, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, storeBypassCache, toStringpublic UpdateAllQuery()
public UpdateAllQuery(Class referenceClass)
referenceClass - Classpublic UpdateAllQuery(Class referenceClass, Expression selectionCriteria)
referenceClass - Class type to be consideredselectionCriteria - Expressionpublic UpdateAllQuery(Class referenceClass, ExpressionBuilder expressionBuilder)
referenceClass - Class type to be consideredbuilder - ExpressionBuilderpublic void addUpdate(Expression field, Object value)
field - Expression Object level representation of a database query 'where' clausevalue - Object, the new valuepublic void addUpdate(String attributeName, 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(String attributeName, Expression value)
attributeName - String, the name of the attributevalue - Expression, the new valuepublic Object executeDatabaseQuery() throws DatabaseException
executeDatabaseQuery in class DatabaseQueryDatabaseException - - an error has occurred on the database.public HashMap getUpdateClauses()
public boolean isUpdateAllQuery()
isUpdateAllQuery in class DatabaseQuery