use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class NotConstraintTest method testNot.
public void testNot() throws RepositoryException {
Node n1 = testRootNode.addNode(nodeName1, testNodeType);
n1.setProperty(propertyName1, "foo");
Node n2 = testRootNode.addNode(nodeName2, testNodeType);
n2.setProperty(propertyName2, "bar");
superuser.save();
QueryObjectModel qom = qf.createQuery(qf.selector(testNodeType, "s"), qf.and(qf.descendantNode("s", testRootNode.getPath()), qf.not(qf.propertyExistence("s", propertyName1))), null, null);
checkQOM(qom, new Node[] { n2 });
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class OrConstraintTest method testOr.
public void testOr() throws RepositoryException {
Node n1 = testRootNode.addNode(nodeName1, testNodeType);
n1.setProperty(propertyName1, "foo");
Node n2 = testRootNode.addNode(nodeName2, testNodeType);
n2.setProperty(propertyName2, "bar");
superuser.save();
QueryObjectModel qom = qf.createQuery(qf.selector(testNodeType, "s"), qf.and(qf.descendantNode("s", testRootNode.getPath()), qf.or(qf.propertyExistence("s", propertyName1), qf.propertyExistence("s", propertyName2))), null, null);
checkQOM(qom, new Node[] { n1, n2 });
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class OrderingTest method createQuery.
protected QueryObjectModel createQuery(Ordering[] orderings) throws RepositoryException {
JoinCondition c = qf.equiJoinCondition(LEFT, propertyName1, RIGHT, propertyName2);
QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
return qf.createQuery(qom.getSource(), qom.getConstraint(), orderings, qom.getColumns());
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class PropertyExistenceTest method testPropertyExistence.
public void testPropertyExistence() throws RepositoryException {
Node n1 = testRootNode.addNode(nodeName1, testNodeType);
n1.setProperty(propertyName1, "abc");
Node n2 = testRootNode.addNode(nodeName2, testNodeType);
n2.setProperty(propertyName2, "abc");
superuser.save();
QueryObjectModel qom = qf.createQuery(qf.selector(testNodeType, "s"), qf.and(qf.childNode("s", testRoot), qf.propertyExistence("s", propertyName1)), null, null);
checkQOM(qom, new Node[] { n1 });
qom = qf.createQuery(qf.selector(testNodeType, "s"), qf.and(qf.childNode("s", testRoot), qf.propertyExistence("s", propertyName2)), null, null);
checkQOM(qom, new Node[] { n2 });
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class EquiJoinConditionTest method testRightOuterJoin2.
public void testRightOuterJoin2() throws RepositoryException {
JoinCondition c = qf.equiJoinCondition(LEFT, propertyName2, RIGHT, propertyName1);
QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER, c);
checkQOM(qom, new Node[][] { { n2, n1 }, { n2, n2 } });
}
Aggregations