/** * Test case for {@link QueryObjectModelFactory#descendantNode(String, String)} */ public void testDescendantNodeWithSelector() throws RepositoryException { DescendantNode descNode = qf.descendantNode(SELECTOR_NAME1, testRootNode.getPath()); assertEquals("Wrong selector name", SELECTOR_NAME1, descNode.getSelectorName()); assertEquals("Wrong path", testRootNode.getPath(), descNode.getAncestorPath()); }
Node ancestor = session.getNode(dn.getAncestorPath()); ids.add(ancestor.getIdentifier()); while (!ids.isEmpty()) {
} else if (constraint instanceof DescendantNode) { DescendantNode dn = (DescendantNode) constraint; return Collections.singleton(dn.getSelectorName()); } else if (constraint instanceof FullTextSearch) { FullTextSearch fts = (FullTextSearch) constraint;
Node ancestor = session.getNode(dn.getAncestorPath()); ids.add(ancestor.getIdentifier()); while (!ids.isEmpty()) {
} else if (constraint instanceof DescendantNode) { DescendantNode dn = (DescendantNode) constraint; return Collections.singleton(dn.getSelectorName()); } else if (constraint instanceof FullTextSearch) { FullTextSearch fts = (FullTextSearch) constraint;
/** * Test case for {@link QueryObjectModelFactory#descendantNode(String, String)} */ public void testDescendantNode() throws RepositoryException { DescendantNode descNode = qf.descendantNode(SELECTOR_NAME1, testRootNode.getPath()); assertEquals("Wrong selector", SELECTOR_NAME1, descNode.getSelectorName()); assertEquals("Wrong path", testRootNode.getPath(), descNode.getAncestorPath()); }
Query context = getNodeIdQuery(UUID, descendantNode.getAncestorPath()); query.mainQuery = new DescendantSelfAxisQuery(context, query.subQuery, false); } else {
private void append(DescendantNode constraint) { append("ISDESCENDANTNODE("); appendName(constraint.getSelectorName()); append(", "); appendPath(constraint.getAncestorPath()); append(")"); }
Query context = getNodeIdQuery(UUID, descendantNode.getAncestorPath()); query.mainQuery = new DescendantSelfAxisQuery(context, query.subQuery, false); } else {
private void append(DescendantNode constraint) { append("ISDESCENDANTNODE("); appendName(constraint.getSelectorName()); append(", "); appendPath(constraint.getAncestorPath()); append(")"); }
private void append(DescendantNode constraint) { append("ISDESCENDANTNODE("); appendName(constraint.getSelectorName()); append(", "); appendPath(constraint.getAncestorPath()); append(")"); }
@Test public void descendantNode() throws RepositoryException { DescendantNode d = f.descendantNode("selectorName", "path"); assertEquals("selectorName", d.getSelectorName()); assertEquals("path", d.getAncestorPath()); assertEquals("ISDESCENDANTNODE([selectorName], [path])", d.toString()); assertEquals("ISDESCENDANTNODE([p])", f.descendantNode(null, "p").toString()); }