-
Notifications
You must be signed in to change notification settings - Fork 76
SimpleFlatMapper v1.10.3
Arnaud Roger edited this page Jul 14, 2015
·
1 revision
SimpleFlatMapper provides fast and easy to use mapper for
- Micro ORM now with 1-n support!
- Csv Mapper now with 1-n support!
- POI Excel Mapper now with 1-n support!
- Jooq Record Mapper
- Spring JdbcTemplate
- QueryDSL
It also provides one of the fastest csv parser available.
- fix bug on csv non asm error handling
- fix bug on csv parsing date in subobject
- fix bug on csv writing subobject
- better handling of 1 param object type
- csv escaping of line more consistent when customising end of line
- perf improvement
- java time and joda time support
- better configuration support
- append method now return this
- add csv writer
CsvWriter<DbObject> csvWriter = CsvWriter.from(DbObject.class).to(writer);
csvWriter.append(obj1);
- fix concurrency bug on join and discriminator mapper.
- excel POI support see javadoc
- better handling of generic types
- big refactor to make it easier to create new mapper factory, builder on pull mapper
- support asm generation on all field mapper builder
- add Map, ?> mapping support
- better handling of generic parameter
- handle custom list/map impl
- add optional support
- add java 8 time support
- add factory method support
- better customisation of timezones and date formatter for joda and java8 time
- add asm class cache for jdbc mapper to avoid generating duplicated classes
- add asm class cache for csv handler to avoid generating duplicated classes
- reenable the asm handler generation with CsvParser DSL
- disable cell handler asm for parser dsl
- implement method sharding for better perd with big property number
- fix issue on csv mapper asm handler on object with more than 256 fields
- add threshold to switch to no asm over when faster
- better csv mapper performance even for non asm
- use asm csv handler see #116 benchmark results*
- beef up javadoc
- use speculative match on tuple and list, if no index are present will try map the prefix to the first available index
p_id, p_name, s_id, s_name
for a Tuple2 p will be associated to the first element and s to the second.
- does not wrap non runtime exception anymore use erasure trick to pass them through
- change all the package to optional in maven config, and made asm non optional
- fix issue with constructor injection and no asm
- check for null getter only if keys are defined
- 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