Skip to content

Commit

Permalink
fix: JsonManagedReference + JsonBackReference ์ถ”๊ฐ€
Browse files Browse the repository at this point in the history
ํ•œ์ชฝ ๋ฐฉํ–ฅ์„ ์ง๋ ฌํ™”ํ•˜์—ฌ ๋ฌดํ•œ ๋ฃจํ”„๋ฅผ ๋ง‰์Šต๋‹ˆ๋‹ค.
  • Loading branch information
MinhoJJang committed May 25, 2024
1 parent 3dbf898 commit 638e510
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/goorm/reinput/insight/domain/Insight.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public class Insight extends BaseTimeEntity {
@JsonBackReference
private Folder folder;

@JsonManagedReference
@OneToOne(mappedBy = "insight", cascade = CascadeType.ALL, orphanRemoval = true)
private Reminder reminder;

Expand Down
2 changes: 2 additions & 0 deletions src/main/java/goorm/reinput/reminder/domain/Reminder.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package goorm.reinput.reminder.domain;

import com.fasterxml.jackson.annotation.JsonBackReference;
import goorm.reinput.global.domain.BaseTimeEntity;
import goorm.reinput.insight.domain.Insight;
import jakarta.persistence.*;
Expand All @@ -23,6 +24,7 @@ public class Reminder extends BaseTimeEntity {
private Boolean isEnable;
private LocalDateTime lastRemindedAt;

@JsonBackReference
@OneToOne(fetch = FetchType.LAZY)
private Insight insight;

Expand Down

0 comments on commit 638e510

Please sign in to comment.