Enum 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 ()


      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)


      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.
      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.)
      name - the name of the enum constant to be returned.
      the enum constant with the specified name
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null