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

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


    }
  }

  protected boolean toStringSelectStatement(AbstractSelectStatementStateObject stateObject) {

    AbstractSelectStatement expression = stateObject.getExpression();
    boolean spaceAdded = false;

    // SELECT clause
    stateObject.getSelectClause().accept(this);

    // If no select items were parsed by they got added later, make sure a space is added
    if (shouldOutput(expression) ||
        expression.hasSpaceAfterSelect() ||
        (!expression.getSelectClause().hasSelectExpression() &&
         stateObject.getSelectClause().hasSelectItem())) {

      writer.append(SPACE);
    }

    // FROM clause
    stateObject.getFromClause().accept(this);

    // If no WHERE clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterFrom() ||
        stateObject.hasWhereClause()) {

      writer.append(SPACE);
      spaceAdded = true;
    }

    // WHERE clause
    if (stateObject.hasWhereClause()) {
      stateObject.getWhereClause().accept(this);
      spaceAdded = false;
    }

    // If no GROUP BY clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterWhere() ||
        stateObject.hasGroupByClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
      }
    }

    // GROUP BY clause
    if (stateObject.hasGroupByClause()) {
      stateObject.getGroupByClause().accept(this);
      spaceAdded = false;
    }

    // If no HAVING clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterGroupBy() ||
        stateObject.hasHavingClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
View Full Code Here


    }
  }

  protected boolean toStringSelectStatement(AbstractSelectStatementStateObject stateObject) {

    AbstractSelectStatement expression = stateObject.getExpression();
    boolean spaceAdded = false;

    // SELECT clause
    stateObject.getSelectClause().accept(this);

    // If no select items were parsed but they got added later, make sure a space is added
    if (shouldOutput(expression) ||
        expression.hasSpaceAfterSelect() ||
        // TODO
        (/*!expression.getSelectClause().hasSelectExpression() &&*/
          stateObject.getSelectClause().hasSelectItem())) {

      writer.append(SPACE);
    }

    // FROM clause
    stateObject.getFromClause().accept(this);

    // If no WHERE clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterFrom() ||
        stateObject.hasWhereClause()) {

      writer.append(SPACE);
      spaceAdded = true;
    }

    // WHERE clause
    if (stateObject.hasWhereClause()) {
      stateObject.getWhereClause().accept(this);
      spaceAdded = false;
    }

    // If no GROUP BY clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterWhere() ||
        stateObject.hasGroupByClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
      }
    }

    // GROUP BY clause
    if (stateObject.hasGroupByClause()) {
      stateObject.getGroupByClause().accept(this);
      spaceAdded = false;
    }

    // If no HAVING clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterGroupBy() ||
        stateObject.hasHavingClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
View Full Code Here

    }
  }

  protected boolean toStringSelectStatement(AbstractSelectStatementStateObject stateObject) {

    AbstractSelectStatement expression = stateObject.getExpression();
    boolean spaceAdded = false;

    // SELECT clause
    stateObject.getSelectClause().accept(this);

    // If no select items were parsed by they got added later, make sure a space is added
    if (shouldOutput(expression) ||
        expression.hasSpaceAfterSelect() ||
        (!expression.getSelectClause().hasSelectExpression() &&
         stateObject.getSelectClause().hasSelectItem())) {

      writer.append(SPACE);
    }

    // FROM clause
    stateObject.getFromClause().accept(this);

    // If no WHERE clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterFrom() ||
        stateObject.hasWhereClause()) {

      writer.append(SPACE);
      spaceAdded = true;
    }

    // WHERE clause
    if (stateObject.hasWhereClause()) {
      stateObject.getWhereClause().accept(this);
      spaceAdded = false;
    }

    // If no GROUP BY clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterWhere() ||
        stateObject.hasGroupByClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
      }
    }

    // GROUP BY clause
    if (stateObject.hasGroupByClause()) {
      stateObject.getGroupByClause().accept(this);
      spaceAdded = false;
    }

    // If no HAVING clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterGroupBy() ||
        stateObject.hasHavingClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
View Full Code Here

    }
  }

  protected boolean toStringSelectStatement(AbstractSelectStatementStateObject stateObject) {

    AbstractSelectStatement expression = stateObject.getExpression();
    boolean spaceAdded = false;

    // SELECT clause
    stateObject.getSelectClause().accept(this);

    // If no select items were parsed but they got added later, make sure a space is added
    if (shouldOutput(expression) ||
        expression.hasSpaceAfterSelect() ||
        // TODO
        (/*!expression.getSelectClause().hasSelectExpression() &&*/
          stateObject.getSelectClause().hasSelectItem())) {

      writer.append(SPACE);
    }

    // FROM clause
    stateObject.getFromClause().accept(this);

    // If no WHERE clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterFrom() ||
        stateObject.hasWhereClause()) {

      writer.append(SPACE);
      spaceAdded = true;
    }

    // WHERE clause
    if (stateObject.hasWhereClause()) {
      stateObject.getWhereClause().accept(this);
      spaceAdded = false;
    }

    // If no GROUP BY clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterWhere() ||
        stateObject.hasGroupByClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
      }
    }

    // GROUP BY clause
    if (stateObject.hasGroupByClause()) {
      stateObject.getGroupByClause().accept(this);
      spaceAdded = false;
    }

    // If no HAVING clause was parsed but was added later, make sure a space is added
    if (exactMatch && (expression != null) && expression.hasSpaceAfterGroupBy() ||
        stateObject.hasHavingClause()) {

      if (!spaceAdded) {
        writer.append(SPACE);
        spaceAdded = true;
View Full Code Here

TOP

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

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.