Hi,

Thank you very much for your suggestion. Indeed, the overhead of creating
an intermediary Record should be avoided. The main reason why it currently
cannot is because of the RecordListener SPI semantics, which guarantees
that any Record ever fetched by jOOQ passes through this SPI. The
fetchResultSet() method that you're mentioning is breaking this assumption.

There's a pending issue for jOOQ 3.11, which will address this
https://github.com/jOOQ/jOOQ/issues/6544

The new default behaviour will be to bypass intermediary Record types if no
RecordListeners are registered in the Configuration. There are quite a few
API methods that can then be optimised for most users.

Right now, I'm afraid you have to resort to writing your own utility to get
the ResultSetMapper semantics.

I hope this helps,
Lukas

2017-10-02 19:59 GMT+02:00 <[email protected]>:

> Hi,
>
> To fetch a query as custom type using RecordMapper, an intermediary Record
> object has to be created and discarded for each row:
>
> ResultSet row -> Record -> mapped to custom type
>
>
> This adds unnecessary overhead.
>
> Is there a way to map the JDBC ResultSet directly?
>
> fetchResultSet works but I'm looking for something that fits into JOOQ's
> (excellent) fluent API.
>
> Something like
>
> List<T> fetch(ResultSetMapper<T>)
>
> Where ResultSetMapper<T> has a single method and can be registered like
> RecordMapper.
>
> T map(ResultSet, Field[] fields) throws SQLException;
>
> Thanks!
>
> --
> 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.
>

-- 
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.

Reply via email to