Package org.jdbi.v3.sqlobject.customizer
Annotation Type BindMethodsList
Binds each method for each value in the annotated
Iterable
or array/varargs argument,
and defines a named attribute as a comma-separated list of each bound method name.
Used to create query similar to:
insert into things (id, name) values (1,'abc'),(2,'def'),(3,'ghi')
@SqlQuery("insert into things (id, name) values <items>") List<Thing> saveThings(@BindMethodsList(value = "items", methodNames = {"getId", "getName"}) Thing... things)
Throws IllegalArgumentException if the argument is not an array or Iterable.
-
Optional Element Summary
Modifier and TypeOptional ElementDescriptionString[]
The list of methods to invoke on each element in the argumentThe attribute name to define.
-
Element Details
-
value
String valueThe attribute name to define. If omitted, the name of the annotated parameter is used. It is an error to omit the name when there is no parameter naming information in your class files.- Returns:
- the attribute name
- Default:
- ""
-
methodNames
String[] methodNamesThe list of methods to invoke on each element in the argument- Returns:
- the method names
- Default:
- {}
-