## 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

An `ActionQueue` `Executable` for ensuring shared cache cleanup in relation to performed bulk HQL queries.

NOTE: currently this executes for `INSERT` queries as well as `UPDATE` and `DELETE` queries. For `INSERT` it is really not needed as we'd have no invalid entity/collection data to cleanup (we'd still nee to invalidate the appropriate update-timestamps regions) as a result of this query.

See Also:
  Serialized Form

Constructor Summary
`BulkOperationCleanupAction(SessionImplementor session, Queryable[] affectedQueryables)` Constructs an action to cleanup "affected cache regions" based on the affected entity persisters.
`BulkOperationCleanupAction(SessionImplementor session, Set tableSpaces)` Constructs an action to cleanup "affected cache regions" based on a set of affected table spaces.

Method Summary
`void` `beforeExecutions()` Called before executing any actions.
`void` `execute()` Execute this action
`AfterTransactionCompletionProcess` `getAfterTransactionCompletionProcess()` Get the after-transaction-completion process, if any, for this action.
`BeforeTransactionCompletionProcess` `getBeforeTransactionCompletionProcess()` Get the before-transaction-completion process, if any, for this action.
`Serializable[]` `getPropertySpaces()` What spaces (tables) are affected by this action?

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### BulkOperationCleanupAction

    public BulkOperationCleanupAction(SessionImplementor session,
                                      Queryable[] 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(SessionImplementor session,
                                      Set tableSpaces)

  Constructs an action to cleanup "affected cache regions" based on a set of affected table spaces. This differs from `BulkOperationCleanupAction(SessionImplementor, Queryable[])` in that here we have the affected table names. From those we deduce the entity persisters which are affected based on the defined `table spaces`; and from there, 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

### getPropertySpaces

    public Serializable[] getPropertySpaces()

  Description copied from interface: `Executable`
  What spaces (tables) are affected by this action?

  Specified by:
    `getPropertySpaces` in interface `Executable`
  Returns:
    The spaces affected by this action.

### getBeforeTransactionCompletionProcess

    public BeforeTransactionCompletionProcess getBeforeTransactionCompletionProcess()

  Description copied from interface: `Executable`
  Get the before-transaction-completion process, if any, for this action.

  Specified by:
    `getBeforeTransactionCompletionProcess` in interface `Executable`
  Returns:
    The before-transaction-completion process, or null if we have no before-transaction-completion process

### getAfterTransactionCompletionProcess

    public AfterTransactionCompletionProcess getAfterTransactionCompletionProcess()

  Description copied from interface: `Executable`
  Get the after-transaction-completion process, if any, for this action.

  Specified by:
    `getAfterTransactionCompletionProcess` in interface `Executable`
  Returns:
    The after-transaction-completion process, or null if we have no after-transaction-completion process

### beforeExecutions

    public void beforeExecutions()
                          throws HibernateException

  Description copied from interface: `Executable`
  Called before executing any actions. Gives actions a chance to perform any preparation.

  Specified by:
    `beforeExecutions` in interface `Executable`
  Throws:
    `HibernateException` - Indicates a problem during preparation.

### execute

    public void execute()
                 throws HibernateException

  Description copied from interface: `Executable`
  Execute this action

  Specified by:
    `execute` in interface `Executable`
  Throws:
    `HibernateException` - Indicates a problem during execution.

Copyright © 2001-2012 Red Hat, Inc. All Rights Reserved.