Search in sources :

Example 1 with ChildDiffLoader

use of org.apache.cayenne.graph.ChildDiffLoader in project cayenne by apache.

the class DataContext method onContextFlush.

@Override
protected GraphDiff onContextFlush(ObjectContext originatingContext, GraphDiff changes, boolean cascade) {
    boolean childContext = this != originatingContext && changes != null;
    try {
        if (childContext) {
            getObjectStore().childContextSyncStarted();
            changes.apply(new ChildDiffLoader(this));
            fireDataChannelChanged(originatingContext, changes);
        }
        return (cascade) ? flushToParent(true) : new CompoundDiff();
    } finally {
        if (childContext) {
            getObjectStore().childContextSyncStopped();
        }
    }
}
Also used : ChildDiffLoader(org.apache.cayenne.graph.ChildDiffLoader) CompoundDiff(org.apache.cayenne.graph.CompoundDiff)

Aggregations

ChildDiffLoader (org.apache.cayenne.graph.ChildDiffLoader)1 CompoundDiff (org.apache.cayenne.graph.CompoundDiff)1