Examples of DeleteClause


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

    /**
     * {@inheritDoc}
     */
    public boolean isClauseComplete(DeleteStatement expression) {

      DeleteClause deleteClause = expression.getDeleteClause();
      Expression declaration = deleteClause.getRangeVariableDeclaration();
      boolean complete = isValid(declaration, RangeVariableDeclarationBNF.ID);

      if (complete) {
        complete = isComplete(declaration);
      }
View Full Code Here

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

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      DeleteClause expression = stateObject.getExpression();

      // 'DELETE'
      appendIdentifier((expression != null) ? expression.getActualDeleteIdentifier() : DELETE, DELETE);

      if (shouldOutput(expression) || expression.hasSpaceAfterDelete()) {
        writer.append(SPACE);
      }

      // 'FROM'
      if (shouldOutput(expression) || expression.hasFrom()) {
        appendIdentifier((expression != null) ? expression.getActualFromIdentifier() : FROM, FROM);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterFrom()) {
        writer.append(SPACE);
      }

      // Range variable declaration
      stateObject.getRangeVariableDeclaration().accept(this);
View Full Code Here

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

    int position = getPosition(expression) - corrections.peek();

    //
    // DELETE clause
    //
    DeleteClause deleteClause = expression.getDeleteClause();
    int length = length(deleteClause);

    // At the end of the DELETE clause, check for adding proposals based
    // on possible incomplete information
    if ((position == length) && isAppendable(deleteClause)) {
      addIdentifier(WHERE);
    }
    // Right after the DELETE clause, the space is owned by JPQLExpression
    else if ((position == length + SPACE_LENGTH) && expression.hasSpaceAfterDeleteClause()) {

      virtualSpaces.add(SPACE_LENGTH);
      corrections.add(-length - 2);

      deleteClause.accept(this);

      corrections.pop();
      virtualSpaces.pop();
    }

    // Nothing else to do
    if ((position == length) && !expression.hasSpaceAfterDeleteClause()) {
      return;
    }

    if (expression.hasSpaceAfterDeleteClause()) {
      length++;
    }

    // Nothing else to do
    if ((position == length) && !deleteClause.hasRangeVariableDeclaration()) {
      return;
    }

    //
    // WHERE clause
    //
    // Right before "WHERE"
    if (position == length) {

      if (expression.hasSpaceAfterDeleteClause() &&
          isComplete(deleteClause.getRangeVariableDeclaration())) {

        addIdentifier(WHERE);
      }
    }
View Full Code Here

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

    int position = getPosition(expression) - corrections.peek();

    //
    // DELETE clause
    //
    DeleteClause deleteClause = expression.getDeleteClause();
    int length = length(deleteClause);

    // At the end of the DELETE clause, check for adding proposals based
    // on possible incomplete information
    if ((position == length) && isAppendable(deleteClause)) {
      addIdentifier(WHERE);
    }
    // Right after the DELETE clause, the space is owned by JPQLExpression
    else if ((position == length + SPACE_LENGTH) && expression.hasSpaceAfterDeleteClause()) {

      virtualSpaces.add(SPACE_LENGTH);
      corrections.add(-length - 2);

      deleteClause.accept(this);

      corrections.pop();
      virtualSpaces.pop();
    }

    // Nothing else to do
    if ((position == length) && !expression.hasSpaceAfterDeleteClause()) {
      return;
    }

    if (expression.hasSpaceAfterDeleteClause()) {
      length++;
    }

    // Nothing else to do
    if ((position == length) && !deleteClause.hasRangeVariableDeclaration()) {
      return;
    }

    //
    // WHERE clause
    //
    // Right before "WHERE"
    if (position == length) {

      if (expression.hasSpaceAfterDeleteClause() &&
          isComplete(deleteClause.getRangeVariableDeclaration())) {

        addIdentifier(WHERE);
      }
    }
View Full Code Here

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

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      DeleteClause expression = stateObject.getExpression();

      // 'DELETE'
      appendIdentifier((expression != null) ? expression.getActualDeleteIdentifier() : DELETE, DELETE);

      if (shouldOutput(expression) || expression.hasSpaceAfterDelete()) {
        writer.append(SPACE);
      }

      // 'FROM'
      if (shouldOutput(expression) || expression.hasFrom()) {
        appendIdentifier((expression != null) ? expression.getActualFromIdentifier() : FROM, FROM);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterFrom()) {
        writer.append(SPACE);
      }

      // Range variable declaration
      stateObject.getRangeVariableDeclaration().accept(this);
View Full Code Here

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

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      DeleteClause expression = stateObject.getExpression();

      // 'DELETE'
      appendIdentifier((expression != null) ? expression.getActualDeleteIdentifier() : DELETE, DELETE);

      if (shouldOutput(expression) || expression.hasSpaceAfterDelete()) {
        writer.append(SPACE);
      }

      // 'FROM'
      if (shouldOutput(expression) || expression.hasFrom()) {
        appendIdentifier((expression != null) ? expression.getActualFromIdentifier() : FROM, FROM);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterFrom()) {
        writer.append(SPACE);
      }

      // Range variable declaration
      stateObject.getRangeVariableDeclaration().accept(this);
View Full Code Here

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

    int position = getPosition(expression) - corrections.peek();

    //
    // DELETE clause
    //
    DeleteClause deleteClause = expression.getDeleteClause();
    int length = length(deleteClause);

    // At the end of the DELETE clause, check for adding proposals based
    // on possible incomplete information
    if ((position == length) && isAppendable(deleteClause)) {
      addIdentifier(WHERE);
    }
    // Right after the DELETE clause, the space is owned by JPQLExpression
    else if ((position == length + SPACE_LENGTH) && expression.hasSpaceAfterDeleteClause()) {

      virtualSpaces.add(SPACE_LENGTH);
      corrections.add(-length - 2);

      deleteClause.accept(this);

      corrections.pop();
      virtualSpaces.pop();
    }

    // Nothing else to do
    if ((position == length) && !expression.hasSpaceAfterDeleteClause()) {
      return;
    }

    if (expression.hasSpaceAfterDeleteClause()) {
      length++;
    }

    // Nothing else to do
    if ((position == length) && !deleteClause.hasRangeVariableDeclaration()) {
      return;
    }

    //
    // WHERE clause
    //
    // Right before "WHERE"
    if (position == length) {

      if (expression.hasSpaceAfterDeleteClause() &&
          isComplete(deleteClause.getRangeVariableDeclaration())) {

        addIdentifier(WHERE);
      }
    }
View Full Code Here

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

    if (stateObject.isDecorated()) {
      toText(stateObject);
    }
    else {
      DeleteClause expression = stateObject.getExpression();

      // 'DELETE'
      appendIdentifier((expression != null) ? expression.getActualDeleteIdentifier() : DELETE, DELETE);

      if (shouldOutput(expression) || expression.hasSpaceAfterDelete()) {
        writer.append(SPACE);
      }

      // 'FROM'
      if (shouldOutput(expression) || expression.hasFrom()) {
        appendIdentifier((expression != null) ? expression.getActualFromIdentifier() : FROM, FROM);
      }

      if (shouldOutput(expression) || expression.hasSpaceAfterFrom()) {
        writer.append(SPACE);
      }

      // Range variable declaration
      stateObject.getRangeVariableDeclaration().accept(this);
View Full Code Here

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

    /**
     * {@inheritDoc}
     */
    public boolean isClauseComplete(DeleteStatement expression) {

      DeleteClause deleteClause = expression.getDeleteClause();
      Expression declaration = deleteClause.getRangeVariableDeclaration();
      boolean complete = isValid(declaration, RangeVariableDeclarationBNF.ID);

      if (complete) {
        complete = isComplete(declaration);
      }
View Full Code Here

Examples of org.neo4j.cypherdsl.query.clause.DeleteClause

    }

    @Override
    public ForEachStatement delete( ReferenceExpression... expressions )
    {
        return new ForEachStatement( forEachClause.add( new DeleteClause( asList( expressions ) ) ) );
    }
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.