Package org.jdbi.v3.core.statement
Enum EmptyHandling
- java.lang.Object
-
- java.lang.Enum<EmptyHandling>
-
- org.jdbi.v3.core.statement.EmptyHandling
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Comparable<EmptyHandling>,java.util.function.BiConsumer<SqlStatement,java.lang.String>
public enum EmptyHandling extends java.lang.Enum<EmptyHandling> implements java.util.function.BiConsumer<SqlStatement,java.lang.String>
describes what should be done if the value passed toSqlStatement.bindList(java.lang.String, java.lang.Object...)is null or empty
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLANKRender nothing in the query.DEFINE_NULLDefine anullvalue, leaving the result up to theTemplateEngineto decide.NULL_KEYWORDRender the keywordnullin the query, useful e.g.THROWThrow IllegalArgumentException.
-
Constructor Summary
Constructors Modifier Constructor Description privateEmptyHandling()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static EmptyHandlingvalueOf(java.lang.String name)Returns the enum constant of this type with the specified name.static EmptyHandling[]values()Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
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
nullin 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
nullvalue, leaving the result up to theTemplateEngineto decide.This value was specifically added to make conditionals work better with
StringTemplate.
-
THROW
public static final EmptyHandling THROW
Throw IllegalArgumentException.
-
-
Method Detail
-
values
public static EmptyHandling[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EmptyHandling c : EmptyHandling.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EmptyHandling valueOf(java.lang.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:
java.lang.IllegalArgumentException- if this enum type has no constant with the specified namejava.lang.NullPointerException- if the argument is null
-
-