org.sfm.jdbc.spring.README.md Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simpleFlatMapper Show documentation
Show all versions of simpleFlatMapper Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
JdbcTemplate
-----
See [JdbcTemplateMapperFactoryTest](/src/test/java/org/sfm/jdbc/spring/JdbcTemplateMapperFactoryTest.java) for more examples.
```java
class MyDao {
private final JdbcTemplateMapper mapper =
JdbcTemplateMapperFactory.newInstance().newMapper(DbObject.class);
public void doSomething() {
List results = template.query(DbHelper.TEST_DB_OBJECT_QUERY, mapper);
}
public void doSomethingElse() {
template
.query(TEST_DB_OBJECT_QUERY,
mapper.newResultSetExtractor((o) -> System.out.println(o.toString())));
}
}
```