Entities, Sessions & Relationships Entities @Entity @Table(name = "authors") public class Author { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; private String name; @OneToMany(mappedBy = "auth…
ReadPerformance, Caching & Locking Avoiding N+1 Selects // N+1 problem: 1 query for authors, then 1 MORE per author when // the LAZY .getPosts() is accessed inside the loop for (Author author : session.createQuery("FROM Auth…
ReadSave this stack to your personal DevRecall — add your own notes, track what you're learning, and share what you know with the community.
Get started — free forever