Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

What is the right way to fetch ambiguous columns when joining multiple tables?

14 views
Skip to first unread message

Humaid Kidwai

unread,
Oct 11, 2024, 4:07:26 AM10/11/24
to jOOQ User Group
I went through the relevant GitHub issues discussing this problem since 2015 but I still do not understand how can I fetch columns into corresponding generated POJOs without any ambiguity? The last option is to alias every column but that will make the code not only prone to errors if I miss aliasing a field somewhere across the large codebase but also make the codebase very dirty

Lukas Eder

unread,
Oct 11, 2024, 4:09:41 AM10/11/24
to jooq...@googlegroups.com
Assuming you want to use reflective mapping, I think the DefaultRecordMapper describes all your options well enough, including aliasing or JPA annotations:

The key to understanding here is that there's no such thing as "without any ambiguity" when you map to POJOs, because POJOs do not have any notion of table/column association to them.



On Fri, Oct 11, 2024 at 10:07 AM Humaid Kidwai <humaid....@gmail.com> wrote:
I went through the relevant GitHub issues discussing this problem since 2015 but I still do not understand how can I fetch columns into corresponding generated POJOs without any ambiguity? The last option is to alias every column but that will make the code not only prone to errors if I miss aliasing a field somewhere across the large codebase but also make the codebase very dirty

--
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 jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/3509a8f1-ef34-42b9-9ef6-d5bbbf575552n%40googlegroups.com.

Lukas Eder

unread,
Oct 15, 2024, 4:19:18 AM10/15/24
to jOOQ User Group
For the record, the question was cross-posted here, I suspect:
Reply all
Reply to author
Forward
0 new messages