Hey all,

Is it possible in Jooq to generate something like the following:

    (select * from foo where user_name  like '%mark%' union select * from foo 
where user_name  like '%greg%') limit 1;


`.union()` on Jooq's `Select` class just returns another `Select` which doesn't 
seem to have a `.limit()` function, there is `org.jooq.ResultQuery#maxRows` but 
that ( according to the java doc ) doesn't produce a `LIMIT` clause...

Ideally, I want to call something like:

    select.limit(1).fetchOptional().map(....)

without going into a stream().findFirst() and worrying about leaky connections 
from streams...

Is this possible at all?

Cheers
Mark




---
"The ease with which a change can be implemented has no relevance at all to 
whether it is the right change for the (Java) Platform for all time." — 
Mark Reinhold.

Mark Derricutt
http://www.theoryinpractice.net
http://www.chaliceofblood.net
http://plus.google.com/+MarkDerricutt
http://twitter.com/talios
http://facebook.com/mderricutt

-- 
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/d/optout.

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to