Examples of SetCriteria


Examples of org.jboss.dna.graph.query.model.SetCriteria

            Operator operator = comparison.getOperator();
            StaticOperand staticOperand = comparison.getOperand2();
            return createChecker(types, schemata, columns, dynamicOperation, operator, staticOperand);
        }
        if (constraint instanceof SetCriteria) {
            SetCriteria setCriteria = (SetCriteria)constraint;
            DynamicOperation dynamicOperation = createDynamicOperation(types, schemata, columns, setCriteria.getLeftOperand());
            Operator operator = Operator.EQUAL_TO;
            final List<ConstraintChecker> checkers = new LinkedList<ConstraintChecker>();
            for (StaticOperand setValue : setCriteria.getRightOperands()) {
                ConstraintChecker rightChecker = createChecker(types, schemata, columns, dynamicOperation, operator, setValue);
                assert rightChecker != null;
                checkers.add(rightChecker);
            }
            if (checkers.isEmpty()) {
View Full Code Here

Examples of org.jboss.dna.graph.query.model.SetCriteria

            Collection<StaticOperand> right = new ArrayList<StaticOperand>();
            right.add(firstLiteral instanceof Literal ? (Literal)firstLiteral : new Literal(firstLiteral));
            for (Object literal : additionalLiterals) {
                right.add(literal instanceof Literal ? (Literal)literal : new Literal(literal));
            }
            return this.constraintBuilder.setConstraint(new SetCriteria(left, right));
        }
View Full Code Here

Examples of org.jboss.dna.graph.query.model.SetCriteria

                        throw new ParsingException(pos, msg);
                    }
                    if (tokens.matches("IN", "(") || tokens.matches("NOT", "IN", "(")) {
                        boolean not = tokens.canConsume("NOT");
                        Collection<StaticOperand> staticOperands = parseInClause(tokens, typeSystem);
                        constraint = new SetCriteria(left, staticOperands);
                        if (not) constraint = new Not(constraint);
                    } else if (tokens.matches("BETWEEN") || tokens.matches("NOT", "BETWEEN")) {
                        boolean not = tokens.canConsume("NOT");
                        tokens.consume("BETWEEN");
                        StaticOperand lowerBound = parseStaticOperand(tokens, typeSystem);
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.SetCriteria

                                    Comparison comparison = (Comparison)constraint;
                                    if (isPrimaryTypeConstraint(comparison.getOperand1())) {
                                        addLiteral(comparison.getOperand2(), nodeTypeNames);
                                    }
                                } else if (constraint instanceof SetCriteria) {
                                    SetCriteria criteria = (SetCriteria)constraint;
                                    if (isPrimaryTypeConstraint(criteria.getOperand())) {
                                        // Look for literal values and collect them as the node type names ...
                                        for (StaticOperand operand : criteria.getValues()) {
                                            addLiteral(operand, nodeTypeNames);
                                        }
                                    }
                                }
                            }
View Full Code Here

Examples of org.modeshape.jcr.api.query.qom.SetCriteria

            if (constraint instanceof PropertyExistence) {
                // Presumably this index only contains values for this property ...
                return this;
            }
            if (constraint instanceof SetCriteria) {
                SetCriteria criteria = (SetCriteria)constraint;
                return apply(criteria, negated);
            }

            // We don't know how to handle any of the other kinds of constraints ...
            LOGGER.debug("Unable to process constraint, so ignoring: {0}", constraint);
View Full Code Here

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

        return new Comparison(left, Operator.EQUAL_TO, right);
    }

    protected SetCriteria in( DynamicOperand left,
                              StaticOperand... right ) {
        return new SetCriteria(left, right);
    }
View Full Code Here

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

            DynamicOperand newLhs = replaceReferencesToRemovedSource(context, lhs, rewrittenSelectors);
            if (lhs == newLhs) return comparison;
            return new Comparison(newLhs, comparison.operator(), rhs);
        }
        if (constraint instanceof SetCriteria) {
            SetCriteria criteria = (SetCriteria)constraint;
            DynamicOperand lhs = criteria.leftOperand();
            DynamicOperand newLhs = replaceReferencesToRemovedSource(context, lhs, rewrittenSelectors);
            if (lhs == newLhs) return constraint;
            return new SetCriteria(newLhs, criteria.rightOperands());
        }
        return constraint;
    }
View Full Code Here

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

            node.addSelector(sourceColumn.selectorName());
            return new FullTextSearch(sourceColumn.selectorName(), sourceColumn.getPropertyName(),
                                      search.fullTextSearchExpression(), search.getFullTextSearchExpression());
        }
        if (constraint instanceof SetCriteria) {
            SetCriteria set = (SetCriteria)constraint;
            DynamicOperand oldLeft = set.leftOperand();
            Set<SelectorName> selectorNames = oldLeft.selectorNames();
            if (selectorNames.size() == 1 && !selectorNames.contains(mapping.getOriginalName())) return set;
            DynamicOperand newLeft = replaceViewReferences(context, oldLeft, mapping, node);
            if (newLeft == oldLeft) return set;
            return new SetCriteria(newLeft, set.rightOperands());
        }
        if (constraint instanceof Between) {
            Between between = (Between)constraint;
            DynamicOperand lhs = between.getOperand();
            StaticOperand lower = between.getLowerBound(); // Current only a literal; therefore, no reference to selector
View Full Code Here

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

            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;
            return new SetCriteria(lhs, criteria.rightOperands());
        }
        return constraint;
    }
View Full Code Here

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

            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;
            List<StaticOperand> newStaticOperands = new LinkedList<StaticOperand>();
            for (StaticOperand rhs : criteria.rightOperands()) {
                StaticOperand newRhs = replaceSubqueriesWithBindVariables(context, rhs, subqueriesByVariableName);
                newStaticOperands.add(newRhs);
                if (rhs != newRhs) {
                    foundSubquery = true;
                }
            }
            if (!foundSubquery) return criteria;
            return new SetCriteria(lhs, newStaticOperands);
        }
        return constraint;
    }
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.