示例#1
0
 /**
  * Creates a new child node join condition.
  *
  * @param parent the inner query hits.
  * @param reader the index reader.
  * @param resolver the hierarchy resolver.
  * @param condition the QOM child node join condition.
  * @throws IOException if an error occurs while reading from the index.
  */
 public ChildNodeJoin(
     MultiColumnQueryHits parent,
     IndexReader reader,
     HierarchyResolver resolver,
     ChildNodeJoinConditionImpl condition)
     throws IOException {
   super(parent);
   this.reader = reader;
   this.resolver = resolver;
   int idx = getIndex(parent, condition.getParentSelectorQName());
   ScoreNode[] nodes;
   while ((nodes = parent.nextScoreNodes()) != null) {
     Integer docNum = nodes[idx].getDoc(reader);
     parentIndex.addScoreNodes(docNum, nodes);
   }
 }
 /**
  * Creates an ancestor path node join.
  *
  * @param context the inner query hits.
  * @param contextSelectorName the selector name for the inner query hits.
  * @param relPath the relative path of the join condition.
  * @param hmgr the hierarchy manager of the workspace.
  * @throws IOException if an error occurs while reading from the index.
  */
 public AncestorPathNodeJoin(
     MultiColumnQueryHits context, Name contextSelectorName, Path relPath, HierarchyManager hmgr)
     throws IOException {
   super(context);
   this.hmgr = hmgr;
   this.relPath = relPath;
   int idx = getIndex(context, contextSelectorName);
   ScoreNode[] nodes;
   while ((nodes = context.nextScoreNodes()) != null) {
     try {
       Path p = hmgr.getPath(nodes[idx].getNodeId());
       contextIndex.addScoreNodes(p, nodes);
     } catch (RepositoryException e) {
       // ignore
     }
   }
 }