Class DeleteStatement

java.lang.Object
io.github.torand.fastersql.statement.DeleteStatement
All Implemented Interfaces:
Sql, PreparableStatement

public class DeleteStatement extends Object implements PreparableStatement
Implements a DELETE statement.
  • Method Details

    • where

      public DeleteStatement where(Predicate... predicates)
      Adds one or more predicates to the WHERE clause.
      Parameters:
      predicates - the predicates.
      Returns:
      the modified statement.
    • where

      public final DeleteStatement where(OptionalPredicate... maybePredicates)
      Adds optional predicates to the WHERE clause if the wrapped predicates are present.
      Parameters:
      maybePredicates - the optional predicates.
      Returns:
      the modified statement.
    • whereIf

      @SafeVarargs public final DeleteStatement whereIf(boolean condition, Supplier<Predicate>... predicateSuppliers)
      Adds supplied predicates to the WHERE clause, if the condition is true.
      Parameters:
      condition - the condition.
      predicateSuppliers - the suppliers providing predicates
      Returns:
      the modified statement.
    • sql

      public String sql(Context context)
      Description copied from interface: Sql
      Formats object as an SQL fragment.
      Specified by:
      sql in interface Sql
      Parameters:
      context - the context (incl. dialect).
      Returns:
      the formatted SQL fragment.
    • params

      public Stream<Object> params(Context context)
      Description copied from interface: Sql
      Gets the statement parameters introduced by this fragment.
      Specified by:
      params in interface Sql
      Parameters:
      context - the context (incl. dialect).
      Returns:
      the statement parameters.
    • toString

      public String toString()
      Overrides:
      toString in class Object