Update User class to use EAGER fetching for articles relationship

This commit is contained in:
Vincent Guillet
2025-05-23 11:25:44 +02:00
parent adbdf0d619
commit 8b8fae6e24

View File

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