So... call a method on the list (like size()
for example) to initialize it, or use Hibernate.initialize()
.
Hibernate fully fetch a lazily fetched object on command
سؤال
So I have an object with collection. I want to lazily load it at first , but an object can be sent over a network which makes it necessary to fetch all the fields.
@Entity
class Foo
{
@Id
int id;
@Column
String name
@OneToMany
List<Foo2> = new ArrayList<>();
}
المحلول
لا تنتمي إلى StackOverflow