Enum EmptyHandling

java.lang.Object
java.lang.Enum<EmptyHandling>
org.jdbi.v3.core.statement.EmptyHandling
All Implemented Interfaces:
Serializable, Comparable<EmptyHandling>, BiConsumer<SqlStatement,String>

public enum EmptyHandling extends Enum<EmptyHandling> implements BiConsumer<SqlStatement,String>
describes what should be done if the value passed to SqlStatement.bindList(java.lang.String, java.lang.Object...) is null or empty
  • Enum Constant Details

    • BLANK

      public static final EmptyHandling BLANK

      Render nothing in the query.

      select * from things where x in ()

    • NULL_KEYWORD

      public static final EmptyHandling NULL_KEYWORD

      Render the keyword null in the query, useful e.g. in postgresql where "in ()" is invalid syntax.

      select * from things where x in (null)

    • DEFINE_NULL

      public static final EmptyHandling DEFINE_NULL

      Define a null value, leaving the result up to the TemplateEngine to decide.

      This value was specifically added to make conditionals work better with StringTemplate.

    • THROW

      public static final EmptyHandling THROW
      Throw IllegalArgumentException.
  • Method Details

    • values

      public static EmptyHandling[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static EmptyHandling valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null