Skip to content

Commit

Permalink
Add BeanPropertyRowMapper.newInstance(mappedClass, conversionService)
Browse files Browse the repository at this point in the history
Similar to SingleColumnRowMapper.newInstance(requiredType,
conversionService) which was added in #1678.
  • Loading branch information
perceptron8 authored and jhoeller committed Dec 12, 2019
1 parent d757f73 commit dafe57f
Showing 1 changed file with 12 additions and 0 deletions.
Expand Up @@ -388,4 +388,16 @@ public static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass) {
return new BeanPropertyRowMapper<>(mappedClass);
}

/**
* Static factory method to create a new {@code BeanPropertyRowMapper}
* (with the required type specified only once).
* @param mappedClass the class that each row should be mapped to
* @param conversionService the {@link ConversionService} for binding JDBC values to bean properties, or {@code null} for none
*/
public static <T> BeanPropertyRowMapper<T> newInstance(Class<T> mappedClass, @Nullable ConversionService conversionService) {
BeanPropertyRowMapper<T> rowMapper = newInstance(mappedClass);
rowMapper.setConversionService(conversionService);
return rowMapper;
}

}

0 comments on commit dafe57f

Please sign in to comment.