Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.Selector


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

    public void testCreateQueryWithConstraint() throws RepositoryException {
        Selector selector = qf.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qf.propertyExistence(SELECTOR_NAME1, propertyName1);
        QueryObjectModel qom = qf.createQuery(
                selector, propExist, null, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
View Full Code Here


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

    public void testCreateQueryWithConstraintAndOrdering() throws RepositoryException {
        Selector 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);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
                new Ordering[]{ordering}, null);
View Full Code Here

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

    public void testCreateQueryWithConstraintOrderingAndColumn() throws RepositoryException {
        Selector 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, null);
        QueryObjectModel qom = qf.createQuery(selector, propExist,
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#join(Source, Source, String, JoinCondition)}
     */
    public void testJoin() throws RepositoryException {
        Selector s1 = qf.selector(ntBase, SELECTOR_NAME1);
        Selector s2 = qf.selector(testNodeType, SELECTOR_NAME1);
        JoinCondition cond = qf.equiJoinCondition(ntBase, jcrPrimaryType, testNodeType, jcrPrimaryType);
        for (Iterator it = JOIN_TYPES.iterator(); it.hasNext(); ) {
            String joinType = (String) it.next();
            Join join = qf.join(s1, s2, joinType, cond);
            assertTrue("Not a selector source", join.getLeft() instanceof Selector);
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#selector(String, String)}
     */
    public void testSelector() throws RepositoryException {
        Selector selector = qf.selector(ntBase, SELECTOR_NAME1);
        assertEquals("Wrong node type name", ntBase, selector.getNodeTypeName());
        assertEquals("Wrong selector name", SELECTOR_NAME1, selector.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#selector(String, String)}
     */
    public void testSelectorWithName() throws RepositoryException {
        Selector selector = qf.selector(ntBase, SELECTOR_NAME1);
        assertEquals("Wrong node type name", ntBase, selector.getNodeTypeName());
        assertEquals("Wrong selector name", SELECTOR_NAME1, selector.getSelectorName());
    }
View Full Code Here

            return readAny();
        }
    }

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

            assertEquals("Wrong operator", operator.toString(), comp.getOperator());
        }
    }

    public void testCreateQuery() throws RepositoryException {
        Selector selector = qomFactory.selector(testNodeType, SELECTOR_NAME1);
        QueryObjectModel qom = qomFactory.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);
View Full Code Here

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

    public void testCreateQueryWithConstraint() throws RepositoryException {
        Selector selector = qomFactory.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        QueryObjectModel qom = qomFactory.createQuery(
                selector, propExist, null, null);
        assertTrue("Not a selector source", qom.getSource() instanceof Selector);
        assertTrue("Not a property existence constraint", qom.getConstraint() instanceof PropertyExistence);
View Full Code Here

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

    public void testCreateQueryWithConstraintAndOrdering() throws RepositoryException {
        Selector selector = qomFactory.selector(testNodeType, SELECTOR_NAME1);
        PropertyExistence propExist = qomFactory.propertyExistence(SELECTOR_NAME1, propertyName1);
        PropertyValue propValue = qomFactory.propertyValue(SELECTOR_NAME1, propertyName1);
        Ordering ordering = qomFactory.ascending(propValue);
        QueryObjectModel qom = qomFactory.createQuery(selector, propExist,
                new Ordering[]{ordering}, null);
View Full Code Here

TOP

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

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.