© Anghel Leonard 2020
A. LeonardSpring Boot Persistence Best Practiceshttps://doi.org/10.1007/978-1-4842-5626-8_1

1. Associations

Anghel Leonard1 
(1)
Banesti, Romania
 

Item 1: How to Effectively Shape the @OneToMany Association

The bidirectional @OneToMany association is probably the most encountered association in our Domain Model. Based on this statement, this book takes advantage of this association in a significant number of examples.

For a supersonic guide to association efficiency, check out Appendix B.

Consider two entities, Author and Book, involved in a bidirectional lazy @OneToMany association. In Figure 1-1, you can see the corresponding @OneToMany table relationship.
Figure 1-1

The @OneToMany table relationship

So, the author table has a @OneToMany ...

Get Spring Boot Persistence Best Practices: Optimize Java Persistence Performance in Spring Boot Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.