-
Notifications
You must be signed in to change notification settings - Fork 76
SimpleFlatMapper v1.7.1
Arnaud Roger edited this page Mar 13, 2015
·
1 revision
SimpleFlatMapper provides fast and easy to use mapper for
- ResultSet aka micro ORM now with 1-n support!
- Csv now with 1-n support!
- Jooq
- SpringJdbcTemplate
- QueryDSL
It also provides one of the fastest csv parser available.
- travis build with fattuple revealed potential issue with internal janino field.
- public field asm support
- possibility to define keys on CsvParser DSL
List<Professor> list =
CsvParser.mapTo(Professor.class)
.addKeys("id", "students_id")
.forEach(reader, new ListHandler<Professor>()).getList()
- 1-n join on Csv Mapper
- jOOL tuple support
- fasttuple support
- fix key predicate composition definition
- 1-n join with tuple as root
JdbcMapper<Tuple2<Professor, List<Student>>> mapper =
JdbcMapperFactory
.newInstance()
.addKeys("0_id", "1_id") // specify the keys to aggregate on and detect null
.newMapper(new TypeReference<Tuple2<Professor, List<Student>>>() {});
- allow predicate on key to decide on the level it applies to.
JdbcMapper<Person> mapper = JdbcMapperFactory.newInstance()
.addColumnDefinition(
(key) -> key.getIndex() <= 2,
FieldMapperColumnDefinition.<JdbcColumnKey, ResultSet>key(
(pm) -> pm.getPath().startsWith("key.")
))
.newMapper(Person.class);
JdbcMapper<Professor> mapper =
JdbcMapperFactory
.newInstance()
.addKeys("id", "students_id") // specify the keys to aggregate on and detect null
.newMapper(Professor.class);
- inheritance support
JdbcMapper<JoinJdbcMapperTest.Person> mapper =
JdbcMapperFactoryHelper.asm()
.addKeys("id", "students_id")
.<JoinJdbcMapperTest.Person>newDiscriminator("person_type")
.when("student", JoinJdbcMapperTest.StudentGS.class)
.addMapping("person_type")
.addMapping("id")
.addMapping("name")
.when("professor", JoinJdbcMapperTest.ProfessorGS.class)
.mapper();
- some bug fixes
- fix bug on csv parser with last cell if contains only one char
- better support for direct read type as root - String, Enum etc ...-
- 1-N support on jdbc mapper for setter and field injection path
JdbcMapper<ProfessorField> mapper = JdbcMapperFactory.newInstance()
.newBuilder(ProfessorField.class)
.addMapping("id")
.addMapping("name")
.addMapping("students_id")
.addMapping("students_name")
.joinOn("id");
- support for easier generic type resolving with TypeReference support
- better toString output on columnDefinition, column keys and mapper
- add tuples for 2 to 32
- better signature for row handler
- Better generic support for TypeVariable
- add support for ignore
- add forEach on CsvParser DSL
- Change groupId to org.simpleflatmapper
JdbcMapper
- check null only id result return 0
- Calendar support
- support custom getter factory on column definition
- easier column definition composition
FieldMapperColumnDefinition.<JdbcColumnKey,ResultSet>identity()
.addRename("blop")
.addGetter(getter)
.addFieldMapper(fieldMapper)
.addGetterFactory(getterFactory)
CsvMapper
- Calendar support
- Timezone setting support
- support CellValueReaderFactory on column definition
- easier column definition composition
CsvColumnDefinition.IDENTITY
.addDateFormat("yyyyMM")
.addRename("new_name")
.addCustomReader(reader)
.addCustomCellValueReaderFactory(cellValueReaderFactory)
.addTimeZone(tz);
- can add column definition on Parser DSL
// dynamic mapper
CsvParser.mapTo(String.class, String.class)
.columnDefinition("1", CsvColumnDefinition.customReaderDefinition(cellReader));
// static mapper
CsvParser.mapTo(String.class, String.class)
.addMapping("0")
.addMapping("1", CsvColumnDefinition.customReaderDefinition(cellReader))
- Joda DateTime, LocalDate, LocalTime, LocalDateTime supports
- can provide on CellValueReaderFactory
- can specify CsvColumnDefinition via a predicate
CsvMapperFactory
.newInstance()
.addColumnDefinition(
(k) -> k.getName().endsWith("_date"),
CsvColumnDefinition.dateFormatDefinition("yyyyMMdd")
).newMapper(MyObject.class)
- add convenience method to override the headers
CsvParser
.mapTo(String.class, String.class)
.overrideWithDefaultHeaders()
.iterate(new StringReader("key,value\nvalue1,value2"));
CsvParser.mapTo(String.class, String.class)
.defaultHeaders()
.iterate(new StringReader("value1,value2"));
- Joda DateTime, LocalDate, LocalTime, LocalDateTime supports
- can specify CsvColumnDefinition via a predicate
JdbcMapperFactory
.newInstance()
.addColumnDefinition(
(k) -> k.getName().endsWith("_date"),
columnDefinition)
).newMapper(MyObject.class)
- allow for field customisation date format or custom reader
CsvMapperFactory
.newInstance()
.addColumnDefinition("date", CsvColumnDefinition.dateFormatDefinition("yyyyMMdd")
.newMapper(MyClass.class);
CsvMapperFactory.newInstance()
.newBuilder(MyClass.class)
.addMapping("date", CsvColumnDefinition.dateFormatDefinition("yyyyMMdd")
.mapper();
- support tuple on the csv dsl
CsvParser.mapTo(String.class, Date.class).stream(reader);
- allow for getter customisation
JdbcMapperFactory.newInstance().addCustomGetter("id", getter).newMapper(MyClass.class);
- support java lang type as root object
CsvParser.mapTo(String.class).stream(reader);
Query query = sql2o.open().createQuery("select * from table");
query.setResultSetHandlerFactoryBuilder(new SfmResultSetHandlerFactoryBuilder());
List<DbObject> dbObjects = query.executeAndFetch(DbObject.class);
- replace non fluent call with fluent dsl see CsvParser How-to-parse-a-csv-file-in-java
- detect class loader visibility issues automatically
- fix issue with instantiator cache
- remove osgi services and activator as now class loader issue automatically detected
- disable asm in osgi as classloader issue of bundles being refresh it's not worth it for now
- allow change of row handler error handler
- tuple support
- support generic type resolution
- index discovery
- customizable separator and quote character for csv parser
- unescaping is now responsibility of the parser
- easier api to use the csv parser directly
- more stable performance accross csv size and version
- move buffer index to charconsumer in csv parser
- add streams and iterator to csvparser
- provide own impl of spliterator for faster streams
- refactor skip and limit for csv for faster parsing and easier maintenance
- add streams and iterator to jdbc and csv
- add JPA @Column support
- support for array of object
- support mapping sql Array to List
- add Jooq Integration
- add support for all resultset return types.
- restructure the packages to make javadoc more readable
- move mapper readme content to their own package
- JdbcMapper if a column is map to a property of object, it will try to look for one argument constructor that matches the column type.
- CsvMapper if a column is map to a property of object, it will use a one argument constructor if it's the only constructor.
- CsvMapper remove performance degradation with TieredCompilation
CsvMapper
- improve performance of unescaping.
- support CR CRLF and LF for end of line.
- handle space in header name.
- fix miss mapping issue when a mapping error occured.
- change default parser buffer size
- Asm
- fix concurrency issue that triggered LinkageError
- JdbcMapper
- increase perf to outperform Roma with the static mapper
- change benchmark to match roma result set loop
- fix for custom field mapping and primitive
- CsvMapper
- add dynamic csv mapper that configure it self based on the row
- add support for aliases and custom readers
- ability to customized date format
- add a Parsing Context to store the DateFormat per parsing.
- remove byte array based parsing as benchmark so it would only be rarely lead to perf gain
- fix for custom mapper
- simplify parsing code
- CsvMapper
- non boxing mapping
- constructor injection
- inner object
- direct byte parsing
- extract common part of MapperBuilder
- add Query DSL Jdbc support
- move test to orm-benchmark