Search in sources :

Example 71 with QueryObjectModel

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);
}
Also used : QueryObjectModel(javax.jcr.query.qom.QueryObjectModel) Source(javax.jcr.query.qom.Source) Selector(javax.jcr.query.qom.Selector)

Example 72 with QueryObjectModel

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);
}
Also used : QueryObjectModel(javax.jcr.query.qom.QueryObjectModel) Selector(javax.jcr.query.qom.Selector)

Example 73 with QueryObjectModel

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 } });
}
Also used : QueryObjectModel(javax.jcr.query.qom.QueryObjectModel)

Example 74 with QueryObjectModel

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 } });
}
Also used : QueryObjectModel(javax.jcr.query.qom.QueryObjectModel)

Example 75 with QueryObjectModel

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 } });
}
Also used : QueryObjectModel(javax.jcr.query.qom.QueryObjectModel)

Aggregations

QueryObjectModel (javax.jcr.query.qom.QueryObjectModel)78 Value (javax.jcr.Value)18 Node (javax.jcr.Node)17 JoinCondition (javax.jcr.query.qom.JoinCondition)13 Selector (javax.jcr.query.qom.Selector)10 Query (javax.jcr.query.Query)8 RepositoryException (javax.jcr.RepositoryException)7 Column (javax.jcr.query.qom.Column)7 Ordering (javax.jcr.query.qom.Ordering)7 Source (javax.jcr.query.qom.Source)7 PropertyExistence (javax.jcr.query.qom.PropertyExistence)6 QueryResult (javax.jcr.query.QueryResult)5 RowIterator (javax.jcr.query.RowIterator)5 PropertyValue (javax.jcr.query.qom.PropertyValue)5 ArrayList (java.util.ArrayList)4 NodeType (javax.jcr.nodetype.NodeType)4 NodeTypeManager (javax.jcr.nodetype.NodeTypeManager)4 InvalidQueryException (javax.jcr.query.InvalidQueryException)4 Constraint (javax.jcr.query.qom.Constraint)4 NodeTypeIterator (javax.jcr.nodetype.NodeTypeIterator)3