Performance: @OneToMany relationship
MEDIUM IMPACT
This affects server response time and client rendering speed due to data loading and serialization of related entities.
@Entity
public class Parent {
@OneToMany(fetch = FetchType.LAZY)
private List<Child> children;
}@Entity
public class Parent {
@OneToMany(fetch = FetchType.EAGER)
private List<Child> children;
}| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Eager @OneToMany loading | N/A (server-side) | N/A | Large JSON payload delays rendering | [X] Bad |
| Lazy @OneToMany loading with pagination | N/A (server-side) | N/A | Smaller payload improves rendering speed | [OK] Good |