Skip to content
Advertisement

How to resolve ambiguous match when chaining generated Jooq classes

I have defined my models in JPA and am writing some queries for my application and I am using JOOQ generated classes to join all the tables together to check if the requested resources actually belong to the requesting user.

However, when I do this I get the following warning:

This is my code

This is the SQL it generates

Given that JOOQ is generating the SQL I’d expect it to be able to understand it without throwing an error. What am I missing? How do I do configure/query/whatever to resolve the SQLWarning?

UPDATE

After playing around I’ve identified the source of the issue.

THING_BUCKET is sub-type of BUCKET so that THING_BUCKET.ID = BUCKET.ID

if I rewrite the query to I get the same results, but without the error

So what I would like to be able to do is go

and join my THING directly to the BUCKET rather then the THING_BUCKET, but I do not know how to accomplish this with the generated classes.

Advertisement

Answer

This looks like a bug that has been fixed in jOOQ 3.14, see #8659, #10603

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement