• Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting specific data with lazy=false in hibernate  RSS feed

Fawad Ali
Ranch Hand
Posts: 116
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
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.

Thanks in advance.
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!