l a s
l a s

Reputation: 3921

Hibernate Lazy Loading HQL

Hibernate + HibernateTemplate + Lazy Loading + HQL

We are using HibernateTemplate's find method by passing a HQL query. How do i retrieve the child elements as we have configured Lazy Loading?

Thanks.

Upvotes: 0

Views: 1225

Answers (1)

Bozho
Bozho

Reputation: 597362

It depends. You can get the elements of the collection by using JOIN FETCH in the HQL query, or you can later call Hibernate.initialize(entity.getSomeLazyCollection())

Upvotes: 2

Related Questions