Package org.apache.jackrabbit.spi.commons.query.jsr283.qom

Examples of org.apache.jackrabbit.spi.commons.query.jsr283.qom.PropertyValue


    /**
     * Test case for {@link QueryObjectModelFactory#equiJoinCondition(String, String, String, String)}
     */
    public void testEquiJoinCondition() throws RepositoryException {
        EquiJoinCondition cond = qomFactory.equiJoinCondition(SELECTOR_NAME1, propertyName1, SELECTOR_NAME2, propertyName2);
        assertEquals("Wrong selector name", SELECTOR_NAME1, cond.getSelector1Name());
        assertEquals("Wrong property name", propertyName1, cond.getProperty1Name());
        assertEquals("Wrong selector name", SELECTOR_NAME2, cond.getSelector2Name());
        assertEquals("Wrong property name", propertyName2, cond.getProperty2Name());
    }
View Full Code Here


    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String)}
     */
    public void testFullTextSearch() throws RepositoryException {
        FullTextSearch ftSearch = qomFactory.fullTextSearch(propertyName1, FULLTEXT_SEARCH_EXPR);
        assertNull("Selector must be null", ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
        assertEquals("Wrong fulltext search expression", FULLTEXT_SEARCH_EXPR, ftSearch.getFullTextSearchExpression());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String)}
     */
    public void testFullTextSearchAllProperties() throws RepositoryException {
        FullTextSearch ftSearch = qomFactory.fullTextSearch(null, FULLTEXT_SEARCH_EXPR);
        assertNull("Selector must be null", ftSearch.getSelectorName());
        assertNull("Property name must be null", ftSearch.getPropertyName());
        assertEquals("Wrong fulltext search expression", FULLTEXT_SEARCH_EXPR, ftSearch.getFullTextSearchExpression());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearch(String, String, String)}
     */
    public void testFullTextSearchWithSelector() throws RepositoryException {
        FullTextSearch ftSearch = qomFactory.fullTextSearch(SELECTOR_NAME1, propertyName1, FULLTEXT_SEARCH_EXPR);
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());
        assertEquals("Wrong fulltext search expression", FULLTEXT_SEARCH_EXPR, ftSearch.getFullTextSearchExpression());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearchScore()}
     */
    public void testFullTextSearchScore() throws RepositoryException {
        FullTextSearchScore score = qomFactory.fullTextSearchScore();
        assertNull("Selector must be null", score.getSelectorName());
    }
View Full Code Here

    /**
     * Test case for {@link QueryObjectModelFactory#fullTextSearchScore(String)}
     */
    public void testFullTextSearchScoreWithSelector() throws RepositoryException {
        FullTextSearchScore score = qomFactory.fullTextSearchScore(SELECTOR_NAME1);
        assertEquals("Wrong selector name", SELECTOR_NAME1, score.getSelectorName());
    }
View Full Code Here

        Selector s1 = qomFactory.selector(ntBase);
        Selector s2 = qomFactory.selector(testNodeType);
        JoinCondition cond = qomFactory.equiJoinCondition(ntBase, jcrPrimaryType, testNodeType, jcrPrimaryType);
        for (Iterator it = JOIN_TYPES.iterator(); it.hasNext(); ) {
            int joinType = ((Integer) it.next()).intValue();
            Join join = qomFactory.join(s1, s2, joinType, cond);
            assertTrue("Not a selector source", join.getLeft() instanceof Selector);
            assertTrue("Not a selector source", join.getRight() instanceof Selector);
            assertEquals("Wrong join type", joinType, join.getJoinType());
            assertTrue("Not an EquiJoinCondition", join.getJoinCondition() instanceof EquiJoinCondition);
        }
    }
View Full Code Here

            }
            read("JOIN");
            selector = parseSelector();
            selectors.add(selector);
            read("ON");
            JoinCondition on = parseJoinCondition();
            source = factory.join(source, selector, type, on);
        }
        return source;
    }
View Full Code Here

    // Page 130
    private JoinCondition parseJoinCondition() throws RepositoryException {
        boolean identifier = currentTokenType == IDENTIFIER;
        String name = readName();
        JoinCondition c;
        if (identifier && readIf("(")) {
            if ("ISSAMENODE".equals(name)) {
                String selector1 = readName();
                read(",");
                String selector2 = readName();
View Full Code Here

                // TODO decimal
                throw getSyntaxError("number");
            }
        }
        if (currentTokenType == VALUE) {
            Literal literal = factory.literal(currentValue);
            read();
            return literal;
        } else if (currentTokenType == PARAMETER) {
            read();
            String name = readName();
            BindVariableValue var = (BindVariableValue) bindVariables.get(name);
            if (var == null) {
                var = factory.bindVariable(name);
                bindVariables.put(name, var);
            }
            return var;
        } else if (readIf("TRUE")) {
            Literal literal = factory.literal(valueFactory.createValue(true));
            return literal;
        } else if (readIf("FALSE")) {
            Literal literal = factory.literal(valueFactory.createValue(false));
            return literal;
        } else {
            throw getSyntaxError("static operand");
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.jackrabbit.spi.commons.query.jsr283.qom.PropertyValue

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.