Getting specific data with lazy=false in hibernate
posted 5 years ago
Lazy=false populates all the referenced objects as well. What if I want to have lazy=false in hbm files and at the same time I want specific values to be populated for object and anot the referenced objects. For example if I have an object employee and another object named manager. There is a relationship between manager and employee and lazy=false. Now if I want to load employee, it will also load manager. I want to load the details of employee only while still having lazy=false. I know there is a way by doing something with the constructor but I have forgotten it. Can anyone help me.