@Override public void visit(DescendantNode descendant) { symbols.add(descendant.getSelectorName()); }
/** * {@inheritDoc} * * @see QueryObjectModelVisitor#visit(DescendantNode) */ public void visit(DescendantNode descendant) { append("ISDESCENDANTNODE("); append(descendant.getSelectorName()); append(','); append(descendant.getAncestorPath()); append(')'); }
/** * Define a constraint clause that the node within the named table is a * descendant of the node at the supplied path. * * @param descendantTable * the name of the table; may not be null and must refer to a * valid name or alias of a table appearing in the FROM clause * @param ancestorPath * the path to the ancestor node * @return the constraint builder that was used to create this clause; * never null */ public ConstraintBuilder isBelowPath(String descendantTable, String ancestorPath) { return setConstraint(new DescendantNode(selector(descendantTable), ancestorPath)); }
/** * @see org.xcmis.search.QueryObjectModelVisitor#visit(org.xcmis.search.model.constraint.DescendantNode) */ public void visit(DescendantNode node) throws VisitException { String parentPath = node.getAncestorPath(); if (parentPath.charAt(0) == '[') { //uuid based absolute path Query parentQuery = new TermQuery(new Term(FieldNames.UUID, parentPath.substring(1, parentPath.length() - 1))); Query childNodeQuery = new ChildTraversingQueryNode(parentQuery, true); queryBuilderStack.push(childNodeQuery); } else { final Object[] entries = pathSplitter.splitPath(parentPath); Query descendantQuery = new TermQuery(new Term(FieldNames.UUID, indexConfiguration.getRootUuid())); for (int i = 1; i < entries.length; i++) { final String stepName = nameConverter.convertName(entries[i]); final Query nameQuery = new TermQuery(new Term(FieldNames.LABEL, stepName)); descendantQuery = new DescendantQueryNode(nameQuery, descendantQuery); } // all childs descendantQuery = new ChildTraversingQueryNode(descendantQuery, true); queryBuilderStack.push(descendantQuery); } }
throw new TreeWalkerException("There is more than one table. Use selector or table name. IN_TREE.."); res = new DescendantNode(selName, builder.toString());
/** * @see org.xcmis.search.Visitors.AbstractModelVisitor#visit(org.xcmis.search.model.constraint.DescendantNode) */ @Override public void visit(DescendantNode node) throws VisitException { checkSelectorExistance(node.getSelectorName()); }