Package org.jdbi.v3.sqlobject.customizer
Annotation Type BindList
-
@Retention(RUNTIME) @Target(PARAMETER) public @interface BindListBinds each value in the annotatedIterableor array/varargs argument, and defines a named attribute as a comma-separated list of each bound parameter name. Common use cases:@SqlQuery("select * from things where id in (<ids>)") List<Thing> getThings(@BindList int... ids) @SqlUpdate("insert into things (<columnNames>) values (<values>)") void insertThings(@DefineList List<String> columnNames, @BindList List<Object> values)Throws IllegalArgumentException if the argument is not an array or Iterable. How null and empty collections are handled can be configured with onEmpty:EmptyHandling - throws IllegalArgumentException by default.
-
-
Optional Element Summary
Optional Elements Modifier and Type Optional Element Description BindList.EmptyHandlingonEmptyWhat to do when the argument is null or empty.java.lang.StringvalueThe attribute name to define.
-
-
-
-
onEmpty
BindList.EmptyHandling onEmpty
What to do when the argument is null or empty.- Returns:
- The strategy for handling an empty list. By default, throw an
IllegalArgumentException. - See Also:
BindList.EmptyHandling
- Default:
- org.jdbi.v3.sqlobject.customizer.BindList.EmptyHandling.THROW
-
-