Module org.jooq
Package org.jooq

Interface Case


public interface Case
The SQL case statement.

This construct can be used to create expressions of the type


 CASE x WHEN 1 THEN 'one'
        WHEN 2 THEN 'two'
        ELSE        'three'
 END
 
or of the type

 CASE WHEN x < 1  THEN 'one'
      WHEN x >= 2 THEN 'two'
      ELSE            'three'
 END
 
Instances of Case are created through the DSL.decode() method
Author:
Lukas Eder
  • Method Details

    • value

      @NotNull @Support <V> @NotNull CaseValueStep<V> value(V value)
      This construct can be used to create expressions of the type
      
       CASE value WHEN 1 THEN 'one'
                  WHEN 2 THEN 'two'
                  ELSE        'three'
       END
       
      Type Parameters:
      V - The generic value type parameter
      Parameters:
      value - The value to do the case statement on
      Returns:
      An intermediary step for case statement construction
    • value

      @NotNull @Support <V> @NotNull CaseValueStep<V> value(Field<V> value)
      This construct can be used to create expressions of the type
      
       CASE value WHEN 1 THEN 'one'
                  WHEN 2 THEN 'two'
                  ELSE        'three'
       END
       
      Type Parameters:
      V - The generic value type parameter
      Parameters:
      value - The value to do the case statement on
      Returns:
      An intermediary step for case statement construction
    • when

      @NotNull @Support <T> @NotNull CaseConditionStep<T> when(Condition condition, T result)
      This construct can be used to create expressions of the type
      
       CASE WHEN x < 1  THEN 'one'
            WHEN x >= 2 THEN 'two'
            ELSE            'three'
       END
       
      Type Parameters:
      T - The generic field type parameter
      Parameters:
      condition - A condition to check in the case statement
      result - The result if the condition holds true
      Returns:
      An intermediary step for case statement construction
    • when

      @NotNull @Support <T> @NotNull CaseConditionStep<T> when(Condition condition, Field<T> result)
      This construct can be used to create expressions of the type
      
       CASE WHEN x < 1  THEN 'one'
            WHEN x >= 2 THEN 'two'
            ELSE            'three'
       END
       
      Type Parameters:
      T - The generic field type parameter
      Parameters:
      condition - A condition to check in the case statement
      result - The result if the condition holds true
      Returns:
      An intermediary step for case statement construction
    • when

      @NotNull @Support <T> @NotNull CaseConditionStep<T> when(Condition condition, Select<? extends Record1<T>> result)
      This construct can be used to create expressions of the type
      
       CASE WHEN x < 1  THEN 'one'
            WHEN x >= 2 THEN 'two'
            ELSE            'three'
       END
       
      Type Parameters:
      T - The generic field type parameter
      Parameters:
      condition - A condition to check in the case statement
      result - The result if the condition holds true
      Returns:
      An intermediary step for case statement construction
    • when

      @NotNull @Support <T> @NotNull CaseConditionStep<T> when(Field<Boolean> condition, T result)
      This construct can be used to create expressions of the type
      
       CASE WHEN x < 1  THEN 'one'
            WHEN x >= 2 THEN 'two'
            ELSE            'three'
       END
       
      Type Parameters:
      T - The generic field type parameter
      Parameters:
      condition - A condition to check in the case statement
      result - The result if the condition holds true
      Returns:
      An intermediary step for case statement construction
    • when

      @NotNull @Support <T> @NotNull CaseConditionStep<T> when(Field<Boolean> condition, Field<T> result)
      This construct can be used to create expressions of the type
      
       CASE WHEN x < 1  THEN 'one'
            WHEN x >= 2 THEN 'two'
            ELSE            'three'
       END
       
      Type Parameters:
      T - The generic field type parameter
      Parameters:
      condition - A condition to check in the case statement
      result - The result if the condition holds true
      Returns:
      An intermediary step for case statement construction
    • when

      @NotNull @Support <T> @NotNull CaseConditionStep<T> when(Field<Boolean> condition, Select<? extends Record1<T>> result)
      This construct can be used to create expressions of the type
      
       CASE WHEN x < 1  THEN 'one'
            WHEN x >= 2 THEN 'two'
            ELSE            'three'
       END
       
      Type Parameters:
      T - The generic field type parameter
      Parameters:
      condition - A condition to check in the case statement
      result - The result if the condition holds true
      Returns:
      An intermediary step for case statement construction