Interface CriteriaBuilder.Case<R>

  • All Superinterfaces:
    Expression<R>, Selection<R>, TupleElement<R>
    Enclosing interface:
    CriteriaBuilder

    public static interface CriteriaBuilder.Case<R>
    extends Expression<R>
    Interface used to build general case expressions. Case conditions are evaluated in the order in which they are specified.
    • Method Detail

      • when

        CriteriaBuilder.Case<R> when​(Expression<java.lang.Boolean> condition,
                                     R result)
        Add a when/then clause to the case expression.
        Parameters:
        condition - "when" condition
        result - "then" result value
        Returns:
        general case expression
      • when

        CriteriaBuilder.Case<R> when​(Expression<java.lang.Boolean> condition,
                                     Expression<? extends R> result)
        Add a when/then clause to the case expression.
        Parameters:
        condition - "when" condition
        result - "then" result expression
        Returns:
        general case expression
      • otherwise

        Expression<R> otherwise​(R result)
        Add an "else" clause to the case expression.
        Parameters:
        result - "else" result
        Returns:
        expression
      • otherwise

        Expression<R> otherwise​(Expression<? extends R> result)
        Add an "else" clause to the case expression.
        Parameters:
        result - "else" result expression
        Returns:
        expression