arnaudroger / SimpleFlatMapper

Fast and Easy mapping from database and csv to POJO. A java micro ORM, lightweight alternative to iBatis and Hibernate. Fast Csv Parser and Csv Mapper
http://simpleflatmapper.org
MIT License
440 stars 76 forks source link

Issue with Kotlin Pair & Triple #489

Closed juliendangers closed 6 years ago

juliendangers commented 6 years ago

Relates to #488

I'm trying to map some resultsets to different structures using Kotlin Pair and Triple

Pair<A, B> works fine Pair<A, List<B>> fails

Atributes of B are mapped into a List, so rows

A.id A.name B.id B.smthg
1 test 233 ok
1 test 235 azerty

generate 2 elements Pair<A[id=1, name=test], List{233, ok}> Pair<A[id=1, name=test], List{235, azerty}>

You can use the same example project on kotlinPair branch https://github.com/juliendangers/jooq-simpleflatmapper-issues/tree/kotlinPair

the 3rd endpoint which works fine with JooL Tuple2, fails with Kotlin Pair

arnaudroger commented 6 years ago

Thanks again will have a look tonight, I think it might cross over partly with the other ticket and the fact that kotlin list pair are covariant

arnaudroger commented 6 years ago

Looks like it work with the fix for 488

arnaudroger commented 6 years ago

just pushed 3.15.8 to maven central should be available in the next 30 minutes. I believed it fixes all the issue - though you might want to check that the mapping is right -.

juliendangers commented 6 years ago

It works fine, and fixes both issues ! Thank you