Clone
Marcin Cieslak
committed
on 26 Nov 18
LDEV-4696 Make all @ManyToOne and @OneToOne lazy
Hibernate 3 used lazy loading of single-object relationships by default.
JPA's default sett… Show more
LDEV-4696 Make all @ManyToOne and @OneToOne lazy

Hibernate 3 used lazy loading of single-object relationships by default.

JPA's default setting is eager. When loading entities all references are

loaded immediately using JOINs. A large entity, like Learning Design,

can have a query consisting of 25 JOINs. It makes it very slow.

There is no way to change JPA's default behaviour. In order to make JPA

annotations behave like old Hibernate, each of them got an explicit

attribute saying that loading is lazy. Show less