Skip to content

SimpleFlatMapper v1.10.2

Arnaud Roger edited this page Jul 13, 2015 · 1 revision

SimpleFlatMapper provides fast and easy to use mapper for

It also provides one of the fastest csv parser available.

v1.10.2

Issues

  • better handling of 1 param object type
  • csv escaping of line more consistent when customising end of line

v1.10.1

Issues

  • perf improvement
  • java time and joda time support
  • better configuration support
  • append method now return this

v1.10.0

Issues

  • add csv writer
    CsvWriter<DbObject> csvWriter = CsvWriter.from(DbObject.class).to(writer);
    csvWriter.append(obj1);

v1.9.1

Issues

  • fix concurrency bug on join and discriminator mapper.

v1.9.0

Issues

  • 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

v1.8.1

Issues

  • add Map, ?> mapping support
  • better handling of generic parameter
  • handle custom list/map impl

v1.8.0

Issues

  • add optional support
  • add java 8 time support
  • add factory method support
  • better customisation of timezones and date formatter for joda and java8 time

v1.7.7

Issues

  • 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

v1.7.6

Issues

  • disable cell handler asm for parser dsl
  • implement method sharding for better perd with big property number

v1.7.5

Issues

  • fix issue on csv mapper asm handler on object with more than 256 fields
  • add threshold to switch to no asm over when faster

v1.7.4

Issues

  • better csv mapper performance even for non asm
  • use asm csv handler see #116 benchmark results*
  • beef up javadoc

v1.7.3

Issues

  • 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

v1.7.2

Issues

  • fix issue with constructor injection and no asm
  • check for null getter only if keys are defined

v1.7.1

Issues

  • 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()

v1.7.0

Issues

  • 1-n join on Csv Mapper
  • jOOL tuple support
  • fasttuple support
  • fix key predicate composition definition

v1.6.1

Issues

  • 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);

v1.6.0

Issues

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

v1.5.4

Issues

  • 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");

v1.5.3

Issues

  • support for easier generic type resolving with TypeReference support
  • better toString output on columnDefinition, column keys and mapper

v1.5.2

Issues

  • add tuples for 2 to 32
  • better signature for row handler

v1.5.1

Issues

  • Better generic support for TypeVariable
  • add support for ignore
  • add forEach on CsvParser DSL

v1.5.0

Issues 1.5.0

  • 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))

v1.4.1

Issues 1.4.1

Issues 1.4.0

Csv

  • 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"));

JdbcMapper

  • Joda DateTime, LocalDate, LocalTime, LocalDateTime supports
  • can specify CsvColumnDefinition via a predicate
JdbcMapperFactory
    .newInstance()
    .addColumnDefinition(
        (k) -> k.getName().endsWith("_date"), 
        columnDefinition)
    ).newMapper(MyObject.class)

v1.3.0

Issues

CsvMapper

  • 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);

JdbcMapper

  • allow for getter customisation
JdbcMapperFactory.newInstance().addCustomGetter("id", getter).newMapper(MyClass.class);

Mapping

  • support java lang type as root object
CsvParser.mapTo(String.class).stream(reader);

Sql2o integration

Query query = sql2o.open().createQuery("select * from table");
query.setResultSetHandlerFactoryBuilder(new SfmResultSetHandlerFactoryBuilder());
List<DbObject> dbObjects = query.executeAndFetch(DbObject.class);

v1.2.0

Issues

CsvMapper

Reflection

  • detect class loader visibility issues automatically
  • fix issue with instantiator cache

Osgi

  • 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

JdbcMapper

  • allow change of row handler error handler

v1.1.0

Issues

  • 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

v1.0.0

  • move buffer index to charconsumer in csv parser

v1.0.0rc2

  • 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

v1.0.0b3

  • add streams and iterator to jdbc and csv
  • add JPA @Column support

v1.0.0b2

  • support for array of object
  • support mapping sql Array to List

v1.0.0b1

  • 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

v0.9.14

  • 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.

v0.9.12

  • CsvMapper remove performance degradation with TieredCompilation

v0.9.11

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

v0.9.8

  • 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

v0.9.4

  • CsvMapper
  • non boxing mapping
  • constructor injection
  • inner object
  • direct byte parsing

v0.9.3

  • extract common part of MapperBuilder
  • add Query DSL Jdbc support
  • move test to orm-benchmark
Clone this wiki locally