Package org.apache.cayenne.access.flush
Class DefaultDataDomainFlushAction
java.lang.Object
org.apache.cayenne.access.flush.DefaultDataDomainFlushAction
- All Implemented Interfaces:
DataDomainFlushAction
Default implementation of
DataDomainFlushAction
.- Since:
- 4.2
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
-
Field Summary
Modifier and TypeFieldDescriptionprotected final DataDomain
protected final DbRowOpSorter
protected final JdbcEventLogger
protected final OperationObserver
-
Constructor Summary
ModifierConstructorDescriptionprotected
DefaultDataDomainFlushAction
(DataDomain dataDomain, DbRowOpSorter dbRowOpSorter, JdbcEventLogger jdbcEventLogger) -
Method Summary
Modifier and TypeMethodDescriptioncreateDbRowOps
(ObjectStore objectStore, ObjectStoreGraphDiff changes) Create ops based on incoming graph changescreateQueries
(List<DbRowOp> dbRowOps) protected void
createReplacementIds
(ObjectStore store, CompoundDiff afterCommitDiff, List<DbRowOp> dbRowOps) Set finalObjectId
for persistent objectsprotected void
executeQueries
(List<? extends Query> queries) Execute queries, grouping them by nodesflush
(DataContext context, GraphDiff changes) mergeSameObjectIds
(List<DbRowOp> dbRowOps) protected void
postprocess
(DataContext context, ObjectStoreGraphDiff changes, CompoundDiff afterCommitDiff, List<DbRowOp> dbRowOps) NotifyObjectStore
and it's data row cache about actual changes we performed.Sort all operationsprotected void
updateObjectIds
(Collection<DbRowOp> dbRowOps) Fill in replacement IDs' data for given operations
-
Field Details
-
dataDomain
-
dbRowOpSorter
-
jdbcEventLogger
-
observer
-
-
Constructor Details
-
DefaultDataDomainFlushAction
protected DefaultDataDomainFlushAction(DataDomain dataDomain, DbRowOpSorter dbRowOpSorter, JdbcEventLogger jdbcEventLogger)
-
-
Method Details
-
flush
- Specified by:
flush
in interfaceDataDomainFlushAction
-
createDbRowOps
Create ops based on incoming graph changes- Parameters:
objectStore
- originating object storechanges
- object graph diff- Returns:
- collection of
DbRowOp
-
updateObjectIds
Fill in replacement IDs' data for given operations- Parameters:
dbRowOps
- collection ofDbRowOp
-
mergeSameObjectIds
- Parameters:
dbRowOps
- collection ofDbRowOp
- Returns:
- collection of ops with merged duplicates
-
filterOps
-
sort
Sort all operations- Parameters:
dbRowOps
- collection ofDbRowOp
- Returns:
- sorted collection of operations
- See Also:
-
createQueries
-
executeQueries
Execute queries, grouping them by nodes- Parameters:
queries
- to execute
-
createReplacementIds
protected void createReplacementIds(ObjectStore store, CompoundDiff afterCommitDiff, List<DbRowOp> dbRowOps) Set finalObjectId
for persistent objects- Parameters:
store
- object storeafterCommitDiff
- result graph diffdbRowOps
- collection ofDbRowOp
-
postprocess
protected void postprocess(DataContext context, ObjectStoreGraphDiff changes, CompoundDiff afterCommitDiff, List<DbRowOp> dbRowOps) NotifyObjectStore
and it's data row cache about actual changes we performed.- Parameters:
context
- originating contextchanges
- incoming diffafterCommitDiff
- resulting diffdbRowOps
- collection ofDbRowOp
-