I am using org.springframework.jdbc.core.BeanPropertyRowMapper to convert the results of a JDBC statement into a Bean, which works well.
I just want to convert one value of the result into another value before filling a special bean property.
I created a PropertyEditor and tried to register it via the CustomEditorConfigurer and a custom PropertyEditorRegistrar, but the PropertyEditor is not used when the BeanPropertyRowMapper fills the properties.
When the BeanWrapperImpl looks for PropertyEditors it does not find one because the customEditorsForPath is always empty.
How do I get my PropertyEditor registered for that one special property of my Bean when using the BeanPropertyRowMapper?
It looks like you need to extend
BeanPropertyRowMapper
and register your editors in overrideninitBeanWrapper()
.