Examples of Relike


Examples of org.modeshape.jcr.query.model.Relike

        NamedSelector selector = (NamedSelector)query.source();
        assertThat(selector.name(), is(selectorName("car:Car")));
        assertThat(selector.aliasOrName(), is(selectorName("car:Car")));
        assertThat(selector.alias(), is(nullValue()));
        // WHERE ...
        Relike relike = isRelike(query.constraint());
        assertThat(relike.getOperand1(), is((StaticOperand)literal("test-model")));
        assertThat(relike.getOperand2(), is((DynamicOperand)propertyValue(selectorName("car:Car"), "car:model")));
    }
View Full Code Here

Examples of org.modeshape.jcr.query.model.Relike

                    return fts.getTerm().matches(leftHandValue.toString());
                }
            };
        }
        if (constraint instanceof Relike) {
            Relike relike = (Relike)constraint;
            StaticOperand staticOperand = relike.getOperand1();
            Object literalValue = literalValue(staticOperand, context, context.getTypeSystem().getStringFactory());
            if (literalValue == null) {
                return NodeSequence.NO_PASS_ROW_FILTER;
            }
            final String literalStr = literalValue.toString();
            PropertyValue propertyValue = relike.getOperand2();
            NameFactory names = context.getExecutionContext().getValueFactories().getNameFactory();
            final Name propertyName = names.create(propertyValue.getPropertyName());
            final String selectorName = propertyValue.getSelectorName();
            final int index = columns.getSelectorIndex(selectorName);
            final NodeCache cache = context.getNodeCache(sources.getWorkspaceName());
View Full Code Here

Examples of org.modeshape.jcr.query.model.Relike

            DynamicOperand lhs = replaceAliasesWithProperties(context, comparison.getOperand1(), propertyByAlias);
            if (lhs == comparison.getOperand1()) return comparison;
            return new Comparison(lhs, comparison.operator(), comparison.getOperand2());
        }
        if (constraint instanceof Relike) {
            Relike relike = (Relike)constraint;
            StaticOperand op1 = relike.getOperand1();
            PropertyValue op2 = relike.getOperand2();
            PropertyValue newOp2 = replaceAliasesWithProperties(context, op2, propertyByAlias);
            if (op2 == newOp2) return relike;
            return new Relike(op1, op2);
        }
        if (constraint instanceof SetCriteria) {
            SetCriteria criteria = (SetCriteria)constraint;
            DynamicOperand lhs = replaceAliasesWithProperties(context, criteria.leftOperand(), propertyByAlias);
            if (lhs == criteria.leftOperand()) return criteria;
View Full Code Here

Examples of org.modeshape.jcr.query.model.Relike

            StaticOperand newRhs = replaceSubqueriesWithBindVariables(context, rhs, subqueriesByVariableName);
            if (rhs == newRhs) return comparison;
            return new Comparison(lhs, comparison.operator(), newRhs);
        }
        if (constraint instanceof Relike) {
            Relike relike = (Relike)constraint;
            StaticOperand op1 = relike.getOperand1();
            PropertyValue op2 = relike.getOperand2();
            StaticOperand newOp1 = replaceSubqueriesWithBindVariables(context, op1, subqueriesByVariableName);
            if (op1 == newOp1) return relike;
            return new Relike(op1, op2);
        }
        if (constraint instanceof SetCriteria) {
            SetCriteria criteria = (SetCriteria)constraint;
            DynamicOperand lhs = criteria.leftOperand();
            boolean foundSubquery = false;
View Full Code Here

Examples of org.modeshape.jcr.query.model.Relike

        } else if (tokens.canConsume("RELIKE", "(")) {
            StaticOperand left = parseStaticOperand(tokens, typeSystem);
            tokens.consume(',');
            PropertyValue right = parsePropertyValue(tokens, typeSystem, source);
            tokens.consume(')');
            constraint = new Relike(left, right);
        } else {
            // First try a property existance ...
            Position pos2 = tokens.nextPosition();
            constraint = parsePropertyExistance(tokens, typeSystem, source);
            if (constraint == null) {
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.