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.
