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");
DatabaseQuery.ParameterType
INVALIDATE_CACHE, NO_CACHE
BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading
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.
|
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
|
boolean |
isUpdateAllQuery()
INTERNAL: Return true if this is an update all query.
|
executeInUnitOfWork, getCacheUsage, getExpressionBuilder, getReferenceClass, getReferenceClassName, isModifyAllQuery, isPreparedUsingTempStorage, mergeChangesIntoSharedCache, setCacheUsage, setExpressionBuilder, setIsPreparedUsingTempStorage, setReferenceClass, setReferenceClassName, setShouldDeferExecutionInUOW, shouldDeferExecutionInUOW
forceBatchStatementExecution, getModifyRow, isBatchExecutionSupported, isModifyQuery, setForceBatchStatementExecution, setIsBatchExecutionSupported, setModifyRow
addArgument, addArgument, addArgument, addArgument, 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, getAccessors, getArgumentParameterTypes, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getBatchObjects, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDescriptors, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getMonitorName, getName, getNullableArguments, getParameterDelimiter, getParameterDelimiterChar, getPartitioningPolicy, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getRedirector, getRedirectorForQuery, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasNullableArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isDataModifyQuery, isDataReadQuery, isDefaultPropertiesQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isNativeConnectionRequired, isObjectBuildingQuery, isObjectLevelModifyQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReadQuery, isReportQuery, isResultSetMappingQuery, isSQLCallQuery, isUpdateObjectQuery, isUserDefined, isUserDefinedSQLCall, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, prepareForExecution, prepareFromQuery, prepareInternal, redirectQuery, remoteExecute, removeProperty, replaceValueHoldersIn, resetMonitorName, retrieveBypassCache, rowFromArguments, setAccessor, setAccessors, setAllowNativeSQLQuery, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setBatchObjects, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setFlushOnExecute, setHintString, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setIsUserDefinedSQLCall, setJPQLString, setName, setNullableArguments, setParameterDelimiter, setPartitioningPolicy, setProperties, setProperty, setQueryTimeout, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setShouldValidateUpdateCallCacheUse, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldAllowNativeSQLQuery, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, shouldValidateUpdateCallCacheUse, storeBypassCache, toString
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
- 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 valuepublic java.lang.Object executeDatabaseQuery() throws DatabaseException
executeDatabaseQuery
in class DatabaseQuery
DatabaseException
- - an error has occurred on the database.public java.util.HashMap getUpdateClauses()
public boolean isUpdateAllQuery()
isUpdateAllQuery
in class DatabaseQuery