Package org.eclipse.persistence.internal.expressions

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


      for (org.eclipse.persistence.jpa.jpql.parser.Expression child : expression.children()) {
        child.accept(this);
        children.add(queryExpression);
      }

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


        ClassDescriptor descriptor = queryContext.getDescriptor(expression.getText());

        // Entity type name
        if (descriptor != null) {
          type[0] = descriptor.getJavaClass();
          queryExpression = new ConstantExpression(type[0], queryContext.getBaseExpression());
          found = true;
        }
      }

      if (!found) {
View Full Code Here

       */
      @Override
      public void visit(IdentificationVariable expression) {
        ClassDescriptor descriptor = queryContext.getDescriptor(expression.getVariableName());
        queryExpression = queryContext.getBaseExpression();
        queryExpression = new ConstantExpression(descriptor.getJavaClass(), queryExpression);
      }
View Full Code Here

        for (org.eclipse.persistence.jpa.jpql.parser.Expression child : expression.children()) {
          child.accept(this);
          children.add(queryExpression);
        }

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

        // Retrieve the enum constant
        String path = expression.getPath(expression.pathSize() - 1);
        Enum<?> enumConstant = retrieveEnumConstant(enumType, path);

        // Create the Expression
        localExpression = new ConstantExpression(enumConstant, new ExpressionBuilder());

        return true;
      }

      return false;
View Full Code Here

        }

        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

            }
            this.subQuery.setExpressionBuilder(((InternalSelection)selection.getCompoundSelectionItems().get(0)).getCurrentNode().getBuilder());
        } else {
            TypeImpl type = ((MetamodelImpl)this.metamodel).getType(selection.getJavaType());
            if (type != null && type.getPersistenceType().equals(PersistenceType.ENTITY)) {
                this.subQuery.addAttribute("", new ConstantExpression(1, ((InternalSelection)selection).getCurrentNode().getBuilder()));
                this.subQuery.addNonFetchJoinedAttribute(((InternalSelection)selection).getCurrentNode());
            } else {
                String itemName = selection.getAlias();
                if (itemName == null){
                    itemName = ((InternalSelection) selection).getCurrentNode().getName();
View Full Code Here

                // query
                // type
                if (this.selection == null) {
                    this.selection = root;
                    this.subQuery.getItems().clear();
                    this.subQuery.addAttribute("", new ConstantExpression(1, root.getCurrentNode().getBuilder()));
                    this.queryResult = ResultType.ENTITY;
                }
            }
            this.subQuery.setReferenceClass(root.getJavaType());
            this.subQuery.setExpressionBuilder(root.getCurrentNode().getBuilder());
View Full Code Here

            }
            this.subQuery.setExpressionBuilder(((InternalSelection)selection.getCompoundSelectionItems().get(0)).getCurrentNode().getBuilder());
        } else {
            TypeImpl type = ((MetamodelImpl)this.metamodel).getType(selection.getJavaType());
            if (type != null && type.getPersistenceType().equals(PersistenceType.ENTITY)) {
                this.subQuery.addAttribute("", new ConstantExpression(1, ((InternalSelection)selection).getCurrentNode().getBuilder()));
                this.subQuery.addNonFetchJoinedAttribute(((InternalSelection)selection).getCurrentNode());
            } else {
                String itemName = selection.getAlias();
                if (itemName == null){
                    itemName = ((InternalSelection) selection).getCurrentNode().getName();
View Full Code Here

            if ((type != null && type.getPersistenceType() == PersistenceType.ENTITY) || queryType.equals(ClassConstants.OBJECT)) {
                // this is the first root, set return type and selection and query type
                if (this.selection == null) {
                    this.selection = root;
                    this.subQuery.getItems().clear();
                    this.subQuery.addAttribute("", new ConstantExpression(1, root.getCurrentNode().getBuilder()));
                    this.queryResult = ResultType.ENTITY;
                }
            }
            this.subQuery.setReferenceClass(root.getJavaType());
            this.subQuery.setExpressionBuilder(root.getCurrentNode().getBuilder());
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.