Following is my code Here I am using multiple lists to fetch data from database. On fetching data from hql query it is showing exception.
Pojo Class
I find using @PostLoad
annotated method in the entity most useful, I'd do something like
@PostLoad
public void loadCollections(){
int s1 = productReplacements.size();
int s2 = billProductList.size();
}
this way I'm able to fine control the eager loading and initialization of collections in the same transaction that loaded the entity.