Skip to content

Instantly share code, notes, and snippets.

@horte
Last active December 20, 2015 06:38
Show Gist options
  • Save horte/6086939 to your computer and use it in GitHub Desktop.
Save horte/6086939 to your computer and use it in GitHub Desktop.
Example using MySQL IN statements with JDBI
@UseStringTemplate3StatementLocator
public interface ModelDao {
@RegisterMapper(ModelPropertyMapper.class)
@SqlQuery("select * from model_property where model_id in ( <modelIds> )")
public List<ModelProperty> findModelPropertiesByModelIds(@BindIn("modelIds") Collection<Long> modelIds);
}
@horte
Copy link
Author

horte commented Jul 26, 2013

<dependency>
  <groupId>org.antlr</groupId>
  <artifactId>stringtemplate</artifactId>
  <version>3.2.1</version>
</dependency>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment