Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.QueryObjectModel.execute()


                qomBuilder.getColumns().add(factory.column("event", prop, val));               
            }
        }

        QueryObjectModel qom = qomBuilder.createQOM();
        QueryResultWrapper res = (QueryResultWrapper) qom.execute();
        return res;
    }
   
    private QueryResultWrapper doFilteredQuery(JCRSessionWrapper session, final String... constraints)
            throws RepositoryException {
View Full Code Here


                    factory.literal(session.getValueFactory().createValue(val))));
        }


        QueryObjectModel qom = qomBuilder.createQOM();
        QueryResultWrapper res = (QueryResultWrapper) qom.execute();
        return res;
    }

    private void checkResultSize(QueryResultWrapper res, final int expected) throws RepositoryException {
        // check total results
View Full Code Here

        testRootNode.save();
    }

    public void testInnerJoin() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, (String) null);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, n1}, {n2, n2}});
    }

    public void testInnerJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, nodeName2);
View Full Code Here

        checkResult(result, new Node[][]{{n1, n1}, {n2, n2}});
    }

    public void testInnerJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, nodeName2);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n2, n1}});
    }

    public void testLeftOuterJoin() throws RepositoryException {
       QueryObjectModel qom = qf.createQuery(
View Full Code Here

                       QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER,
                       qf.sameNodeJoinCondition(LEFT, RIGHT, ".")),
               qf.descendantNode(LEFT, testRoot),
               null, null);

        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, null}, {n2, n2}});
    }

    public void testLeftOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER, nodeName2);
View Full Code Here

        checkResult(result, new Node[][]{{n1, null}, {n2, n2}});
    }

    public void testLeftOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = createQomQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_LEFT_OUTER, nodeName2);
        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n1, null}, {n2, n1}});
    }

    public void testRightOuterJoin() throws RepositoryException {
        QueryObjectModel qom = qf.createQuery(
View Full Code Here

                        QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER,
                        qf.sameNodeJoinCondition(LEFT, RIGHT, ".")),
                qf.descendantNode(RIGHT, testRoot),
                null, null);

        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{null, n1}, {n2, n2}});
    }

    public void testRightOuterJoinWithPath() throws RepositoryException {
        QueryObjectModel qom = qf.createQuery(
View Full Code Here

                        QueryObjectModelConstants.JCR_JOIN_TYPE_RIGHT_OUTER,
                        qf.sameNodeJoinCondition(LEFT, RIGHT, nodeName2)),
                qf.descendantNode(RIGHT, testRoot),
                null, null);

        QueryResult result = qom.execute();
        checkResult(result, new Node[][]{{n2, n1}, {null, n2}});
    }

    //-----------------------------< utilities >--------------------------------
View Full Code Here

    public void testInnerJoin1() throws RepositoryException {
        JoinCondition c = qf.equiJoinCondition(
                LEFT, propertyName1, RIGHT, propertyName2);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkResult(qom.execute(), new Node[][]{{n1, n2}, {n2, n2}});
    }

    public void testInnerJoin2() throws RepositoryException {
        JoinCondition c = qf.equiJoinCondition(
                LEFT, propertyName2, RIGHT, propertyName1);
View Full Code Here

    public void testInnerJoin2() throws RepositoryException {
        JoinCondition c = qf.equiJoinCondition(
                LEFT, propertyName2, RIGHT, propertyName1);
        QueryObjectModel qom = createQuery(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, c);
        checkResult(qom.execute(), new Node[][]{{n2, n1}, {n2, n2}});
    }

    public void testRightOuterJoin1() throws RepositoryException {
        JoinCondition c = qf.equiJoinCondition(
                LEFT, propertyName1, RIGHT, propertyName2);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.