5 ways to initialize lazy associations and when to use them
| |

5 ways to initialize lazy associations and when to use them

Lazy loading of associations between entities is a well established best practice in JPA. Its main goal is to retrieve only the requested entities from the database and load the related entities only if needed. That is a great approach if you only need the requested entities. But it creates additional work and can be…