@Override public void finishPrefetch(PrefetchTreeNode node) { // now that all the children are processed, we can clear the dupes // TODO: see TODO in ObjectResolver.relatedObjectsFromDataRows if ((node.isDisjointPrefetch() || node.isDisjointByIdPrefetch()) && !needToSaveDuplicates) { PrefetchProcessorNode processorNode = (PrefetchProcessorNode) node; if (processorNode.isJointChildren()) { List<Persistent> objects = processorNode.getObjects(); if (objects != null && objects.size() > 1) { Set<Persistent> seen = new HashSet<Persistent>(objects.size()); Iterator<Persistent> it = objects.iterator(); while (it.hasNext()) { if (!seen.add(it.next())) { it.remove(); } } } } } } }
/** * Traverses the tree depth-first, invoking callback methods of the processor when * passing through the nodes. */ public void traverse(PrefetchProcessor processor) { boolean result = false; if (isPhantom()) { result = processor.startPhantomPrefetch(this); } else if (isDisjointPrefetch()) { result = processor.startDisjointPrefetch(this); } else if (isJointPrefetch()) { result = processor.startJointPrefetch(this); } else { result = processor.startUnknownPrefetch(this); } // process children unless processing is blocked... if (result && children != null) { Iterator it = children.iterator(); while (it.hasNext()) { ((PrefetchTreeNode) it.next()).traverse(processor); } } // call finish regardless of whether children were processed processor.finishPrefetch(this); }
while (jointRoot.getParent() != null && !jointRoot.isDisjointPrefetch()) { jointRoot = jointRoot.getParent();
/** * Traverses the tree depth-first, invoking callback methods of the * processor when passing through the nodes. */ public void traverse(PrefetchProcessor processor) { boolean result = false; if (isPhantom()) { result = processor.startPhantomPrefetch(this); } else if (isDisjointPrefetch()) { result = processor.startDisjointPrefetch(this); } else if (isDisjointByIdPrefetch()) { result = processor.startDisjointByIdPrefetch(this); } else if (isJointPrefetch()) { result = processor.startJointPrefetch(this); } else { result = processor.startUnknownPrefetch(this); } // process children unless processing is blocked... if (result && children != null) { for (PrefetchTreeNode child : children) { child.traverse(processor); } } // call finish regardless of whether children were processed processor.finishPrefetch(this); }
while (jointRoot.getParent() != null && !jointRoot.isDisjointPrefetch() && !jointRoot.isDisjointByIdPrefetch()) { jointRoot = jointRoot.getParent();