A RowMapper for auto-mapping JDBC ResultSet columns to Jackson ObjectNode fields [SPR-9250] #13888
Labels
in: data
Issues in data modules (jdbc, orm, oxm, tx)
status: declined
A suggestion or change that we don't feel we should currently apply
type: enhancement
A general enhancement
Keith Donald opened SPR-9250 and commented
Similar in spirit to the existing BeanPropertyRowMapper, but instead of mapping ResultSet columns to POJOs, we would map directly to Jackson ObjectNode instances.
The main use case is JSON serialization as part of a REST API implementation. In many cases mapping to a JavaBeans model just to write JSON is overkill. It can be a lot simpler to simply convert a JDBC ResultSet to a ObjectNode or List of ObjectNodes. This can be done at present by hand (see (1) below), but this could be automated in many scenarios with a built-in JsonNodeRowMapper implementation that is similar in spirit to BeanPropertyRowMapper.
(1) Manual ResultSet-to-JsonNode mapping example
Affects: 3.1.1
Reference URL: https://twitter.com/#!/kdonald/status/181918401042726913
1 votes, 2 watchers
The text was updated successfully, but these errors were encountered: