JPA/hibernate big collections

后端 未结 3 430
醉酒成梦
醉酒成梦 2021-01-03 06:49

In a scenario with two types of entities, Parent and Child:

Parent - @OneToMany Collection children;

The default is to have lazy loading on the collection o

3条回答
  •  半阙折子戏
    2021-01-03 07:05

    Do you need all the children? Or are you just going to select a few from the entire list returned? If so, query directly on the child entities for what you want. If you need them all, look into paginating.

提交回复
热议问题