Class DbOperationManager
java.lang.Object
org.camunda.bpm.engine.impl.db.entitymanager.operation.DbOperationManager
Manages a set of
database operations.- Author:
- Daniel Meyer
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic Comparator<DbBulkOperation>bulk modifications (DELETE, UPDATE) on an entity collectionbulk modifications (DELETE, UPDATE) for which order of execution is importantDELETEs of a single entitystatic Comparator<DbEntityOperation>static Comparator<Class<?>>INSERTsstatic Comparator<DbEntityOperation>static Comparator<Class<?>>UPDATEs of a single entity -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddOperation(DbBulkOperation newOperation) booleanaddOperation(DbEntityOperation newOperation) booleanaddOperationPreserveOrder(DbBulkOperation newOperation) protected voidaddSortedInserts(List<DbOperation> flush) Adds the insert operations to the flush (in correct order).protected voidaddSortedModifications(List<DbOperation> flush) Adds a correctly ordered list of UPDATE and DELETE operations to the flush.protected voidaddSortedModificationsForType(Class<?> type, SortedSet<DbEntityOperation> preSortedOperations, List<DbOperation> flush) protected voiddetermineDependencies(List<DbOperation> flush) protected SortedSet<DbEntityOperation>getDeletesByType(Class<? extends DbEntity> type, boolean create) protected SortedSet<DbEntityOperation>getInsertsForType(Class<? extends DbEntity> type, boolean create) protected SortedSet<DbEntityOperation>getUpdatesByType(Class<? extends DbEntity> type, boolean create) protected List<DbEntityOperation>sortByReferences(SortedSet<DbEntityOperation> preSorted) Assumptions: a) all operations in the set work on entities such that the entities implementHasDbReferences.
-
Field Details
-
INSERT_TYPE_COMPARATOR
-
MODIFICATION_TYPE_COMPARATOR
-
INSERT_OPERATION_COMPARATOR
-
MODIFICATION_OPERATION_COMPARATOR
-
BULK_OPERATION_COMPARATOR
-
inserts
INSERTs -
updates
UPDATEs of a single entity -
deletes
DELETEs of a single entity -
bulkOperations
bulk modifications (DELETE, UPDATE) on an entity collection -
bulkOperationsInsertionOrder
bulk modifications (DELETE, UPDATE) for which order of execution is important
-
-
Constructor Details
-
DbOperationManager
public DbOperationManager()
-
-
Method Details
-
addOperation
-
getDeletesByType
protected SortedSet<DbEntityOperation> getDeletesByType(Class<? extends DbEntity> type, boolean create) -
getUpdatesByType
protected SortedSet<DbEntityOperation> getUpdatesByType(Class<? extends DbEntity> type, boolean create) -
getInsertsForType
protected SortedSet<DbEntityOperation> getInsertsForType(Class<? extends DbEntity> type, boolean create) -
addOperation
-
addOperationPreserveOrder
-
calculateFlush
-
addSortedInserts
Adds the insert operations to the flush (in correct order).- Parameters:
operationsForFlush-
-
addSortedModifications
Adds a correctly ordered list of UPDATE and DELETE operations to the flush.- Parameters:
flush-
-
addSortedModificationsForType
protected void addSortedModificationsForType(Class<?> type, SortedSet<DbEntityOperation> preSortedOperations, List<DbOperation> flush) -
sortByReferences
Assumptions: a) all operations in the set work on entities such that the entities implementHasDbReferences. b) all operations in the set work on the same type (ie. all operations are INSERTs or DELETEs). -
determineDependencies
-