Interface Predicate

All Superinterfaces:
Sql
All Known Implementing Classes:
And, Eq, ExistsSubquery, Ge, Gt, In, InSubquery, IsNull, Le, Like, Lt, Not, Or

public interface Predicate extends Sql
Defines a restriction on the rows fetched by a SELECT or affected by an UPDATE or DELETE.
  • Method Summary

    Modifier and Type
    Method
    Description
    and(OptionalPredicate optionalOther)
    Creates an optional compound predicate using the boolean operator AND on this predicate and the specified optional predicate.
    default Predicate
    and(Predicate other)
    Creates a compound predicate using the boolean operator AND on this predicate and the specified predicate.
    Formats negated predicate as an SQL fragment.
    or(OptionalPredicate optionalOther)
    Creates an optional compound predicate using the boolean operator OR on this predicate and the specified optional predicate.
    default Predicate
    or(Predicate other)
    Creates a compound predicate using the boolean operator OR on this predicate and the specified predicate.

    Methods inherited from interface io.github.torand.fastersql.sql.Sql

    aliasRefs, columnRefs, params, sql
  • Method Details

    • negatedSql

      String negatedSql(Context context)
      Formats negated predicate as an SQL fragment.
      Parameters:
      context - the context (incl. dialect).
      Returns:
      the formatted SQL fragment.
    • or

      default Predicate or(Predicate other)
      Creates a compound predicate using the boolean operator OR on this predicate and the specified predicate.
      Parameters:
      other - the other predicate.
      Returns:
      the compound predicate.
    • or

      default OptionalPredicate or(OptionalPredicate optionalOther)
      Creates an optional compound predicate using the boolean operator OR on this predicate and the specified optional predicate.
      Parameters:
      optionalOther - the other optional predicate
      Returns:
      the optional compound predicate.
    • and

      default Predicate and(Predicate other)
      Creates a compound predicate using the boolean operator AND on this predicate and the specified predicate.
      Parameters:
      other - the other predicate.
      Returns:
      the compound predicate.
    • and

      default OptionalPredicate and(OptionalPredicate optionalOther)
      Creates an optional compound predicate using the boolean operator AND on this predicate and the specified optional predicate.
      Parameters:
      optionalOther - the other optional predicate
      Returns:
      the optional compound predicate.