Problem with JOIN after migration to 3.18

64 views
Skip to first unread message

Simon Martinelli

unread,
Apr 4, 2023, 8:21:17 AM4/4/23
to jOOQ User Group
Hi,

After migrating to 3.18 I get a strange compilation error:

C:\Users\simon\Workspace\Dynasoft\tosca-ui\tosca-standard\src\main\java\ch\tosca\ui\module\basis\M750.java:369:66
java: no suitable method found for on(org.jooq.Condition)
    method org.jooq.impl.JoinTable.on(org.jooq.Condition) is not applicable
      (org.jooq.impl.JoinTable.on(org.jooq.Condition) is defined in an inaccessible class or interface)
    method org.jooq.impl.JoinTable.on(org.jooq.Condition...) is not applicable
      (org.jooq.impl.JoinTable.on(org.jooq.Condition...) is defined in an inaccessible class or interface)
    method org.jooq.impl.JoinTable.on(org.jooq.Field<java.lang.Boolean>) is not applicable
      (org.jooq.impl.JoinTable.on(org.jooq.Field<java.lang.Boolean>) is defined in an inaccessible class or interface)
    method org.jooq.impl.JoinTable.on(org.jooq.SQL) is not applicable
      (argument mismatch; org.jooq.Condition cannot be converted to org.jooq.SQL)
    method org.jooq.impl.JoinTable.on(java.lang.String) is not applicable
      (argument mismatch; org.jooq.Condition cannot be converted to java.lang.String)
    method org.jooq.impl.JoinTable.on(java.lang.String,java.lang.Object...) is not applicable
      (argument mismatch; org.jooq.Condition cannot be converted to java.lang.String)
    method org.jooq.impl.JoinTable.on(java.lang.String,org.jooq.QueryPart...) is not applicable
      (argument mismatch; org.jooq.Condition cannot be converted to java.lang.String)


The code looks like

dsl()
.select(appl.BEZKURZ)
.from(mt.join(appl, JoinType.LEFT_OUTER_JOIN).on(appl.APPL.eq(mt.APPL)))
.where(mt.MODULNAME.equal(modulname))
.fetchOne().value1();

Any idea?

Lukas Eder

unread,
Apr 4, 2023, 8:27:10 AM4/4/23
to jooq...@googlegroups.com
Hi Simon,

Did you re-generate the code with jOOQ 3.18, as well as clean build your code? Could be a binary compatibility issue of an internal API change leaking through the generated classes into your code.

--
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/fad95885-8f95-4be8-920a-5be1186e5145n%40googlegroups.com.

Simon Martinelli

unread,
Apr 4, 2023, 8:49:13 AM4/4/23
to jooq...@googlegroups.com
Hi Lukas,

The code is generated with 3.18.2 and the app uses the same version.


Any idea?

Thanks, Simon

------ Originalnachricht ------
Von "Lukas Eder" <lukas...@gmail.com>
Datum 04.04.2023 14:26:56
Betreff Re: Problem with JOIN after migration to 3.18

Lukas Eder

unread,
Apr 4, 2023, 9:07:20 AM4/4/23
to jooq...@googlegroups.com
I'll have to investigate. I guess the key here is this message:

(org.jooq.impl.JoinTable.on(org.jooq.Condition) is defined in an inaccessible class or interface)

Some visibility problem.

What's the exact JDK version you're using? How did you declare mt?

Simon Martinelli

unread,
Apr 4, 2023, 9:45:06 AM4/4/23
to jooq...@googlegroups.com
Modultosca mt = MODULTOSCA.as("mt");
Applikation appl = APPLIKATION.as("app");
String packagename = repository().dsl()

.select(appl.BEZKURZ)
.from(mt.join(appl, JoinType.LEFT_OUTER_JOIN).on(appl.APPL.eq(mt.APPL)))
.where(mt.MODULNAME.equal(modulname))
.fetchOne().value1();

I'm using temurin-17.0.6


------ Originalnachricht ------
Von "Lukas Eder" <lukas...@gmail.com>
Datum 04.04.2023 15:07:05
Betreff Re: Re[2]: Problem with JOIN after migration to 3.18

You received this message because you are subscribed to a topic in the Google Groups "jOOQ User Group" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/jooq-user/5FqhYFHMhow/unsubscribe.
To unsubscribe from this group and all its topics, send an email to jooq-user+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jooq-user/CAB4ELO4KWBu%3D_kX1TbwCPvE3_81GX3JrnAuA5MsBJkwZAeixGQ%40mail.gmail.com.

Lukas Eder

unread,
Apr 4, 2023, 10:12:13 AM4/4/23
to jooq...@googlegroups.com
OK, thanks. I'll try to reproduce and see why this happens. Workarounds include:

- Using the ordinary leftJoin() method
- Casting the join result back to the API type (TableOnStep<?>)
- Casting mt to (Table<?>) before calling join on it

Lukas Eder

unread,
Apr 4, 2023, 10:22:22 AM4/4/23
to jooq...@googlegroups.com
The TableOnStep cast workaround won't work, but the last one will.
I've created an issue and will fix/backport very soon to 3.18.x:

Thanks again for your report!
Lukas

Simon Martinelli

unread,
Apr 4, 2023, 10:30:01 AM4/4/23
to jooq...@googlegroups.com
Thanks for the workarounds!




------ Originalnachricht ------
Von "Lukas Eder" <lukas...@gmail.com>
Datum 04.04.2023 16:11:59
Betreff Re: Re[4]: Problem with JOIN after migration to 3.18

Lukas Eder

unread,
Apr 4, 2023, 10:43:37 AM4/4/23
to jooq...@googlegroups.com
https://github.com/jOOQ/jOOQ/issues/14906 has been fixed and will be available with the next nightly builds. I'll release 3.18.3 later this week.

Simon Martinelli

unread,
Apr 4, 2023, 11:16:46 AM4/4/23
to jooq...@googlegroups.com
Wow! That was fast 😱

Thanks a lot!

Lukas Eder

unread,
Apr 4, 2023, 11:19:42 AM4/4/23
to jooq...@googlegroups.com
Well, not a nice regression at all, the method was pretty much unusable...

On Tue, Apr 4, 2023 at 5:16 PM Simon Martinelli <simon.ma...@gmail.com> wrote:
Wow! That was fast 😱

Thanks a lot!

--
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.
Reply all
Reply to author
Forward
0 new messages