diff --git a/src/main/java/org/springframework/data/jdbc/mybatis/MyBatisDataAccessStrategy.java b/src/main/java/org/springframework/data/jdbc/mybatis/MyBatisDataAccessStrategy.java index 51ea83981..2973b8b18 100644 --- a/src/main/java/org/springframework/data/jdbc/mybatis/MyBatisDataAccessStrategy.java +++ b/src/main/java/org/springframework/data/jdbc/mybatis/MyBatisDataAccessStrategy.java @@ -22,7 +22,6 @@ import java.util.Map; import org.apache.ibatis.session.SqlSession; import org.mybatis.spring.SqlSessionTemplate; -import org.springframework.data.convert.EntityInstantiators; import org.springframework.data.jdbc.core.CascadingDataAccessStrategy; import org.springframework.data.jdbc.core.DataAccessStrategy; import org.springframework.data.jdbc.core.DefaultDataAccessStrategy; @@ -60,10 +59,8 @@ public class MyBatisDataAccessStrategy implements DataAccessStrategy { * uses a {@link DefaultDataAccessStrategy} */ public static DataAccessStrategy createCombinedAccessStrategy(RelationalMappingContext context, - RelationalConverter converter, - NamedParameterJdbcOperations operations, SqlSession sqlSession) { - return createCombinedAccessStrategy(context, converter, operations, sqlSession, - NamespaceStrategy.DEFAULT_INSTANCE); + RelationalConverter converter, NamedParameterJdbcOperations operations, SqlSession sqlSession) { + return createCombinedAccessStrategy(context, converter, operations, sqlSession, NamespaceStrategy.DEFAULT_INSTANCE); } /** @@ -105,7 +102,7 @@ public class MyBatisDataAccessStrategy implements DataAccessStrategy { * transaction. Note that the resulting {@link DataAccessStrategy} only handles MyBatis. It does not include the * functionality of the {@link org.springframework.data.jdbc.core.DefaultDataAccessStrategy} which one normally still * wants. Use - * {@link #createCombinedAccessStrategy(RelationalMappingContext, EntityInstantiators, NamedParameterJdbcOperations, SqlSession, NamespaceStrategy)} + * {@link #createCombinedAccessStrategy(RelationalMappingContext, RelationalConverter, NamedParameterJdbcOperations, SqlSession, NamespaceStrategy)} * to create such a {@link DataAccessStrategy}. * * @param sqlSession Must be non {@literal null}. diff --git a/src/main/java/org/springframework/data/jdbc/repository/config/JdbcConfiguration.java b/src/main/java/org/springframework/data/jdbc/repository/config/JdbcConfiguration.java index 17a530387..f7c50d400 100644 --- a/src/main/java/org/springframework/data/jdbc/repository/config/JdbcConfiguration.java +++ b/src/main/java/org/springframework/data/jdbc/repository/config/JdbcConfiguration.java @@ -57,7 +57,8 @@ public class JdbcConfiguration { /** * Register custom {@link Converter}s in a {@link CustomConversions} object if required. These - * {@link CustomConversions} will be registered with the {@link #jdbcMappingContext()}. Returns an empty + * {@link CustomConversions} will be registered with the + * {@link #relationalConverter(RelationalMappingContext, CustomConversions)}. Returns an empty * {@link JdbcCustomConversions} instance by default. * * @return must not be {@literal null}. diff --git a/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java b/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java index c05d2dc02..e821f4ef4 100644 --- a/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java +++ b/src/main/java/org/springframework/data/jdbc/repository/support/JdbcQueryLookupStrategy.java @@ -39,6 +39,7 @@ import org.springframework.util.Assert; * @author Jens Schauder * @author Kazuki Shimizu * @author Oliver Gierke + * @author Mark Paluch * @since 1.0 */ class JdbcQueryLookupStrategy implements QueryLookupStrategy { diff --git a/src/main/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBean.java b/src/main/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBean.java index cd44d1283..c0f256690 100644 --- a/src/main/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBean.java +++ b/src/main/java/org/springframework/data/jdbc/repository/support/JdbcRepositoryFactoryBean.java @@ -40,6 +40,7 @@ import org.springframework.util.Assert; * @author Greg Turnquist * @author Christoph Strobl * @author Oliver Gierke + * @author Mark Paluch * @since 1.0 */ public class JdbcRepositoryFactoryBean, S, ID extends Serializable> // diff --git a/src/main/java/org/springframework/data/relational/core/conversion/BasicRelationalConverter.java b/src/main/java/org/springframework/data/relational/core/conversion/BasicRelationalConverter.java index a58f10917..0bb317732 100644 --- a/src/main/java/org/springframework/data/relational/core/conversion/BasicRelationalConverter.java +++ b/src/main/java/org/springframework/data/relational/core/conversion/BasicRelationalConverter.java @@ -192,9 +192,10 @@ public class BasicRelationalConverter implements RelationalConverter { * Checks whether we have a custom conversion registered for the given value into an arbitrary simple JDBC type. * Returns the converted value if so. If not, we perform special enum handling or simply return the value as is. * - * @param value - * @return + * @param value to be converted. Must not be {@code null}. + * @return the converted value if a conversion applies or the original value. Might return {@code null}. */ + @Nullable private Object getPotentiallyConvertedSimpleWrite(Object value) { Optional> customTarget = conversions.getCustomWriteTarget(value.getClass()); @@ -210,9 +211,9 @@ public class BasicRelationalConverter implements RelationalConverter { * Checks whether we have a custom conversion for the given simple object. Converts the given value if so, applies * {@link Enum} handling or returns the value as is. * - * @param value - * @param target must not be {@literal null}. - * @return + * @param value to be converted. May be {@code null}.. + * @param target May be {@code null}.. + * @return the converted value if a conversion applies or the original value. Might return {@code null}. */ @Nullable @SuppressWarnings({ "rawtypes", "unchecked" }) diff --git a/src/main/java/org/springframework/data/relational/core/conversion/RelationalConverter.java b/src/main/java/org/springframework/data/relational/core/conversion/RelationalConverter.java index 09fc4df48..e0f14e450 100644 --- a/src/main/java/org/springframework/data/relational/core/conversion/RelationalConverter.java +++ b/src/main/java/org/springframework/data/relational/core/conversion/RelationalConverter.java @@ -33,6 +33,7 @@ import org.springframework.lang.Nullable; * vice versa. * * @author Mark Paluch + * @author Jens Schauder */ public interface RelationalConverter { @@ -54,10 +55,10 @@ public interface RelationalConverter { * Create a new instance of {@link PersistentEntity} given {@link ParameterValueProvider} to obtain constructor * properties. * - * @param entity - * @param parameterValueProvider - * @param - * @return + * @param entity the kind of entity to create. Must not be {@code null}. + * @param parameterValueProvider a function that provides the value to pass to a constructor, given a {@link Parameter}. Must not be {@code null}. + * @param the type of entity to create. + * @return the instantiated entity. Guaranteed to be not {@code null}. */ T createInstance(PersistentEntity entity, Function, Object> parameterValueProvider); @@ -65,18 +66,18 @@ public interface RelationalConverter { /** * Return a {@link PersistentPropertyAccessor} to access property values of the {@code instance}. * - * @param persistentEntity - * @param instance - * @return + * @param persistentEntity the kind of entity to operate on. Must not be {@code null}. + * @param instance the instance to operate on. Must not be {@code null}. + * @return Guaranteed to be not {@code null}. */ PersistentPropertyAccessor getPropertyAccessor(PersistentEntity persistentEntity, T instance); /** * Read a relational value into the desired {@link TypeInformation destination type}. * - * @param value - * @param type - * @return + * @param value a value as it is returned by the driver accessing the persistence store. May be {@code null}. + * @param type {@link TypeInformation} into which the value is to be converted. Must not be {@code null}. + * @return The converted value. May be {@code null}. */ @Nullable Object readValue(@Nullable Object value, TypeInformation type); @@ -84,9 +85,9 @@ public interface RelationalConverter { /** * Write a property value into a relational type that can be stored natively. * - * @param value - * @param type - * @return + * @param value a value as it is used in the object model. May be {@code null}. + * @param type {@link TypeInformation} into which the value is to be converted. Must not be {@code null}. + * @return The converted value. May be {@code null}. */ @Nullable Object writeValue(@Nullable Object value, TypeInformation type); diff --git a/src/main/java/org/springframework/data/relational/core/mapping/RelationalMappingContext.java b/src/main/java/org/springframework/data/relational/core/mapping/RelationalMappingContext.java index 76c56efec..06f7c9542 100644 --- a/src/main/java/org/springframework/data/relational/core/mapping/RelationalMappingContext.java +++ b/src/main/java/org/springframework/data/relational/core/mapping/RelationalMappingContext.java @@ -55,7 +55,6 @@ public class RelationalMappingContext extends AbstractMappingContext