All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.hotrod.runtime.livesql.queries.DeleteFromPhase Maven / Gradle / Ivy

There is a newer version: 4.8.1
Show newest version
package org.hotrod.runtime.livesql.queries;

import org.hotrod.runtime.livesql.expressions.predicates.Predicate;
import org.hotrod.runtime.livesql.metadata.TableOrView;

public class DeleteFromPhase implements DMLQuery {

  // Properties

  private LiveSQLContext context;
  private DeleteObject delete;

  // Constructor

  public DeleteFromPhase(final LiveSQLContext context, final TableOrView from) {
    this.context = context;
    this.delete = new DeleteObject();
    this.delete.setFrom(from);
  }

  // Next stages

  public DeleteWherePhase where(final Predicate predicate) {
    return new DeleteWherePhase(this.context, this.delete, predicate);
  }

  // Preview

  @Override
  public String getPreview() {
    return this.delete.getPreview(this.context);
  }

  // Execute

  @Override
  public void execute() {
    this.delete.execute(this.context);
  }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy