Beginner |
 |
Joined: Wed Dec 10, 2008 5:59 am Posts: 47
|
I've got a tree structure made up of the entity TreeNode. The TreeNodes maps a a parent TreeNode and a collection of child TreeNode objects. All properties are set to lazy.
What i do is that i'll load the TreeNode for which the parent property is null (this is the topmost node). Then i recursively iterate the children of this TreeNode (and every TreeNode further down in the hierarchy) and use Hibernate.initialize() to load the children. This naturally issues a number of database queries; which is fine.
However; whenever repeat the above process, i get just as many database queries. So, my question is then; does the Hibernate.initialize() put the elements it loads into the second level cache?
|
|