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
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static class -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final DataDomainprotected final DbRowOpSorterprotected final JdbcEventLoggerprotected final OperationObserver -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDefaultDataDomainFlushAction(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 voidcreateReplacementIds(ObjectStore store, CompoundDiff afterCommitDiff, List<DbRowOp> dbRowOps) Set finalObjectIdfor persistent objectsprotected voidexecuteQueries(List<? extends Query> queries) Execute queries, grouping them by nodesflush(DataContext context, GraphDiff changes) mergeSameObjectIds(List<DbRowOp> dbRowOps) protected voidpostprocess(DataContext context, ObjectStoreGraphDiff changes, CompoundDiff afterCommitDiff, List<DbRowOp> dbRowOps) NotifyObjectStoreand it's data row cache about actual changes we performed.Sort all operationsprotected voidupdateObjectIds(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:
flushin 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 finalObjectIdfor persistent objects- Parameters:
store- object storeafterCommitDiff- result graph diffdbRowOps- collection ofDbRowOp
-
postprocess
protected void postprocess(DataContext context, ObjectStoreGraphDiff changes, CompoundDiff afterCommitDiff, List<DbRowOp> dbRowOps) NotifyObjectStoreand it's data row cache about actual changes we performed.- Parameters:
context- originating contextchanges- incoming diffafterCommitDiff- resulting diffdbRowOps- collection ofDbRowOp
-