Skip to content

Commit

Permalink
feat: user, userProfile fetchType을 Eager로 변경 및 OSIV false 설정
Browse files Browse the repository at this point in the history
  • Loading branch information
miseongk committed Nov 5, 2024
1 parent dd31344 commit ce91c28
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ce91c28

Please sign in to comment.