Hi,
In order to improve the performance, I would want to load only the required relations at the startup of the application..
But at the same time, I would set "lazy =true" to retrive the all related objects participating in the relationships.
Later, using Qurery Criteria, I would like to pick up the desired relation , even after the session is closed.
A detailed scenario is explained below:
There are employees, each employee belongs to a project, and each project has a customer. There are employee, project and customer master tables to store these data. Now, the many-to-one relations between employee and project as well as project and customer are defined and the project and the customer classes are declared as 'lazy = true'.
If I select the employee and close the session, then I would not be able to access the project or the customer since the session is not available. But if I create a criteria query and then explicitly ask these relations to be loaded, then they will be loaded when the first select is executed itself and hence they would be available even after the session is closed.
Has anyone have a similar requirement/ scenario ?
Any help in this regard would be greatly appreciated.
Thanks
Uthra
|