From 62842f97cf2c1e1ce1ba94c5505d769acb0632a6 Mon Sep 17 00:00:00 2001 From: sampadawagde Date: Thu, 23 Apr 2020 13:10:29 +0530 Subject: [PATCH] JAVA-923: Migrate spring-data-dynamodb to parent-boot-2 --- persistence-modules/spring-data-dynamodb/pom.xml | 8 ++++---- .../spring/data/dynamodb/config/DynamoDBConfig.java | 4 ++-- .../data/dynamodb/repositories/ProductInfoRepository.java | 7 ++++--- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/persistence-modules/spring-data-dynamodb/pom.xml b/persistence-modules/spring-data-dynamodb/pom.xml index fceceb40ba..377e35b635 100644 --- a/persistence-modules/spring-data-dynamodb/pom.xml +++ b/persistence-modules/spring-data-dynamodb/pom.xml @@ -9,9 +9,9 @@ com.baeldung - parent-boot-1 + parent-boot-2 0.0.1-SNAPSHOT - ../../parent-boot-1 + ../../parent-boot-2 @@ -19,7 +19,7 @@ org.springframework.data spring-data-releasetrain - Hopper-SR10 + Lovelace-SR16 pom import @@ -174,7 +174,7 @@ com.baeldung.Application 4.3.4.RELEASE 4.5.2 - 4.4.1 + 5.1.0 1.11.64 3.3.7-1 1.0.392 diff --git a/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/config/DynamoDBConfig.java b/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/config/DynamoDBConfig.java index 9278c0a12e..7e97e6b383 100644 --- a/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/config/DynamoDBConfig.java +++ b/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/config/DynamoDBConfig.java @@ -44,8 +44,8 @@ public class DynamoDBConfig { return new BasicAWSCredentials(amazonAWSAccessKey, amazonAWSSecretKey); } - @Bean(name = "mvcHandlerMappingIntrospector") - public HandlerMappingIntrospector mvcHandlerMappingIntrospector() { + @Bean(name = "mvcHandlerMappingIntrospectorCustom") + public HandlerMappingIntrospector mvcHandlerMappingIntrospectorCustom() { return new HandlerMappingIntrospector(context); } } diff --git a/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/repositories/ProductInfoRepository.java b/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/repositories/ProductInfoRepository.java index da47f033b6..6e8b493c3b 100644 --- a/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/repositories/ProductInfoRepository.java +++ b/persistence-modules/spring-data-dynamodb/src/main/java/com/baeldung/spring/data/dynamodb/repositories/ProductInfoRepository.java @@ -1,12 +1,13 @@ package com.baeldung.spring.data.dynamodb.repositories; -import com.baeldung.spring.data.dynamodb.model.ProductInfo; +import java.util.Optional; + import org.socialsignin.spring.data.dynamodb.repository.EnableScan; import org.springframework.data.repository.CrudRepository; -import java.util.List; +import com.baeldung.spring.data.dynamodb.model.ProductInfo; @EnableScan public interface ProductInfoRepository extends CrudRepository { - List findById(String id); + Optional findById(String id); }