Package org.eclipse.persistence.queries
Class ModifyAllQuery
- java.lang.Object
-
- org.eclipse.persistence.queries.DatabaseQuery
-
- org.eclipse.persistence.queries.ModifyQuery
-
- org.eclipse.persistence.queries.ModifyAllQuery
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
DeleteAllQuery,UpdateAllQuery
public abstract class ModifyAllQuery extends ModifyQuery
PUBLIC: Query used to perform a bulk delete using the expression framework.- Since:
- August 18, 2005
- Author:
- Andrei Ilitchev
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.eclipse.persistence.queries.DatabaseQuery
DatabaseQuery.ParameterType
-
-
Field Summary
Fields Modifier and Type Field Description static intINVALIDATE_CACHEstatic intNO_CACHECache usage flags-
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading
-
-
Constructor Summary
Constructors Constructor Description ModifyAllQuery()PUBLIC:ModifyAllQuery(Class referenceClass)PUBLIC: Create a new update all query for the class specified.ModifyAllQuery(Class referenceClass, Expression selectionCriteria)PUBLIC: Create a new update all query for the class and the selection criteria specified.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ObjectexecuteInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)INTERNAL: Override query execution where Session is a UnitOfWork.intgetCacheUsage()PUBLIC: Return the cache usage for this query.ExpressionBuildergetExpressionBuilder()PUBLIC: Get the expression builder which should be used for this query.ClassgetReferenceClass()PUBLIC: Return the reference class for this query.StringgetReferenceClassName()INTERNAL: Return the name of the reference class of the query.booleanisModifyAllQuery()PUBLIC: Return true if this is a modify all query.booleanisPreparedUsingTempStorage()INTERNAL:voidmergeChangesIntoSharedCache()INTERNAL: After execution we need to merge the changes into the shared cache, unless the query has been tagged to bypass on the store.voidsetCacheUsage(int cacheUsage)PUBLIC: Set the level of cache support for this query, either NONE or INVALIDATE.voidsetExpressionBuilder(ExpressionBuilder builder)INTERNAL Sets the default expression builder for this query.voidsetIsPreparedUsingTempStorage(boolean isPreparedUsingTempStorage)INTERNAL:voidsetReferenceClass(Class referenceClass)PUBLIC: Set the reference class this query.voidsetReferenceClassName(String className)INTERNAL: Set the class name of the reference class of this query.voidsetShouldDeferExecutionInUOW(boolean shouldDeferExecutionInUOW)PUBLIC: Set a flag indicating whether execution should be deferred in UOW until commit.booleanshouldDeferExecutionInUOW()PUBLIC: Indicates whether execution should be deferred in UOW until commit.-
Methods inherited from class org.eclipse.persistence.queries.ModifyQuery
forceBatchStatementExecution, getModifyRow, isBatchExecutionSupported, isModifyQuery, setForceBatchStatementExecution, setIsBatchExecutionSupported, setModifyRow
-
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
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, executeDatabaseQuery, 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, getQueryTimeoutUnit, 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, isUpdateAllQuery, 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, setQueryTimeoutUnit, 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
-
-
-
-
Field Detail
-
NO_CACHE
public static final int NO_CACHE
Cache usage flags- See Also:
- Constant Field Values
-
INVALIDATE_CACHE
public static final int INVALIDATE_CACHE
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ModifyAllQuery
public ModifyAllQuery()
PUBLIC:
-
ModifyAllQuery
public ModifyAllQuery(Class referenceClass)
PUBLIC: Create a new update all query for the class specified.
-
ModifyAllQuery
public ModifyAllQuery(Class referenceClass, Expression selectionCriteria)
PUBLIC: Create a new update all query for the class and the selection criteria specified.
-
-
Method Detail
-
isModifyAllQuery
public boolean isModifyAllQuery()
PUBLIC: Return true if this is a modify all query.- Overrides:
isModifyAllQueryin classDatabaseQuery
-
setIsPreparedUsingTempStorage
public void setIsPreparedUsingTempStorage(boolean isPreparedUsingTempStorage)
INTERNAL:
-
isPreparedUsingTempStorage
public boolean isPreparedUsingTempStorage()
INTERNAL:
-
executeInUnitOfWork
public Object executeInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork, org.eclipse.persistence.internal.sessions.AbstractRecord translationRow) throws DatabaseException, OptimisticLockException
INTERNAL: Override query execution where Session is a UnitOfWork.If there are objects in the cache return the results of the cache lookup.
- Overrides:
executeInUnitOfWorkin classDatabaseQuery- Parameters:
unitOfWork- - the session in which the receiver will be executed.translationRow- - the arguments- Returns:
- An object, the result of executing the query.
- Throws:
DatabaseException- - an error has occurred on the database.OptimisticLockException- - an error has occurred using the optimistic lock feature.
-
getCacheUsage
public int getCacheUsage()
PUBLIC: Return the cache usage for this query.
-
getExpressionBuilder
public ExpressionBuilder getExpressionBuilder()
PUBLIC: Get the expression builder which should be used for this query. This expression builder should be used to build all expressions used by this query.
-
setExpressionBuilder
public void setExpressionBuilder(ExpressionBuilder builder)
INTERNAL Sets the default expression builder for this query.
-
getReferenceClassName
public String getReferenceClassName()
INTERNAL: Return the name of the reference class of the query. Used by the Mapping Workbench to avoid classpath dependencies- Overrides:
getReferenceClassNamein classDatabaseQuery
-
getReferenceClass
public Class getReferenceClass()
PUBLIC: Return the reference class for this query.- Overrides:
getReferenceClassin classDatabaseQuery
-
mergeChangesIntoSharedCache
public void mergeChangesIntoSharedCache()
INTERNAL: After execution we need to merge the changes into the shared cache, unless the query has been tagged to bypass on the store.
-
setCacheUsage
public void setCacheUsage(int cacheUsage)
PUBLIC: Set the level of cache support for this query, either NONE or INVALIDATE.
-
setReferenceClass
public void setReferenceClass(Class referenceClass)
PUBLIC: Set the reference class this query.
-
setReferenceClassName
public void setReferenceClassName(String className)
INTERNAL: Set the class name of the reference class of this query. Used by the Mapping Workbench to avoid classpath dependencies.
-
setShouldDeferExecutionInUOW
public void setShouldDeferExecutionInUOW(boolean shouldDeferExecutionInUOW)
PUBLIC: Set a flag indicating whether execution should be deferred in UOW until commit.
-
shouldDeferExecutionInUOW
public boolean shouldDeferExecutionInUOW()
PUBLIC: Indicates whether execution should be deferred in UOW until commit.
-
-