I have a question regarding lazy loading in hibernate :
Say I have a following entity :
Code:
@Entity
public class Parent{
...
@OneToMany(fetch = FetchType.LAZY)
private Set<Child> childs=new HashSet<Child>();
}
It is obvious from the code that collection of child will be lazily loaded.
In database each parent have million records of child.
Assuming session is open and childs are accessed from parent, how hibernate deals with memory issue?
Does it fire batch queries..if yes..lets say it retrieves first batch of 100 out of million records ,then does it mean that there are 99 entity and 1 proxy at last to retrieve next 100(Just my thoughts).
Any help will be highly appreciated !!