Annotation Type BindBeanList


@Retention(RUNTIME) @Target(PARAMETER) public @interface BindBeanList
Binds each property for each value in the annotated Iterable or array/varargs argument, and defines a named attribute as a comma-separated list of each bound parameter name. Used to create query similar to: select * from things where (id, name) in ((1,'abc'),(2,'def'),(3,'ghi'))
 @SqlQuery("select * from things where (id, name) in (<keys>)")
 List<Thing> getThings(@BindBeanList(value = "keys", propertyNames = {"id", "name"}) ThingKey... thingKeys)
 

Throws IllegalArgumentException if the argument is not an array or Iterable.

  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The list of properties to invoke on each element in the argument
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    The attribute name to define.
  • Element Details

    • propertyNames

      String[] propertyNames
      The list of properties to invoke on each element in the argument
      Returns:
      the property names
    • value

      String value
      The 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:
      ""