-
Notifications
You must be signed in to change notification settings - Fork 38.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce RowMapper with automatic binding to fields #26594
Comments
Are you familiar with Does the "data class constructor with named parameters corresponding to column names" support meet your needs? |
No, as far as I understood the Like, if the db row has 20 columns, you would have to introduce a 20 column constructor to make it work. This is no advantage over creating 20 setters. |
Sure. There's no real benefit in that. |
We've assigned this proposal to the 5.x Backlog for potential inclusion in 5.3.x |
Would still be great if that feature could get some investigation. |
I'm introducing a new |
BeanPropertyRowMapper
requires setters being present. Which is fine if you have some.But if you only have a simple dto class for some reason, and want to make use of the mapper, it requires to create setters just for that.
It would be nice if we could have some
DirectFieldRowMapper
additionally, similar to:https://gist.github.com/stianl/6629122#file-directfieldrowmapper
Spring already allows direct field mapping for mvc with
DataBinder.initDirectFieldAccess()
.So why not providing a direct mapper also for jdbc beans, that can simply operate on
public
fields?The text was updated successfully, but these errors were encountered: