Add BeanPropertyRowMapper.newInstance(mappedClass, conversionService)
Similar to SingleColumnRowMapper.newInstance(requiredType, conversionService) which was added in #1678.
This commit is contained in:
parent
d757f73902
commit
dafe57fc6e
|
@ -388,4 +388,16 @@ public class BeanPropertyRowMapper<T> implements RowMapper<T> {
|
||||||
return new BeanPropertyRowMapper<>(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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue