Hibernate throws this exception during SessionFactory creation:
org.hibernate.loader.MultipleBagFetchException: cannot simultaneously fetch multiple b
To fix it simply take Set
in place of List
for your nested object.
@OneToMany
Set objectList;
and don't forget to use fetch=FetchType.EAGER
it will work.
There is one more concept CollectionId
in Hibernate if you want to stick with list only.
But remind that you won't eliminate the underlaying Cartesian Product as described by Vlad Mihalcea in his answer!