Skip to content

Commit

Permalink
Merge pull request #79 from 9oormthon-univ/78-bug-insight-reminder-무한…
Browse files Browse the repository at this point in the history
…-재귀-호출-방지

fix: JsonManagedReference + JsonBackReference 추가
  • Loading branch information
MinhoJJang authored May 25, 2024
2 parents 3dbf898 + 638e510 commit 8709340
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 8709340

Please sign in to comment.