Update User entity to enable orphan removal for associated articles
This commit is contained in:
@@ -14,7 +14,7 @@ public class User {
|
||||
private String name;
|
||||
private String email;
|
||||
|
||||
@OneToMany(mappedBy="author", cascade= CascadeType.ALL, fetch = FetchType.LAZY)
|
||||
@OneToMany(mappedBy="author", cascade = CascadeType.ALL, orphanRemoval = true)
|
||||
private List<Article> articles;
|
||||
|
||||
public User() {}
|
||||
|
||||
Reference in New Issue
Block a user