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/CAB4ELO5wRT_m2QUUrvpZX3phCfsASo-_8PzGq_%3DqA4P2zAbwfw%40mail.gmail.com.

Reply via email to