As Lukas said, no automatic way can be used. As jooq RecordMapper provider alternative you can use ModelMapper with typemap.
I have faced a similar problem mapping a single table into multiple objects. In your case you have a join but I think it's the same .. You need to: 1 - every query field need to have a unique name 2 - "give a name" for your query 3 - create a ModelMapper map using a typemap, named as your query, between Record.class and your business object. Obviously use modelmapper-jooq integration 4 - manually map your record on objects using typemap (or query) name ModelMapper is a good software but have some strange behaviour when define mapping on interface (and Record.class is an interface) I have posted some problems in this mailing list some time ago. So, if you want save your brain from an headache: 1 - use a full mapping 2 - you need to define a mapping using RecordImpl.class (but you need to make it public) and your business object Il giorno martedì 26 novembre 2013 10:52:16 UTC+1, Lukas Eder ha scritto: > > You can already do that in two steps: > > Author a = record.into(Author.class); > > Book b = record.into(Book.class); > > But the difficulty will be to disambiguate conflicting column names, e.g. > if both tables have an ID column. There is currently no automatic way to > resolve this ambiguity. Note that you could write your own > RecordMapperProvider to add more functionality in this area: > > http://www.jooq.org/doc/3.2/manual/sql-execution/fetching/pojos-with-recordmapper-provider > > 2013/11/25 Darren S <[email protected] <javascript:>> > >> Say I join BOOK w/ AUTHOR, it would be nice to map the result to a Book >> and Author object. I can think of some hacked up ways to do this, but I >> was curious if there was any type of support for such a thing or even if >> somebody has done a similar thing. >> > -- You received this message because you are subscribed to the Google Groups "jOOQ User Group" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.
