use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testCreateQueryFromSource.
public void testCreateQueryFromSource() throws RepositoryException {
Source selector = qf.selector(testNodeType, SELECTOR_NAME1);
QueryObjectModel qom = qf.createQuery(selector, null, null, null);
assertTrue("Not a selector source", qom.getSource() instanceof Selector);
assertNull("Constraint must be null", qom.getConstraint());
assertEquals("Wrong size of orderings", 0, qom.getOrderings().length);
assertEquals("Wrong size of columns", 0, qom.getColumns().length);
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class QueryObjectModelFactoryTest method testCreateQuery.
public void testCreateQuery() throws RepositoryException {
Selector selector = qf.selector(testNodeType, SELECTOR_NAME1);
QueryObjectModel qom = qf.createQuery(selector, null, null, null);
assertTrue("Not a selector source", qom.getSource() instanceof Selector);
assertNull("Constraint must be null", qom.getConstraint());
assertEquals("Wrong size of orderings", 0, qom.getOrderings().length);
assertEquals("Wrong size of columns", 0, qom.getColumns().length);
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class SameNodeJoinConditionTest method testInnerJoin.
public void testInnerJoin() throws RepositoryException {
QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, null);
checkQOM(qom, new Node[][] { { n1, n1 }, { n2, n2 } });
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class SameNodeJoinConditionTest method testLeftOuterJoin.
public void testLeftOuterJoin() throws RepositoryException {
QueryObjectModel qom = qf.createQuery(qf.join(qf.selector(testNodeType, LEFT), qf.selector(mixReferenceable, RIGHT), QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER, qf.sameNodeJoinCondition(LEFT, RIGHT, ".")), qf.descendantNode(LEFT, testRoot), null, null);
checkQOM(qom, new Node[][] { { n1, null }, { n2, n2 } });
}
use of javax.jcr.query.qom.QueryObjectModel in project jackrabbit by apache.
the class SameNodeJoinConditionTest method testRightOuterJoin.
public void testRightOuterJoin() throws RepositoryException {
QueryObjectModel qom = qf.createQuery(qf.join(qf.selector(mixReferenceable, LEFT), qf.selector(testNodeType, RIGHT), QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER, qf.sameNodeJoinCondition(LEFT, RIGHT, ".")), qf.descendantNode(RIGHT, testRoot), null, null);
checkQOM(qom, new Node[][] { { null, n1 }, { n2, n2 } });
}
Aggregations