Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.Source


        assertEquals("Wrong size of orderings", 1, qom.getOrderings().length);
        assertEquals("Wrong size of columns", 0, qom.getColumns().length);
    }

    public void testCreateQueryFromSourceWithConstraintOrderingAndColumn() throws RepositoryException {
        Source selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qf.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qf.ascending(propValue);
        Column column = qf.column(SELECTOR_NAME1, propertyName1, propertyName1);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
View Full Code Here


        read();
        read("SELECT");
        int columnParseIndex = parseIndex;
        ArrayList<ColumnOrWildcard> list = parseColumns();
        read("FROM");
        Source source = parseSource();
        Column[] columnArray = resolveColumns(columnParseIndex, list);
        Constraint constraint = null;
        if (readIf("WHERE")) {
            constraint = parseConstraint();
        }
View Full Code Here

    }

    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            JoinType type;
            if (readIf("RIGHT")) {
                read("OUTER");
                type = JoinType.RIGHT;
View Full Code Here

        assertEquals("selectorName", x.getSelectorName());
    }

    @Test
    public void join() throws RepositoryException {
        Source left = f.selector("nodeTypeName", "selectorName");
        Source right = f.selector("nodeTypeName2", "selectorName2");
        ChildNodeJoinCondition jc = f.childNodeJoinCondition("childSelectorName", "parentSelectorName");
        Join j = f.join(left, right, QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, jc);
        assertEquals(left, j.getLeft());
        assertEquals(right, j.getRight());
        assertEquals(QueryObjectModelConstants.JCR_JOIN_TYPE_INNER, j.getJoinType());
View Full Code Here

     *
     * @throws Exception
     */
    public void testGetChildrenApiDirect() throws Exception {
        QueryObjectModelFactory qomf = qm.getQOMFactory();
        Source source1 = qomf.selector(NodeType.NT_BASE, "selector");
        Column[] columns = new Column[] { qomf.column("selector", null, null) };
        Constraint constraint2 = qomf.childNode("selector", n1.getPath());
        QueryObjectModel qom = qomf.createQuery(source1, constraint2, null,
                columns);
        checkResult(qom.execute(), 2);
View Full Code Here

     * @throws Exception
     */
    public void testGetChildrenApiStatement() throws Exception {

        QueryObjectModelFactory qomf = qm.getQOMFactory();
        Source source1 = qomf.selector(NodeType.NT_BASE, "selector");
        Column[] columns = new Column[] { qomf.column("selector", null, null) };
        Constraint constraint2 = qomf.childNode("selector", n1.getPath());
        QueryObjectModel qom = qomf.createQuery(source1, constraint2, null,
                columns);
        checkResult(executeSQL2Query(qom.getStatement()), 2);
View Full Code Here

        bindVariables = new HashMap<String, BindVariableValue>();
        read();
        read("SELECT");
        ArrayList<ColumnOrWildcard> list = parseColumns();
        read("FROM");
        Source source = parseSource();
        Column[] columnArray = resolveColumns(list);
        Constraint constraint = null;
        if (readIf("WHERE")) {
            constraint = parseConstraint();
        }
View Full Code Here

    }

    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            JoinType type;
            if (readIf("RIGHT")) {
                read("OUTER");
                type = JoinType.RIGHT;
View Full Code Here

        bindVariables = new HashMap<String, BindVariableValue>();
        read();
        read("SELECT");
        ArrayList<ColumnOrWildcard> list = parseColumns();
        read("FROM");
        Source source = parseSource();
        Column[] columnArray = resolveColumns(list);
        Constraint constraint = null;
        if (readIf("WHERE")) {
            constraint = parseConstraint();
        }
View Full Code Here

    }

    private Source parseSource() throws RepositoryException {
        Selector selector = parseSelector();
        selectors.add(selector);
        Source source = selector;
        while (true) {
            JoinType type;
            if (readIf("RIGHT")) {
                read("OUTER");
                type = JoinType.RIGHT;
View Full Code Here

TOP

Related Classes of javax.jcr.query.qom.Source

Copyright © 2018 www.massapicom. 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.