原文:http://gist.github.com/horte/6086939
@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); }
pom.xml添加:
<dependency>
<groupId>org.antlr</groupId>
<artifactId>stringtemplate</artifactId>
<version>3.2.1</version>
</dependency>