Simple Flat Mapper (SFM) Release Notes
SimpleFlatMapper is a library that provide
- performant
- easy to use
- flexible mappers and abstraction to create pull mappers easily.
The main module provides support for
The CsvParser included is also one of the fastest available in java.
There are also modules to support integration with external libraries
The mappers supports
- Constructor injection
- Method injection
- Field injection
- ASM acceleration
- Sub Object Mapping
- Tuple support including jOOL tuples ans Fasttuple
- List and Array mapping
- No configuration needed
See Property Mapping Wiki for more details.
If you encounter any problem with the mapping don't hesitate to create an issue.
Module | ||
---|---|---|
Cassandra Datastax driver | ||
jOOQ | ||
Poi Excel Spreadsheet | ||
Query DSL | ||
Spring JDBC | ||
SQL2o, no java6 |
The binaries are available in maven central. There is a build for
<dependency>
<groupId>org.simpleflatmapper</groupId>
<artifactId>sfm</artifactId>
<version>2.5.2</version>
</dependency>
<dependency>
<groupId>org.simpleflatmapper</groupId>
<artifactId>sfm</artifactId>
<version>2.5.2</version>
<classifier>jdk17</classifier>
</dependency>
<dependency>
<groupId>org.simpleflatmapper</groupId>
<artifactId>sfm</artifactId>
<version>2.5.2</version>
<classifier>jdk16</classifier>
</dependency>
public class MyDao {
JdbcMapper<MyObject> mapper =
JdbcMapperFactory.newInstance().newMapper(MyObject.class);
public List<MyObject> findAll() throws SQLException {
try (Connection conn = getConnection();
PreparedStatement ps = conn.prepareStatement("select * from my_table");
ResultSet rs = ps.executeQuery();) {
return mapper.stream(rs).collect(Collectors.toList());
}
}
}
CsvParser
.separator('\t')
.mapTo(MyObject.class)
.stream(reader)
.forEach(System.out::println);
The build is using Maven.
git clone https://github.com/arnaudroger/SimpleFlatMapper.git
cd SimpleFlatMapper
mvn install