Indeed, the JDK's Stream API doesn't offer any way to create chunks /
substreams based on chunk sizes. Perhaps, you might find some appropriate
abstraction in jOO╬╗

But really, an imperative approach based on the org.jooq.Cursor type might
be the easiest way forward. fetchLazy() produces a Cursor but doesn't
actually fetch anything yet. You can then call appropriate methods on the
Cursor, including Cursor.fetchNext(int):

I hope this helps,

2018-03-13 17:55 GMT+01:00 LMey <>:

> Thank you. Alright so AFAIK, maybe besides fiddling with the spliterator,
> there's no straightforward way of processing chunks from a stream. I guess
> I'd better be off working with a Cursor directly. I've seen fetchLazy does
> not accept a RecordMapper callback. Is there any way of using one when
> lazily fetching ? I haven't seen anything in the doc and I'd like to avoid
> a RecordN leaking from my repository.

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 
For more options, visit

Reply via email to