diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java index 7ce4110575..5a5ece73d2 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -383,6 +383,7 @@ public class BeanPropertyRowMapper implements RowMapper { * Static factory method to create a new {@code BeanPropertyRowMapper} * (with the mapped class specified only once). * @param mappedClass the class that each row should be mapped to + * @see #newInstance(Class, ConversionService) */ public static BeanPropertyRowMapper newInstance(Class mappedClass) { return new BeanPropertyRowMapper<>(mappedClass); @@ -392,9 +393,15 @@ public class BeanPropertyRowMapper implements RowMapper { * 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 + * @param conversionService the {@link ConversionService} for binding + * JDBC values to bean properties, or {@code null} for none + * @since 5.2.3 + * @see #newInstance(Class) + * @see #setConversionService */ - public static BeanPropertyRowMapper newInstance(Class mappedClass, @Nullable ConversionService conversionService) { + public static BeanPropertyRowMapper newInstance( + Class mappedClass, @Nullable ConversionService conversionService) { + BeanPropertyRowMapper rowMapper = newInstance(mappedClass); rowMapper.setConversionService(conversionService); return rowMapper; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SingleColumnRowMapper.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SingleColumnRowMapper.java index 31f7068046..0a2e9cb491 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SingleColumnRowMapper.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SingleColumnRowMapper.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -220,6 +220,7 @@ public class SingleColumnRowMapper implements RowMapper { * (with the required type specified only once). * @param requiredType the type that each result object is expected to match * @since 4.1 + * @see #newInstance(Class, ConversionService) */ public static SingleColumnRowMapper newInstance(Class requiredType) { return new SingleColumnRowMapper<>(requiredType); @@ -229,10 +230,15 @@ public class SingleColumnRowMapper implements RowMapper { * Static factory method to create a new {@code SingleColumnRowMapper} * (with the required type specified only once). * @param requiredType the type that each result object is expected to match - * @param conversionService the {@link ConversionService} for converting a fetched value + * @param conversionService the {@link ConversionService} for converting a + * fetched value, or {@code null} for none * @since 5.0.4 + * @see #newInstance(Class) + * @see #setConversionService */ - public static SingleColumnRowMapper newInstance(Class requiredType, @Nullable ConversionService conversionService) { + public static SingleColumnRowMapper newInstance( + Class requiredType, @Nullable ConversionService conversionService) { + SingleColumnRowMapper rowMapper = newInstance(requiredType); rowMapper.setConversionService(conversionService); return rowMapper;