-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: How to implment a high performance hierarchical tree?
PostPosted: Mon Jul 12, 2010 9:20 am 
Newbie

Joined: Mon May 31, 2010 10:46 am
Posts: 4
My subject is to implement a tree structure in hibernate. The tree represents a project structure with many folders and files. It can be expected that the content of this tree will grow over the time.

My question is: how can this be done in a performant manner. I currently have a simple table representing the item with a self-reference on another item. To show the structure in a tree control, i have to ask about the possible children of a leaf (representing the "+" at the beginning).

Are there any howtos or documentation or can anyone help me with this issue?

Lazy loading is a problem, as all items will be converted into DTOs (mapping within a 3-tier-architecture). So any other solutions welcome!


Top
 Profile  
 
 Post subject: Re: How to implment a high performance hierarchical tree?
PostPosted: Mon Jul 12, 2010 4:46 pm 
Newbie

Joined: Fri Jul 02, 2010 6:27 am
Posts: 5
Here is an article about how to store trees in database: http://www.weckert.org/nst/index.html There are 2 solutions: "Adjacency Lists" and "Nested Sets". Read the advantages and disadvantages of every one. Note that in case of "Adjacency Lists" solution there are databases (like Oracle and MS SQL) that support recursive queries; these are proprietary solutions so I do not think you can translate them to HQL. For one of my projects I used "Nested Sets" and I did not encountered any difficulties.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.