brianm/jdbi — pull request #105 by jacksingleton (2014-06-14 01:40:57+00:00)
Title: Bind collection

The current @BindIn annotation is useful for when you want to use a collection of values in an IN statement, but does not allow us to further customize a complicated query.

This hit us when we tried to query for entities matching one or more of a set of free form tags (joined from an 'entity_tags' table)

This pr adds a @BindCollection annotation that makes these complicated queries possible.

You can use StringTemplate to iterate though collection items any way you want:

'''
where
value like
}>
'''

translates roughly into:

'''
where
value like :v1
OR value like :v2
OR value like :v3
'''