/** * Iterates over diffs list, calling "apply" on each individual diff. */ public void apply(GraphChangeHandler tracker) { if (diffs == null) { return; } // implements a naive linear commit - simply replay stored operations for (GraphDiff change : diffs) { change.apply(tracker); } }
/** * Iterates over diffs list in reverse order, calling "apply" on each individual diff. */ public void undo(GraphChangeHandler tracker) { if (diffs == null) { return; } ListIterator it = diffs.listIterator(diffs.size()); while (it.hasPrevious()) { GraphDiff change = (GraphDiff) it.previous(); change.undo(tracker); } }
/** * Returns true if this diff has no other diffs or if all of its diffs are * noops. */ public boolean isNoop() { if (diffs == null || diffs.isEmpty()) { return true; } for (GraphDiff diff : diffs) { if (!diff.isNoop()) { return false; } } return true; }
/** * Returns true if this diff has no other diffs or if all of its diffs are noops. */ public boolean isNoop() { if (diffs == null || diffs.isEmpty()) { return true; } Iterator it = diffs.iterator(); while (it.hasNext()) { if (!((GraphDiff) it.next()).isNoop()) { return false; } } return true; }
public void run() { diff.apply(CayenneContextMergeHandler.this); } });
/** * Iterates over diffs list in reverse order, calling "apply" on each * individual diff. */ public void undo(GraphChangeHandler tracker) { if (diffs == null) { return; } ListIterator<GraphDiff> it = diffs.listIterator(diffs.size()); while (it.hasPrevious()) { GraphDiff change = it.previous(); change.undo(tracker); } }
public void run() { diff.apply(CayenneContextMergeHandler.this); } });
@Override public void undo(GraphChangeHandler handler) { resolveDiff(); resolvedDiff.undo(handler); }
if (!returnChanges.isNoop()) { fireDataChannelCommitted(getChannel(), returnChanges);
/** * Iterates over diffs list, calling "apply" on each individual diff. */ public void apply(GraphChangeHandler tracker) { if (diffs == null) { return; } // implements a naive linear commit - simply replay stored operations Iterator it = diffs.iterator(); while (it.hasNext()) { GraphDiff change = (GraphDiff) it.next(); change.apply(tracker); } }
public void undo(GraphChangeHandler handler) { resolveDiff(); resolvedDiff.undo(handler); }
@Override public void apply(final GraphChangeHandler handler) { if (otherDiffs != null) { for (final GraphDiff diff : otherDiffs) { diff.apply(handler); } } // phantomFks are not in 'otherDiffs', while flattened diffs are if (phantomFks != null) { for (GraphDiff diff : phantomFks.keySet()) { diff.apply(handler); } } applySimplePropertyChanges(handler); }
void graphReverted() { GraphDiff diff = changeLog.getDiffs(); diff.undo(new RollbackChangeHandler()); stateLog.graphReverted(); reset(); if (lifecycleEventsEnabled) { context.fireDataChannelRolledback(context, diff); } }
public void apply(final GraphChangeHandler handler) { if (otherDiffs != null) { Iterator it = otherDiffs.iterator(); while (it.hasNext()) { ((GraphDiff) it.next()).apply(handler); } } applySimplePropertyChanges(handler); }
void graphReverted() { GraphDiff diff = changeLog.getDiffs(); diff.undo(new NullChangeHandler()); stateLog.graphReverted(); reset(); if (lifecycleEventsEnabled) { send(diff, DataChannel.GRAPH_ROLLEDBACK_SUBJECT, context); } }