Package org.hibernate.action.internal
Class BulkOperationCleanupAction
- java.lang.Object
-
- org.hibernate.action.internal.BulkOperationCleanupAction
-
- All Implemented Interfaces:
Serializable,Executable
public class BulkOperationCleanupAction extends Object implements Executable, Serializable
AnActionQueueExecutablefor ensuring shared cache cleanup in relation to performed bulk HQL queries.- See Also:
- Serialized Form
- Implementation Note:
- Currently this executes for
INSERTqueries as well asUPDATEandDELETEqueries. ForINSERTit is really not needed as we'd have no invalid entity/collection data to clean up (we'd still need to invalidate the appropriate update-timestamps regions) as a result of this query.
-
-
Constructor Summary
Constructors Constructor Description BulkOperationCleanupAction(SharedSessionContractImplementor session, Set<String> tableSpaces)Constructs an action to cleanup "affected cache regions" based on a set of affected table spaces.BulkOperationCleanupAction(SharedSessionContractImplementor session, EntityPersister... affectedQueryables)Constructs an action to cleanup "affected cache regions" based on the affected entity persisters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterDeserialize(EventSource session)Reconnect to session after deserializationvoidbeforeExecutions()Called before executing any actions.voidexecute()Execute this action.AfterTransactionCompletionProcessgetAfterTransactionCompletionProcess()Get the after-transaction-completion process, if any, for this action.BeforeTransactionCompletionProcessgetBeforeTransactionCompletionProcess()Get the before-transaction-completion process, if any, for this action.String[]getPropertySpaces()What spaces (tables) are affected by this action?static voidschedule(SharedSessionContractImplementor session, Set<String> affectedQueryables)static voidschedule(SharedSessionContractImplementor session, EntityPersister... affectedQueryables)static voidschedule(SharedSessionContractImplementor session, SqmDmlStatement<?> statement)
-
-
-
Constructor Detail
-
BulkOperationCleanupAction
public BulkOperationCleanupAction(SharedSessionContractImplementor session, EntityPersister... affectedQueryables)
Constructs an action to cleanup "affected cache regions" based on the affected entity persisters. The affected regions are defined as the region (if any) of the entity persisters themselves, plus the collection regions for any collection in which those entity persisters participate as elements/keys/etc.- Parameters:
session- The session to which this request is tied.affectedQueryables- The affected entity persisters.
-
BulkOperationCleanupAction
public BulkOperationCleanupAction(SharedSessionContractImplementor session, Set<String> tableSpaces)
Constructs an action to cleanup "affected cache regions" based on a set of affected table spaces. This differs fromBulkOperationCleanupAction(SharedSessionContractImplementor, EntityPersister[])in that here we have the affected table names. From those we deduce the entity persisters which are affected based on the definedtable spaces. Finally, we determine the affected collection regions based on any collections in which those entity persisters participate as elements/keys/etc.- Parameters:
session- The session to which this request is tied.tableSpaces- The table spaces.
-
-
Method Detail
-
schedule
public static void schedule(SharedSessionContractImplementor session, SqmDmlStatement<?> statement)
-
schedule
public static void schedule(SharedSessionContractImplementor session, EntityPersister... affectedQueryables)
-
schedule
public static void schedule(SharedSessionContractImplementor session, Set<String> affectedQueryables)
-
getPropertySpaces
public String[] getPropertySpaces()
Description copied from interface:ExecutableWhat spaces (tables) are affected by this action?- Specified by:
getPropertySpacesin interfaceExecutable- Returns:
- The spaces affected by this action.
-
getBeforeTransactionCompletionProcess
public BeforeTransactionCompletionProcess getBeforeTransactionCompletionProcess()
Description copied from interface:ExecutableGet the before-transaction-completion process, if any, for this action.- Specified by:
getBeforeTransactionCompletionProcessin interfaceExecutable- Returns:
- The before-transaction-completion process, or null if we have no before-transaction-completion process
-
getAfterTransactionCompletionProcess
public AfterTransactionCompletionProcess getAfterTransactionCompletionProcess()
Description copied from interface:ExecutableGet the after-transaction-completion process, if any, for this action.- Specified by:
getAfterTransactionCompletionProcessin interfaceExecutable- Returns:
- The after-transaction-completion process, or null if we have no after-transaction-completion process
-
beforeExecutions
public void beforeExecutions() throws HibernateExceptionDescription copied from interface:ExecutableCalled before executing any actions. Gives actions a chance to perform any preparation.- Specified by:
beforeExecutionsin interfaceExecutable- Throws:
HibernateException- Indicates a problem during preparation.
-
execute
public void execute() throws HibernateExceptionDescription copied from interface:ExecutableExecute this action.- Specified by:
executein interfaceExecutable- Throws:
HibernateException- Indicates a problem during execution.
-
afterDeserialize
public void afterDeserialize(EventSource session)
Description copied from interface:ExecutableReconnect to session after deserialization- Specified by:
afterDeserializein interfaceExecutable- Parameters:
session- The session being deserialized; must be an EventSource
-
-