This has been registered as #2333: https://github.com/jOOQ/jOOQ/issues/2333
Note, I'm a bit reluctant of adding more "dynamic SQL" capabilities to the DSL join construction clauses, as join clauses are a bit more complex than just passing another argument, e.g. CROSS JOIN, NATURAL JOIN, JOIN USING, etc. Already today, you can use lists or arrays in the FROM clause and construct joins dynamically, that way. Feel free to make an API suggestion for more dynamic JOIN clauses, though Cheers Lukas 2013/3/13 Lukas Eder <[email protected]> > You're right, it might be useful to some, if "optional" limit / > offset clauses could be added. Do note, that you can use Integer.MAX_VALUE > as a default, instead of null. > > Cheers > Lukas > > > 2013/3/13 Matthias Fuchs <[email protected]> > >> Hi guys, >> >> sometimes I need to alter my sql queries depending on some conditions, >> e.g if maxCount is > -1 then I want to limit the query. >> >> This code unfortunately throws a NullPointerException: >> >> exe.select().from(p.V_PRICE_HISTORY_OVERVIEW) >> .where(conditions) >> .limit((maxCount > -1 ? maxCount : null)).fetch(); >> >> This works in the fetch's where clause but not here. >> >> This actually should work everywhere, in joins, wheres, limits, offsets >> etc. >> >> -- >> 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]. >> For more options, visit https://groups.google.com/groups/opt_out. >> >> >> > > -- 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]. For more options, visit https://groups.google.com/groups/opt_out.
