java.lang.Object
org.springframework.data.relational.core.sql.In
All Implemented Interfaces:
Condition, Expression, Segment, Visitable

public class In extends Object implements Condition
IN Condition clause.
Since:
1.1
Author:
Jens Schauder, Mark Paluch
  • Method Details

    • create

      public static In create(Expression columnOrExpression, Expression arg)
      Creates a new In Condition given left and right Expressions.
      Parameters:
      columnOrExpression - left hand side of the Condition must not be null.
      arg - right hand side (collection Expression) must not be null.
      Returns:
      the In Condition.
    • create

      public static In create(Expression columnOrExpression, Collection<? extends Expression> expressions)
      Creates a new In Condition given left and right Expressions.
      Parameters:
      columnOrExpression - left hand side of the Condition must not be null.
      expressions - right hand side (collection Expression) must not be null.
      Returns:
      the In Condition.
    • create

      public static In create(Expression columnOrExpression, Expression... expressions)
      Creates a new In Condition given left and right Expressions.
      Parameters:
      columnOrExpression - left hand side of the Condition must not be null.
      expressions - right hand side (collection Expression) must not be null.
      Returns:
      the In Condition.
    • createNotIn

      public static In createNotIn(Expression columnOrExpression, Expression arg)
      Creates a new In Condition given left and right Expressions.
      Parameters:
      columnOrExpression - left hand side of the Condition must not be null.
      arg - right hand side (collection Expression) must not be null.
      Returns:
      the In Condition.
    • createNotIn

      public static In createNotIn(Expression columnOrExpression, Collection<? extends Expression> expressions)
      Creates a new In Condition given left and right Expressions.
      Parameters:
      columnOrExpression - left hand side of the Condition must not be null.
      expressions - right hand side (collection Expression) must not be null.
      Returns:
      the In Condition.
    • createNotIn

      public static In createNotIn(Expression columnOrExpression, Expression... expressions)
      Creates a new In Condition given left and right Expressions.
      Parameters:
      columnOrExpression - left hand side of the Condition must not be null.
      expressions - right hand side (collection Expression) must not be null.
      Returns:
      the In Condition.
    • not

      public Condition not()
      Description copied from interface: Condition
      Creates a Condition that negates this Condition.
      Specified by:
      not in interface Condition
      Returns:
      the negated Condition.
    • hasExpressions

      public boolean hasExpressions()
      Returns:
      true if this condition has at least one expression.
      Since:
      2.1
    • toString

      public String toString()
      Description copied from interface: Segment
      Return a SQL string representation of this Segment.

      The representation is intended for debugging purposes and an approximation to the generated SQL. While it might work in the context of a specific dialect, you should not assume that the Segment.toString() representation works across multiple databases.

      Specified by:
      toString in interface Segment
      Returns:
      a SQL string representation of this Segment.
    • isNotIn

      public boolean isNotIn()
    • visit

      public void visit(Visitor visitor)
      Description copied from interface: Visitable
      Accept a Visitor visiting this Visitable and its nested Visitables if applicable.
      Specified by:
      visit in interface Visitable
      Parameters:
      visitor - the visitor to notify, must not be null.
    • hashCode

      public int hashCode()
      Description copied from interface: Segment
      Generate a hash code from thisSegment.

      Hashcode typically derives from the Segment.toString() representation so two Segments yield the same Segment.hashCode() if their Segment.toString() representation matches.

      Specified by:
      hashCode in interface Segment
      Overrides:
      hashCode in class Object
      Returns:
      a hash code value for this object.
    • equals

      public boolean equals(Object obj)
      Description copied from interface: Segment
      Check whether this Segment is equal to another Segment.

      Equality is typically given if the Segment.toString() representation matches.

      Specified by:
      equals in interface Segment
      Overrides:
      equals in class Object
      Parameters:
      obj - the reference object with which to compare.
      Returns:
      true if this object is the same as the other argument; false otherwise.