Skip to content
Advertisement

Use BeanMapper from within a RowMapper?

I’m using JDBI’s SQL Objects declarative API to map an object containing a one-to-many relationship:

JavaScript

Initially it looked like a RowReducer would be ideal:

JavaScript

However I soon discovered that RowReducers don’t work with ResultIterators (I’m working with a large database so it’s important to be able to stream these) so now I’m reverting back to implementing a RowMapper instead. I’d still like to use the handy BeanMappers built into JDBI though but I can’t figure out how to access them from within my RowMapper implementation.

JavaScript

Is it possible to easily use BeanMappers from within a RowMapper so I don’t have to manually construct the beans?

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement