Thanks for the hint. We'll look into documenting <fluentSetters/> in the manual as well: https://github.com/jOOQ/jOOQ/issues/9376
On Tue, Oct 15, 2019 at 1:27 PM Jens Teglhus Møller <[email protected]> wrote: > Hi Lukas > > Thanks a lot. I think fluentSetters will work well for me, then I will > just skip using JPA classes and just use the record classes. > > The fluentSetters configuration option is missing from the manual, is > seems like it got lost somewhere between 3.8.0 and 3.9.0 release (I did > look for an option to generate fluent Records in the documentation but only > for the latest version ;-). > > There is a link to the xsd where it is specified though ( > http://www.jooq.org/xsd/jooq-codegen-3.12.0.xsd) but it is a bit hard to > find. > > Best regards Jens > > On Tuesday, October 15, 2019 at 11:41:47 AM UTC+2, Lukas Eder wrote: >> >> Hi Jens, >> >> Thanks for your message. In jOOQ, the @Column annotation is currently >> mandatory when you want to use DefaultRecordMapper to map to JPA annotated >> entities: >> https://github.com/jOOQ/jOOQ/issues/4586 >> >> Do note that jOOQ is not a JPA compliant ORM. We did choose to re-use >> the @Column annotation because its semantics is already clear, but we do >> not support a variety of JPA annotations. >> >> I could also just skip using the JPA classes and just use the Record >>> classes, but I use lombok with @Accessor(chain=true) on my JPA classes and >>> really miss chained setters on the Record classes, could I add that >>> annotation myself with a costum Generator? >> >> >> You can turn on the <fluentSetters/> flag in the code generator to make >> the setters fluent (returning "this"). You could try overriding >> JavaGenerator.generateRecordSetter to add additional annotations before the >> record setters... Not sure if that would solve your problem. >> >> Thanks >> Lukas >> >> On Tue, Oct 15, 2019 at 9:58 AM Jens Teglhus Møller < >> [email protected]> wrote: >> >>> Hi >>> >>> As a follow up to some of my earlier questions regarding using >>> SpringPhysicalNamingStrategy when generating using JPADatabase I'm now >>> facing problems with record mapping my JPA classes. >>> >>> When using the SpringPhysicalNamingStrategy a field named myField is >>> mapped to column my_field which the DefaultRecordMapper will not match >>> correctly (since I do not annotate using @Column(name="my_field")). >>> >>> I tried to run the generator with jpaAnnotations=true so the Records get >>> the jpa annotations but it looks like the mapper only looks for the >>> annotations on the JPA classes. >>> >>> Did anyone run into this and have a simple solution? >>> >>> I thought about having locally maintained copies of >>> DefaultRecordMapper/DefaultRecordUnmapper and their providers but I think >>> the field name <-> column name conversion is pretty deeply buried in the >>> code. >>> >>> I could also just skip using the JPA classes and just use the Record >>> classes, but I use lombok with @Accessor(chain=true) on my JPA classes and >>> really miss chained setters on the Record classes, could I add that >>> annotation myself with a costum Generator? >>> >>> Just re-read my post and I can see it's a bit of a rambling but I still >>> hope someone can suggest a way forward :-). >>> >>> Best regards Jens >>> >>> -- >>> 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]. >>> To view this discussion on the web visit >>> https://groups.google.com/d/msgid/jooq-user/a9141887-679e-4b0a-a7c2-5c8bc739d82d%40googlegroups.com >>> <https://groups.google.com/d/msgid/jooq-user/a9141887-679e-4b0a-a7c2-5c8bc739d82d%40googlegroups.com?utm_medium=email&utm_source=footer> >>> . >>> >> -- > 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]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/jooq-user/27fec8bc-0929-4aa3-9c6f-46700e8c9766%40googlegroups.com > <https://groups.google.com/d/msgid/jooq-user/27fec8bc-0929-4aa3-9c6f-46700e8c9766%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO6Y%2BywQ9e58SbmZ5tsmj8uT8GVsxVXp%2BTUdbOdsdML3hw%40mail.gmail.com.
