From ce91c2876bd799075d09b0ab41a1dcab3c3e6560 Mon Sep 17 00:00:00 2001 From: Miseong Kim Date: Wed, 6 Nov 2024 01:44:55 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20user,=20userProfile=20fetchType?= =?UTF-8?q?=EC=9D=84=20Eager=EB=A1=9C=20=EB=B3=80=EA=B2=BD=20=EB=B0=8F=20O?= =?UTF-8?q?SIV=20false=20=EC=84=A4=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/kotlin/com/nexters/bottles/app/user/domain/User.kt | 2 +- .../kotlin/com/nexters/bottles/app/user/domain/UserProfile.kt | 2 +- app/src/main/resources/application-dev.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/nexters/bottles/app/user/domain/User.kt b/app/src/main/kotlin/com/nexters/bottles/app/user/domain/User.kt index a9e02251..f8876230 100644 --- a/app/src/main/kotlin/com/nexters/bottles/app/user/domain/User.kt +++ b/app/src/main/kotlin/com/nexters/bottles/app/user/domain/User.kt @@ -32,7 +32,7 @@ class User( var phoneNumber: String? = null, - @OneToOne(fetch = FetchType.LAZY, mappedBy = "user", cascade = [CascadeType.ALL]) + @OneToOne(fetch = FetchType.EAGER, mappedBy = "user", cascade = [CascadeType.ALL]) var userProfile: UserProfile? = null, @Enumerated(EnumType.STRING) diff --git a/app/src/main/kotlin/com/nexters/bottles/app/user/domain/UserProfile.kt b/app/src/main/kotlin/com/nexters/bottles/app/user/domain/UserProfile.kt index a4cd4c3e..00030b70 100644 --- a/app/src/main/kotlin/com/nexters/bottles/app/user/domain/UserProfile.kt +++ b/app/src/main/kotlin/com/nexters/bottles/app/user/domain/UserProfile.kt @@ -19,7 +19,7 @@ class UserProfile( @GeneratedValue(strategy = GenerationType.IDENTITY) val id: Long = 0L, - @OneToOne(fetch = FetchType.LAZY) + @OneToOne(fetch = FetchType.EAGER) @JoinColumn(name = "user_id") val user: User, diff --git a/app/src/main/resources/application-dev.yml b/app/src/main/resources/application-dev.yml index 432cdcc5..a8feb07f 100644 --- a/app/src/main/resources/application-dev.yml +++ b/app/src/main/resources/application-dev.yml @@ -8,7 +8,7 @@ spring: hibernate: jdbc: time_zone: Asia/Seoul - open-in-view: true + open-in-view: false datasource: url: jdbc:mysql://mysql:3306/${DB_DATABASE}?allowPublicKeyRetrieval=true&useSSL=false&useUnicode=true&characterEncoding=utf8