Hello Stéphane, Quite possibly, jOOQ's DefaultRecordMapper doesn't behave exactly like JPA - we don't have integration tests verifying this. If you're using JavaBeans-compliant getters and setters (with @Column annotations), then you'll be on the safe side. Of course, you can have all sorts of other methods on the target type, which will simply be ignored by the DefaultRecordMapper.
There's a pending feature request to populate also non-public member fields, including those inherited from a super-type: https://github.com/jOOQ/jOOQ/issues/3614 Obviously, the member discovery algorithm will be slower, once we add features in that area. Combined with a package-private default constructor this offers a nice way > to implement row-level logic. As an example, you may prefer using a method > such as setInterval(start, end) rather than letting users modify start and > end dates individually. Interesting, could you show a concrete example? What do you think could be done in jOOQ? Cheers Lukas 2014-09-17 21:10 GMT+02:00 Stéphane Cl <[email protected]>: > Hello, > From the API documentation of Record.into(Type): > http://www.jooq.org/javadoc/3.4.x/org/jooq/Record.html#into-E- > > If a default constructor is available and any JPA Column annotations are > found on the provided type, only those are used: > > - If type contains public single-argument instance methods annotated > with Column, those methods are invoked > - If type contains public no-argument instance methods starting with > getXXX or isXXX, annotated with Column, then matching public setXXX() > instance > methods are invoked > - If type contains public instance member fields annotated with Column, > those members are set > > > From there, is it correct to assume that the target type can't be much > more than a typical bag of public getters and setters? > > Some frameworks such as Hibernate are able to populate non-public member > fields. Combined with a package-private default constructor this offers a > nice way to implement row-level logic. As an example, you may prefer using > a method such as setInterval(start, end) rather than letting users modify > start and end dates individually. > > Kind regards > > -- > 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/d/optout. > -- 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/d/optout.
