Support for MySQL straight_join

53 views
Skip to first unread message

kix...@gmail.com

unread,
May 12, 2015, 4:56:09 AM5/12/15
to jooq...@googlegroups.com
Hi all,

Is there any support in jooq for generating a STRAIGHT_JOIN clause for MySQL?

Thank you,
Christian

Lukas Eder

unread,
May 12, 2015, 5:02:06 AM5/12/15
to jooq...@googlegroups.com
Hello,

No, we don't currently support this join method out-of-the-box. I have registered a feature request to add support in a future version:

In the mean time, you can use jOOQ's plain SQL templating capabilites for this. E.g.:

DSL.table("{0} straight_join {1} on {2}", LEFT_TABLE, RIGHT_TABLE, predicate);

I hope this helps,
Lukas

--
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.
For more options, visit https://groups.google.com/d/optout.

Lukas Eder

unread,
May 12, 2015, 11:18:50 AM5/12/15
to jooq...@googlegroups.com
Hmm, in fact, I was talking about T1 STRAIGHT_JOIN T2, which is useful if you want to specify the straight join strategy for only two individual tables. If you want to apply "straight joining" for all your joined tables, you can pass the "STRAIGHT_JOIN" hint to jOOQ's "hint()" clause:

select(A, B, C)
.hint("STRAIGHT_JOIN")
.from(...)
.join(...)
.fetch();

This is already available today

Cheers,
Lukas
Reply all
Reply to author
Forward
0 new messages