Examples of RelationExpression


Examples of eu.admire.dispel.expressions.RelationExpression

          for (EqualityExpressionChild child : exp.getChildren())
            newObj = getLeaf(child);
        }
   
        if (obj instanceof RelationExpression) {
          RelationExpression exp = (RelationExpression) obj;
   
          for (EqualityExpressionChild child : exp.getChildren())
            newObj = getLeaf(child);
        }
   
        if (obj instanceof ShiftExpression) {
          ShiftExpression exp = (ShiftExpression) obj;
   
          for (ShiftExpressionChild child : exp.getChildren())
            newObj = getLeaf(child);
        }
   
        if (obj instanceof AdditiveExpression) {
          AdditiveExpression exp = (AdditiveExpression) obj;
   
          for (AdditiveExpressionChild child : exp.getChildren())
            newObj = getLeaf(child);
        }
   
        if (obj instanceof MultiplicativeExpression) {
          MultiplicativeExpression exp = (MultiplicativeExpression) obj;
   
          for (MultiplicativeExpressionChild child : exp.getChildren())
            newObj = getLeaf(child);
        }
   
        if (obj instanceof UnaryExpression) {
          UnaryExpression exp = (UnaryExpression) obj;
          newObj = getLeaf(exp.getChild());
        }
   
        if (obj instanceof SuffixUnaryModificationExpression) {
          SuffixUnaryModificationExpression exp = (SuffixUnaryModificationExpression) obj;
          newObj = getLeaf(exp.getChild());
        }
   
        if (obj instanceof StringReference)
          return obj;
   
View Full Code Here

Examples of eu.admire.dispel.expressions.RelationExpression

        .createAndExpression();
    ex6.getChildren().add(ex7);
    EqualityExpression ex8 = ExpressionsFactory.eINSTANCE
        .createEqualityExpression();
    ex7.getChildren().add(ex8);
    RelationExpression ex9 = ExpressionsFactory.eINSTANCE
        .createRelationExpression();
    ex8.getChildren().add(ex9);
    ShiftExpression ex10 = ExpressionsFactory.eINSTANCE
        .createShiftExpression();
    ex9.getChildren().add(ex10);
    AdditiveExpression ex11 = ExpressionsFactory.eINSTANCE
        .createAdditiveExpression();
    ex10.getChildren().add(ex11);
    MultiplicativeExpression ex12 = ExpressionsFactory.eINSTANCE
        .createMultiplicativeExpression();
View Full Code Here

Examples of eu.admire.dispel.expressions.RelationExpression

    EqualityExpression ex8 = ExpressionsFactory.eINSTANCE
        .createEqualityExpression();

    ex7.getChildren().add(ex8);

    RelationExpression ex9 = ExpressionsFactory.eINSTANCE
        .createRelationExpression();

    ex8.getChildren().add(ex9);

    ShiftExpression ex10 = ExpressionsFactory.eINSTANCE
        .createShiftExpression();

    ex9.getChildren().add(ex10);

    AdditiveExpression ex11 = ExpressionsFactory.eINSTANCE
        .createAdditiveExpression();

    ex10.getChildren().add(ex11);
View Full Code Here

Examples of org.eclipse.persistence.internal.expressions.RelationExpression

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

Examples of org.eclipse.persistence.internal.expressions.RelationExpression

    /**
     * Append the expression and recursively to the query row.
     */
    protected void appendExpressionToQueryRow(Expression expression, AbstractRecord row, DatabaseQuery query) {
        if (expression.isRelationExpression()) {
            RelationExpression relation = (RelationExpression)expression;
            Object left = extractValueFromExpression(relation.getFirstChild(), query);
            Object right = extractValueFromExpression(relation.getSecondChild(), query);
            if (relation.getOperator().getSelector() == ExpressionOperator.Equal) {
                row.put(left, right);
            } else {
                DatabaseRecord nested = new DatabaseRecord();
                if (relation.getOperator().getSelector() == ExpressionOperator.GreaterThan) {
                    nested.put("$gt", right);
                } else if (relation.getOperator().getSelector() == ExpressionOperator.LessThan) {
                    nested.put("$lt", right);
                } else if (relation.getOperator().getSelector() == ExpressionOperator.LessThanEqual) {
                    nested.put("$lte", right);
                } else if (relation.getOperator().getSelector() == ExpressionOperator.GreaterThanEqual) {
                    nested.put("$gte", right);
                } else if (relation.getOperator().getSelector() == ExpressionOperator.NotEqual) {
                    nested.put("$ne", right);
                } else if (relation.getOperator().getSelector() == ExpressionOperator.In) {                   
                    nested.put("$in", right);
                    row.put(left, nested);
                } else if (relation.getOperator().getSelector() == ExpressionOperator.NotIn) {
                    nested.put("$nin", right);
                    row.put(left, nested);
                } else {
                    throw new EISException("Query too complex for Mongo translation, relation [" + expression + "] not supported in query: " + query);
                }
View Full Code Here

Examples of org.eclipse.persistence.internal.expressions.RelationExpression

     @param value expression
     *  @return in predicate
     */
    public In<T> value(Expression<? extends T> value) {
        if (!(((InternalExpression) value).isLiteral() || ((InternalExpression) value).isParameter())) {
            RelationExpression baseIn = (RelationExpression) this.currentNode;
            this.currentNode = baseIn.getFirstChild().in(((SubQueryImpl) value).subQuery);
            if (this.parentNode != null) {
                if (this.parentNode.isCompoundExpression()) {
                    CompoundExpression logExp = (LogicalExpression) this.parentNode;
                    if (logExp.getFirstChild() == baseIn) {
                        logExp.create(this.currentNode, logExp.getSecondChild(), logExp.getOperator());
                    } else {
                        logExp.create(logExp.getFirstChild(), this.currentNode, logExp.getOperator());
                    }
                } else {
                    FunctionExpression funcExp = (FunctionExpression) this.parentNode;
                    funcExp.getChildren().set(funcExp.getChildren().indexOf(baseIn), this.currentNode);
                }
            }
        } else {
            if (this.currentNode.isRelationExpression()) {
                RelationExpression baseIn = (RelationExpression) this.currentNode;
                ((InternalSelection) value).getCurrentNode().setLocalBase(baseIn.getFirstChild());
                ((Collection) ((CollectionExpression) baseIn.getSecondChild()).getValue()).add(((InternalSelection) value).getCurrentNode());
            } else {
                throw new IllegalStateException(ExceptionLocalization.buildMessage("CANNOT_ADD_CONSTANTS_TO_SUBQUERY_IN"));
            }
        }

View Full Code Here

Examples of org.eclipse.persistence.internal.expressions.RelationExpression

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

Examples of org.eclipse.persistence.internal.expressions.RelationExpression

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

Examples of org.eclipse.persistence.internal.expressions.RelationExpression

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
View Full Code Here

Examples of org.eclipse.persistence.internal.expressions.RelationExpression

        // Child value expressions need their backpointer to their local base set,
        // this is not persisted so must be hooked back up after loading.
        descriptor.getEventManager().addListener(new DescriptorEventAdapter() {
            public void postBuild(DescriptorEvent event) {
                RelationExpression expression = (RelationExpression)event.getObject();
                if ((expression.getFirstChild() != null) && (expression.getSecondChild() != null)) {
                    if (expression.getSecondChild().isValueExpression()) {
                        expression.getSecondChild().setLocalBase(expression.getFirstChild());
                    }
                    if (expression.getFirstChild().isValueExpression()) {
                        expression.getFirstChild().setLocalBase(expression.getSecondChild());
                    }
                }
            }
        });
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.