Skip to content

Commit

Permalink
Merge pull request SWYP-3-Reading-everywhere#79 from kf3907/dev
Browse files Browse the repository at this point in the history
refactor : CascadeType.ALL -> PERSIST로 변경
  • Loading branch information
kf3907 authored Mar 16, 2024
2 parents f231351 + fd5041f commit 5bc591d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/main/java/com/book_everywhere/domain/book/Book.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class Book {
private User user;

@Builder.Default
@OneToMany(mappedBy = "book", cascade = CascadeType.ALL, orphanRemoval = true)
@OneToMany(mappedBy = "book", cascade = CascadeType.PERSIST, orphanRemoval = true)
private List<Review> reviews = new ArrayList<>();

@Column(nullable = false)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/book_everywhere/domain/tag/Tag.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Tag {
private Long id;

@Builder.Default
@OneToMany(mappedBy = "tag",cascade = CascadeType.ALL)
@OneToMany(mappedBy = "tag",cascade = CascadeType.PERSIST)
private List<Tagged> tags = new ArrayList<>();

@ManyToOne
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/book_everywhere/domain/user/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class User {
private Long id;

@Builder.Default
@OneToMany(mappedBy = "user",cascade = CascadeType.ALL)
@OneToMany(mappedBy = "user",cascade = CascadeType.PERSIST)
private List<Visit> visits = new ArrayList<>();

@Column(nullable = false, unique = true)
Expand Down

0 comments on commit 5bc591d

Please sign in to comment.