I have an entity class which contains field:
Code:
@ManyToOne(fetch = FetchType.LAZY)
private Department department;
This entity object was loaded in DAO class and session was closed. How to initialize now this LAZY field?
Only with usage of Query or Criteria for this entity, or there is other possibility to "EAGER" that lazy object, something like: session.[someMethod](department)?
I didn't find something like that in API, but I want to write some universal method for that in base HibernateDao class and inherit it in all DAO classes, something like that:
Code:
Object eagerObject (Object obj).
Is there any thoughts and ideas, how to do that?