Package org.eclipse.persistence.jpa.jpql.parser

Examples of org.eclipse.persistence.jpa.jpql.parser.CollectionExpression


    /**
     * {@inheritDoc}
     */
    public CollectionExpression buildCollectionExpression(T expression) {
      CollectionExpression collectionExpression = getCollectionExpression(expression.getSelectExpression());
      if (collectionExpression == null) {
        collectionExpression = expression.buildCollectionExpression();
      }
      return collectionExpression;
    }
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public CollectionExpression buildCollectionExpression(UpdateClause expression) {
      CollectionExpression collectionExpression = getCollectionExpression(expression.getUpdateItems());
      if (collectionExpression == null) {
        collectionExpression = expression.buildCollectionExpression();
      }
      return collectionExpression;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public CollectionExpression buildCollectionExpression(WhenClause expression) {
      CollectionExpression collectionExpression = getCollectionExpression(expression.getWhenExpression());
      if (collectionExpression == null) {
        collectionExpression = expression.buildWhenCollectionExpression();
      }
      return collectionExpression;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public CollectionExpression buildCollectionExpression(GroupByClause expression) {
      CollectionExpression collectionExpression = getCollectionExpression(expression.getGroupByItems());
      if (collectionExpression == null) {
        collectionExpression = expression.buildCollectionExpression();
      }
      return collectionExpression;
    }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public CollectionExpression buildCollectionExpression(IdentificationVariableDeclaration expression) {
      CollectionExpression collectionExpression = getCollectionExpression(expression.getJoins());
      if (collectionExpression == null) {
        collectionExpression = expression.buildCollectionExpression();
      }
      return collectionExpression;
    }
View Full Code Here

    validateAbstractSingleEncapsulatedExpression(expression, concatExpressionHelper());

    if (expression.hasLeftParenthesis() &&
        expression.hasExpression()) {

      CollectionExpression collectionExpression = getCollectionExpression(expression.getExpression());

      // Single element
      if (collectionExpression == null) {
        addProblem(expression, ConcatExpression_MissingExpression);
      }
      else {
        for (Expression child : collectionExpression.children()) {
          if (!isValid(child, expression.encapsulatedExpressionBNF())) {
            addProblem(child, ConcatExpression_InvalidExpression, child.toParsedText());
          }
        }
      }
View Full Code Here

    // Validate range variable declaration
    if (expression.hasRangeVariableDeclaration()) {

      // More than one entity abstract schema type is declared
      CollectionExpression collectionExpression = getCollectionExpression(expression.getRangeVariableDeclaration());

      if (collectionExpression != null) {
        Expression firstChild = collectionExpression.getChild(0);
        int startPosition = position(firstChild) + length(firstChild);
        int endPosition = position(collectionExpression) + length(collectionExpression);
        boolean malformed = false;

        for (int index = collectionExpression.childrenSize() - 1; --index >= 0; ) {
          if (!collectionExpression.hasComma(index)) {
            malformed = true;
          }
        }

        if (collectionExpression.toActualText().endsWith(" ")) {
          endPosition--;
        }

        addProblem(
          expression,
View Full Code Here

    }
    // Make sure the IN items are separated by commas
    else if (!singleInputParameter) {

      Expression inItems = expression.getInItems();
      CollectionExpression collectionExpression = getCollectionExpression(inItems);

      // Validate the collection of items
      if (collectionExpression != null) {

        validateCollectionSeparatedByComma(
          inItems,
          InExpression_ItemEndsWithComma,
          InExpression_ItemIsMissingComma
        );

        // Validate each item
        JPQLQueryBNF queryBNF = getQueryBNF(expression.getExpressionItemBNF());
        int index = 0;

        for (Expression child : collectionExpression.children()) {

          index++;

          // First check for nested array support
          if (isNestedArray(child)) {
View Full Code Here

    Expression selectExpression = expression.getSelectExpression();

    // visit(CollectionExpression) iterates through the children but for a
    // SELECT clause, a CollectionExpression means the result type is Object[]
    CollectionExpression collectionExpression = getCollectionExpression(selectExpression);

    if (collectionExpression != null) {
      resolver = buildClassResolver(Object[].class);
    }
    else {
View Full Code Here

   */
  protected void visitCollectionEquivalentExpression(Expression expression,
                                                     Expression extraExpression) {

    List<Resolver> resolvers = new ArrayList<Resolver>();
    CollectionExpression collectionExpression = getCollectionExpression(expression);

    // Gather the resolver for all children
    if (collectionExpression != null) {
      for (Expression child : collectionExpression.children()) {
        child.accept(this);
        resolvers.add(resolver);
      }
    }
    // Otherwise visit the actual expression
View Full Code Here

TOP

Related Classes of org.eclipse.persistence.jpa.jpql.parser.CollectionExpression

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.