public class ActionQueue extends Object
Constructor and Description |
---|
ActionQueue(SessionImplementor session)
Constructs an action queue bound to the given session.
|
Modifier and Type | Method and Description |
---|---|
void |
addAction(BulkOperationCleanupAction cleanupAction) |
void |
addAction(CollectionRecreateAction action) |
void |
addAction(CollectionRemoveAction action) |
void |
addAction(CollectionUpdateAction action) |
void |
addAction(EntityDeleteAction action) |
void |
addAction(EntityIdentityInsertAction insert) |
void |
addAction(EntityInsertAction action) |
void |
addAction(EntityUpdateAction action) |
void |
afterTransactionCompletion(boolean success)
Performs cleanup of any held cache softlocks.
|
boolean |
areInsertionsOrDeletionsQueued()
Check whether any insertion or deletion actions are currently queued.
|
boolean |
areTablesToBeUpdated(Set tables)
Check whether the given tables/query-spaces are to be executed against
given the currently queued actions.
|
void |
beforeTransactionCompletion()
Execute any registered
BeforeTransactionCompletionProcess |
void |
checkNoUnresolvedActionsAfterOperation()
Throws
PropertyValueException if there are any unresolved
entity insert actions that depend on non-nullable associations with
a transient entity. |
void |
clear() |
void |
clearFromFlushNeededCheck(int previousCollectionRemovalSize) |
ArrayList |
cloneDeletions() |
static ActionQueue |
deserialize(ObjectInputStream ois,
SessionImplementor session)
Used by the owning session to explicitly control deserialization of the
action queue
|
void |
execute(Executable executable) |
void |
executeActions()
Perform all currently queued actions.
|
void |
executeInserts()
Perform all currently queued entity-insertion actions.
|
boolean |
hasAfterTransactionActions() |
boolean |
hasAnyQueuedActions() |
boolean |
hasBeforeTransactionActions() |
boolean |
hasUnresolvedEntityInsertActions()
Are there unresolved entity insert actions that depend on non-nullable
associations with a transient entity?
|
int |
numberOfCollectionCreations() |
int |
numberOfCollectionRemovals() |
int |
numberOfCollectionUpdates() |
int |
numberOfDeletions() |
int |
numberOfInsertions() |
int |
numberOfUpdates() |
void |
prepareActions()
Prepares the internal action queues for execution.
|
void |
registerProcess(AfterTransactionCompletionProcess process) |
void |
registerProcess(BeforeTransactionCompletionProcess process) |
void |
serialize(ObjectOutputStream oos)
Used by the owning session to explicitly control serialization of the
action queue
|
void |
sortActions() |
void |
sortCollectionActions() |
String |
toString()
Returns a string representation of the object.
|
void |
unScheduleDeletion(EntityEntry entry,
Object rescuedEntity) |
public ActionQueue(SessionImplementor session)
session
- The session "owning" this queue.public void clear()
public void addAction(EntityInsertAction action)
public void addAction(EntityDeleteAction action)
public void addAction(EntityUpdateAction action)
public void addAction(CollectionRecreateAction action)
public void addAction(CollectionRemoveAction action)
public void addAction(CollectionUpdateAction action)
public void addAction(EntityIdentityInsertAction insert)
public boolean hasUnresolvedEntityInsertActions()
public void checkNoUnresolvedActionsAfterOperation() throws PropertyValueException
PropertyValueException
if there are any unresolved
entity insert actions that depend on non-nullable associations with
a transient entity. This method should be called on completion of
an operation (after all cascades are completed) that saves an entity.PropertyValueException
- if there are any unresolved entity
insert actions; PropertyValueException.getEntityName()
and PropertyValueException.getPropertyName()
will
return the entity name and property value for the first unresolved
entity insert action.public void addAction(BulkOperationCleanupAction cleanupAction)
public void registerProcess(AfterTransactionCompletionProcess process)
public void registerProcess(BeforeTransactionCompletionProcess process)
public void executeInserts() throws HibernateException
HibernateException
- error executing queued insertion actions.public void executeActions() throws HibernateException
HibernateException
- error executing queued actions.public void prepareActions() throws HibernateException
HibernateException
- error preparing actions.public void afterTransactionCompletion(boolean success)
success
- Was the transaction successful.public void beforeTransactionCompletion()
BeforeTransactionCompletionProcess
public boolean areTablesToBeUpdated(Set tables)
tables
- The table/query-spaces to check.public boolean areInsertionsOrDeletionsQueued()
public void execute(Executable executable)
public String toString()
public int numberOfCollectionRemovals()
public int numberOfCollectionUpdates()
public int numberOfCollectionCreations()
public int numberOfDeletions()
public int numberOfUpdates()
public int numberOfInsertions()
public void sortCollectionActions()
public void sortActions()
public ArrayList cloneDeletions()
public void clearFromFlushNeededCheck(int previousCollectionRemovalSize)
public boolean hasAfterTransactionActions()
public boolean hasBeforeTransactionActions()
public boolean hasAnyQueuedActions()
public void unScheduleDeletion(EntityEntry entry, Object rescuedEntity)
public void serialize(ObjectOutputStream oos) throws IOException
oos
- The stream to which the action queue should get writtenIOException
- Indicates an error writing to the streampublic static ActionQueue deserialize(ObjectInputStream ois, SessionImplementor session) throws IOException, ClassNotFoundException
ois
- The stream from which to read the action queuesession
- The session to which the action queue belongsIOException
- indicates a problem reading from the streamClassNotFoundException
- Generally means we were unable to locate user classes.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.