Update User entity to enable orphan removal for associated articles

This commit is contained in:
Vincent Guillet
2025-05-19 14:44:05 +02:00
parent eafd02fc07
commit 1a5b7b1a35

View File

@@ -14,7 +14,7 @@ public class User {
private String name; private String name;
private String email; private String email;
@OneToMany(mappedBy="author", cascade= CascadeType.ALL, fetch = FetchType.LAZY) @OneToMany(mappedBy="author", cascade = CascadeType.ALL, orphanRemoval = true)
private List<Article> articles; private List<Article> articles;
public User() {} public User() {}