Package javax.jcr.query.qom

Examples of javax.jcr.query.qom.StaticOperand


        } else if (constraint instanceof Comparison) {
            Comparison c = (Comparison) constraint;
            Transform transform = new Transform(c.getOperand1());
            DynamicOperand left = transform.operand;
            final String operator = c.getOperator();
            StaticOperand right = c.getOperand2();
            if (left instanceof Length
                    || left instanceof FullTextSearchScore
                    || (((!JCR_OPERATOR_EQUAL_TO.equals(operator) && !JCR_OPERATOR_LIKE
                            .equals(operator)) || transform.transform != TRANSFORM_NONE) && (left instanceof NodeName || left instanceof NodeLocalName))) {
                try {
View Full Code Here


            Name name = session.getQName(property);
            field = nsMappings.getPrefix(name.getNamespaceURI()) + ":"
                + FieldNames.FULLTEXT_PREFIX + name.getLocalName();
        }

        StaticOperand expression = fts.getFullTextSearchExpression();
        String query = evaluator.getValue(expression).getString();
        try {
            QueryParser parser = new JackrabbitQueryParser(
                    field, index.getTextAnalyzer(),
                    index.getSynonymProvider(), cache);
View Full Code Here

        }
        QueryParser parser = new JackrabbitQueryParser(
                fieldname, index.getTextAnalyzer(),
                index.getSynonymProvider(), cache);
        try {
            StaticOperand expr = fts.getFullTextSearchExpression();
            return parser.parse(evaluator.getValue(expr).getString());
        } catch (ParseException e) {
            throw new RepositoryException(e);
        }
    }
View Full Code Here

        } else if (constraint instanceof Comparison) {
            Comparison c = (Comparison) constraint;
            Transform transform = new Transform(c.getOperand1());
            DynamicOperand left = transform.operand;
            final String operator = c.getOperator();
            StaticOperand right = c.getOperand2();
            if (left instanceof Length
                    || left instanceof FullTextSearchScore
                    || (((!JCR_OPERATOR_EQUAL_TO.equals(operator) && !JCR_OPERATOR_LIKE
                            .equals(operator)) || transform.transform != TRANSFORM_NONE) && (left instanceof NodeName || left instanceof NodeLocalName))) {
                try {
View Full Code Here

            Name name = session.getQName(property);
            field = nsMappings.getPrefix(name.getNamespaceURI()) + ":"
                + FieldNames.FULLTEXT_PREFIX + name.getLocalName();
        }

        StaticOperand expression = fts.getFullTextSearchExpression();
        String query = evaluator.getValue(expression).getString();
        try {
            QueryParser parser = new JackrabbitQueryParser(
                    field, index.getTextAnalyzer(),
                    index.getSynonymProvider(), cache);
View Full Code Here

        } else if (readIf("FALSE")) {
            Literal literal = getUncastLiteral(valueFactory.createValue(false));
            return literal;
        } else if (readIf("CAST")) {
            read("(");
            StaticOperand op = parseStaticOperand();
            if (!(op instanceof Literal)) {
                throw getSyntaxError("literal");
            }
            Literal literal = (Literal) op;
            Value value = literal.getLiteralValue();
View Full Code Here

                SELECTOR_NAME1, propertyName1,
                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a Literal", op instanceof Literal);
        Literal literal = (Literal) op;
        assertEquals(FULLTEXT_SEARCH_EXPR, literal.getLiteralValue().getString());
    }
View Full Code Here

                SELECTOR_NAME1, propertyName1,
                qf.bindVariable(VARIABLE_NAME));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a BindVariableValue", op instanceof BindVariableValue);
        BindVariableValue value = (BindVariableValue) op;
        assertEquals(VARIABLE_NAME, value.getBindVariableName());
    }
View Full Code Here

                SELECTOR_NAME1, propertyName1,
                qf.literal(vf.createValue(FULLTEXT_SEARCH_EXPR)));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a Literal", op instanceof Literal);
        Literal literal = (Literal) op;
        assertEquals(FULLTEXT_SEARCH_EXPR, literal.getLiteralValue().getString());
    }
View Full Code Here

                SELECTOR_NAME1, propertyName1,
                qf.bindVariable(VARIABLE_NAME));
        assertEquals("Wrong selector name", SELECTOR_NAME1, ftSearch.getSelectorName());
        assertEquals("Wrong propertyName", propertyName1, ftSearch.getPropertyName());

        StaticOperand op = ftSearch.getFullTextSearchExpression();
        assertNotNull(op);
        assertTrue("not a BindVariableValue", op instanceof BindVariableValue);
        BindVariableValue value = (BindVariableValue) op;
        assertEquals(VARIABLE_NAME, value.getBindVariableName());
    }
View Full Code Here

TOP

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

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.