|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.eclipse.persistence.queries.DatabaseQuery
org.eclipse.persistence.queries.ModifyQuery
org.eclipse.persistence.queries.ModifyAllQuery
org.eclipse.persistence.queries.DeleteAllQuery
public class DeleteAllQuery
Purpose: Query used to delete a collection of objects. This is used by mappings to delete all of their target objects in a single database call. The SQL/SQLStatements must be provided.
DeleteAll can also be used with an Expression (or JPQL) to dynamically delete a set of objects from the database, and invalidate them in the cache.
Responsibilities:
| Field Summary |
|---|
| Fields inherited from class org.eclipse.persistence.queries.ModifyAllQuery |
|---|
INVALIDATE_CACHE, NO_CACHE |
| Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery |
|---|
BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading |
| Constructor Summary | |
|---|---|
DeleteAllQuery()
PUBLIC: |
|
DeleteAllQuery(java.lang.Class referenceClass)
PUBLIC: Create a new delete all query for the class specified. |
|
DeleteAllQuery(java.lang.Class referenceClass,
Expression selectionCriteria)
PUBLIC: Create a new delete all query for the class and the selection criteria specified. |
|
| Method Summary | |
|---|---|
java.lang.Object |
executeDatabaseQuery()
INTERNAL: Perform the work to delete a collection of objects. |
void |
executeDeleteAll(org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord translationRow,
java.util.Vector objects)
INTERNAL: Delete all queries are executed specially to avoid cloning and ensure preparing. |
java.lang.Object |
executeInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
INTERNAL: This method has to be broken. |
java.util.List<java.lang.Object> |
getObjects()
PUBLIC: Return the objects that are to be deleted |
boolean |
isDeleteAllQuery()
PUBLIC: Return if this is a delete all query. |
boolean |
isInMemoryOnly()
INTERNAL: Return if objects should be remove from the persistence context only (no database). |
void |
setIsInMemoryOnly(boolean isInMemoryOnly)
INTERNAL: Set if objects should be remove from the persistence context only (no database). |
void |
setObjects(java.util.List<java.lang.Object> objectCollection)
PUBLIC (REQUIRED): Set the objects to be deleted. |
| Methods inherited from class org.eclipse.persistence.queries.ModifyAllQuery |
|---|
getCacheUsage, getExpressionBuilder, getReferenceClass, getReferenceClassName, isModifyQuery, isPreparedUsingTempStorage, mergeChangesIntoSharedCache, setCacheUsage, setExpressionBuilder, setIsPreparedUsingTempStorage, setReferenceClass, setReferenceClassName, setShouldDeferExecutionInUOW, shouldDeferExecutionInUOW |
| Methods inherited from class org.eclipse.persistence.queries.ModifyQuery |
|---|
forceBatchStatementExecution, getModifyRow, setForceBatchStatementExecution, setModifyRow |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public DeleteAllQuery()
public DeleteAllQuery(java.lang.Class referenceClass)
public DeleteAllQuery(java.lang.Class referenceClass,
Expression selectionCriteria)
| Method Detail |
|---|
public boolean isInMemoryOnly()
public void setIsInMemoryOnly(boolean isInMemoryOnly)
public boolean isDeleteAllQuery()
isDeleteAllQuery in class DatabaseQuery
public java.lang.Object executeInUnitOfWork(org.eclipse.persistence.internal.sessions.UnitOfWorkImpl unitOfWork,
org.eclipse.persistence.internal.sessions.AbstractRecord translationRow)
throws DatabaseException
executeInUnitOfWork in class ModifyAllQueryunitOfWork - - the session in which the receiver will be executed.translationRow - - the arguments
DatabaseException - - an error has occurred on the database.
public java.lang.Object executeDatabaseQuery()
throws DatabaseException
executeDatabaseQuery in class DatabaseQueryDatabaseException - - an error has occurred on the database.
public void executeDeleteAll(org.eclipse.persistence.internal.sessions.AbstractSession session,
org.eclipse.persistence.internal.sessions.AbstractRecord translationRow,
java.util.Vector objects)
throws DatabaseException
DatabaseExceptionpublic java.util.List<java.lang.Object> getObjects()
public void setObjects(java.util.List<java.lang.Object> objectCollection)
List objects used as an indicator of one of two possible ways the query may behave:
objects != null - the "old" functionality used by OneToMany mapping objects deleted from the cache, either selection expression or custom sql should be provided for deletion from db;
objects == null - the "new" functionality (on par with UpdateAllQuery) the cache is either left alone or in-memory query finds the cached objects to be deleted, and these objects are invalidated in cache.
Note that empty objects is still objects != case. Signal that no cache altering is required. Used by AggregationCollectionMapping and OneToManyMapping in case they use indirection and the ValueHolder has not been instantiated.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||