From f465ba85b6b1f9834b93898337c8682d162f2720 Mon Sep 17 00:00:00 2001 From: KangMinJun Date: Fri, 17 May 2024 11:49:54 +0900 Subject: [PATCH 1/2] =?UTF-8?q?Error=20Handler=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../reborn_15/_5_reborn/repository/RebornRepository.java | 2 +- .../backend/reborn_15/_5_reborn/service/RebornService.java | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/reborn/backend/reborn_15/_5_reborn/repository/RebornRepository.java b/src/main/java/reborn/backend/reborn_15/_5_reborn/repository/RebornRepository.java index ecf497b..3a45374 100644 --- a/src/main/java/reborn/backend/reborn_15/_5_reborn/repository/RebornRepository.java +++ b/src/main/java/reborn/backend/reborn_15/_5_reborn/repository/RebornRepository.java @@ -15,5 +15,5 @@ public interface RebornRepository extends JpaRepository, JpaSpecif Optional findByPetAndDate(Pet pet, Integer date); - Optional findByPetAndDateLessThan(Pet pet, Integer date); + Reborn findByPetAndDateLessThan(Pet pet, Integer date); } diff --git a/src/main/java/reborn/backend/reborn_15/_5_reborn/service/RebornService.java b/src/main/java/reborn/backend/reborn_15/_5_reborn/service/RebornService.java index 61f0e8a..ae8d3ff 100644 --- a/src/main/java/reborn/backend/reborn_15/_5_reborn/service/RebornService.java +++ b/src/main/java/reborn/backend/reborn_15/_5_reborn/service/RebornService.java @@ -40,8 +40,7 @@ public Reborn createReborn(Pet pet) { @Transactional public Reborn findByPetAndDateLessThanSorted(Pet pet, Integer date) { - return rebornRepository.findByPetAndDateLessThan(pet, date) - .orElseThrow(() -> GeneralException.of(ErrorCode.REBORN_NOT_FOUND)); + return rebornRepository.findByPetAndDateLessThan(pet, date); } @Transactional From d21bfb84d5b05f50e830564cb36288a74ef4dc46 Mon Sep 17 00:00:00 2001 From: KangMinJun Date: Fri, 17 May 2024 11:51:53 +0900 Subject: [PATCH 2/2] develop DB create -> update --- src/main/resources/application.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index e3a672c..c4f8678 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -128,7 +128,7 @@ spring: # show_sql: true use_sql_comments: true hbm2ddl: - auto: create + auto: update default_batch_fetch_size: 1000 # data: # redis: