Package org.eclipse.persistence.internal.expressions

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


        }

        if (this.where != null) {
            if (((InternalExpression) this.where).isPredicate() && ((InternalSelection) this.where).getCurrentNode() == null) {
                if (((PredicateImpl) this.where).getOperator() == BooleanOperator.OR) {
                    query.setSelectionCriteria(new ConstantExpression(1, query.getExpressionBuilder()).equal(0));
                }
            } else {
                query.setSelectionCriteria(((InternalSelection) this.where).getCurrentNode());
            }
        }
View Full Code Here


    /**
     * INTERNAL
     * Generate the expression.
     */
    public Expression generateExpression(GenerationContext context) {
        Expression whereClause = new ConstantExpression(new Integer(0), new ExpressionBuilder());
        whereClause = ExpressionMath.subtract(whereClause, getLeft().generateExpression(context));
        return whereClause;
    }
View Full Code Here

            ReportItem item = (ReportItem)i.next();
            Expression expr = item.getAttributeExpression();
            reportQuery.addNonFetchJoinedAttribute(expr);
        }
        reportQuery.clearItems();
        Expression one = new ConstantExpression(new Integer(1), new ExpressionBuilder());
        reportQuery.addItem("one", one);
        reportQuery.dontUseDistinct();
        Expression expr = context.getBaseExpression();
        return notIndicated() ? expr.notExists(reportQuery) :
            expr.exists(reportQuery);
View Full Code Here

                    }
                }
            }
        } else {
            if (expression==argument){
                foreignKeyJoin = (new ConstantExpression(0, base)).equal(new ConstantExpression(0, base));
            }else{
                int size = this.mechanism.sourceKeyFields.size();
                Expression relTable = base.getTable(this.mechanism.getRelationTable());
                for(int i=0; i < size; i++) {
                    Expression source = base.getField(this.mechanism.sourceKeyFields.get(i));
View Full Code Here

                    }
                }
            }
        } else {
            if (expression==argument){
                foreignKeyJoin = (new ConstantExpression(0, base)).equal(new ConstantExpression(0, base));
            }else{
                int size = this.mechanism.sourceKeyFields.size();
                Expression relTable = base.getTable(this.mechanism.getRelationTable());
                for(int i=0; i < size; i++) {
                    Expression source = base.getField(this.mechanism.sourceKeyFields.get(i));
View Full Code Here

    // First create the Expression that is prepended with the unary sign
    expression.getExpression().accept(this);
    Expression arithmeticFactor = queryExpression;

    // Create an expression for the constant 0 (zero)
    queryExpression = new ConstantExpression(0, new ExpressionBuilder());

    // "- <something>" is really "0 - <something>"
    queryExpression = ExpressionMath.subtract(queryExpression, arithmeticFactor);

    // Note: The type will be calculated when traversing the sub-expression
View Full Code Here

   * {@inheritDoc}
   */
  public void visit(EntityTypeLiteral expression) {
    ClassDescriptor descriptor = queryContext.getDescriptor(expression.getEntityTypeName());
    type[0] = descriptor.getJavaClass();
    queryExpression = new ConstantExpression(type[0], queryContext.getBaseExpression());
  }
View Full Code Here

      subquery.addNonFetchJoinedAttribute(expr);
    }

    subquery.clearItems();

    Expression one = new ConstantExpression(1, new ExpressionBuilder());
    subquery.addItem("one", one);
    subquery.dontUseDistinct();

    // Now create the EXISTS expression
    queryExpression = queryContext.getBaseExpression();
View Full Code Here

      value   = Boolean.FALSE;
      type[0] = Boolean.class;
    }

    queryExpression = queryContext.getBaseExpression();
    queryExpression = new ConstantExpression(value, queryExpression);
  }
View Full Code Here

    // Instantiate a Number object with the value
    type[0] = queryContext.getType(expression);
    Number number = queryContext.newInstance(type[0], String.class, expression.getText());

    // Now create the numeric expression
    queryExpression = new ConstantExpression(number, queryContext.getBaseExpression());
  }
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.internal.expressions.ConstantExpression

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.