public class DbOperationManager extends Object
database operations
.Modifier and Type | Field and Description |
---|---|
static Comparator<DbBulkOperation> |
BULK_OPERATION_COMPARATOR |
SortedMap<Class<?>,SortedSet<DbBulkOperation>> |
bulkOperations
bulk modifications (DELETE, UPDATE) on an entity collection
|
SortedMap<Class<?>,SortedSet<DbEntityOperation>> |
deletes
DELETEs of a single entity
|
static Comparator<DbEntityOperation> |
INSERT_OPERATION_COMPARATOR |
static Comparator<Class<?>> |
INSERT_TYPE_COMPARATOR |
SortedMap<Class<?>,SortedSet<DbEntityOperation>> |
inserts
INSERTs
|
static Comparator<DbEntityOperation> |
MODIFICATION_OPERATION_COMPARATOR |
static Comparator<Class<?>> |
MODIFICATION_TYPE_COMPARATOR |
SortedMap<Class<?>,SortedSet<DbEntityOperation>> |
updates
UPDATEs of a single entity
|
Constructor and Description |
---|
DbOperationManager() |
Modifier and Type | Method and Description |
---|---|
boolean |
addOperation(DbBulkOperation newOperation) |
boolean |
addOperation(DbEntityOperation newOperation) |
protected void |
addSortedInserts(List<DbOperation> flush)
Adds the insert operations to the flush (in correct order).
|
protected void |
addSortedModifications(List<DbOperation> flush)
Adds a correctly ordered list of UPDATE and DELETE operations to the flush.
|
protected void |
addSortedModificationsForType(Class<?> type,
SortedSet<DbEntityOperation> preSortedOperations,
List<DbOperation> flush) |
List<DbOperation> |
calculateFlush() |
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 implement
HasDbReferences . |
public static Comparator<Class<?>> INSERT_TYPE_COMPARATOR
public static Comparator<Class<?>> MODIFICATION_TYPE_COMPARATOR
public static Comparator<DbEntityOperation> INSERT_OPERATION_COMPARATOR
public static Comparator<DbEntityOperation> MODIFICATION_OPERATION_COMPARATOR
public static Comparator<DbBulkOperation> BULK_OPERATION_COMPARATOR
public SortedMap<Class<?>,SortedSet<DbEntityOperation>> inserts
public SortedMap<Class<?>,SortedSet<DbEntityOperation>> updates
public SortedMap<Class<?>,SortedSet<DbEntityOperation>> deletes
public SortedMap<Class<?>,SortedSet<DbBulkOperation>> bulkOperations
public boolean addOperation(DbEntityOperation newOperation)
protected SortedSet<DbEntityOperation> getDeletesByType(Class<? extends DbEntity> type, boolean create)
protected SortedSet<DbEntityOperation> getUpdatesByType(Class<? extends DbEntity> type, boolean create)
protected SortedSet<DbEntityOperation> getInsertsForType(Class<? extends DbEntity> type, boolean create)
public boolean addOperation(DbBulkOperation newOperation)
public List<DbOperation> calculateFlush()
protected void addSortedInserts(List<DbOperation> flush)
operationsForFlush
- protected void addSortedModifications(List<DbOperation> flush)
flush
- protected void addSortedModificationsForType(Class<?> type, SortedSet<DbEntityOperation> preSortedOperations, List<DbOperation> flush)
protected List<DbEntityOperation> sortByReferences(SortedSet<DbEntityOperation> preSorted)
HasDbReferences
.
b) all operations in the set work on the same type (ie. all operations are INSERTs or DELETEs).Copyright © 2018. All rights reserved.