hierachial data

Posts   
 
   
 
Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 21-Mar-2007 03:02:03   

Hi Frans,

Something to help work with hierarchial data would be great. I hate working with trees because I'm a grunt and the sql required to manage a tree makes my head hurt. Adjency list as a minium but nested-set too if you happen to have a few hours spare simple_smile

Cheers,

Pete

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39761
Joined: 17-Aug-2003
# Posted on: 21-Mar-2007 09:38:02   

True, though it's not really a solveable problem. The thing is that to solve it, the db layout has to be prepared for it. And when thats done, the solution is trivial so you don't need special features.

Frans Bouma | Lead developer LLBLGen Pro
Anonymous
User
Posts: 0
Joined: 11-Nov-2006
# Posted on: 21-Mar-2007 10:36:40   

Can you explain? I always thought the sql required to add / remove nodes from a nested-set were not trivial disappointed In all other ways, llblgen helps me write data-access faster and better, but with hierarchial data it doesn't. Maybe a generic Tree utility class could be added?

Pete

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39761
Joined: 17-Aug-2003
# Posted on: 21-Mar-2007 11:35:40   

lad4bear wrote:

Can you explain? I always thought the sql required to add / remove nodes from a nested-set were not trivial disappointed In all other ways, llblgen helps me write data-access faster and better, but with hierarchial data it doesn't. Maybe a generic Tree utility class could be added? Pete

Please check this thread: http://www.llblgen.com/tinyforum/Messages.aspx?ThreadID=3208

It should give you some ideas and pointers to how to do it. As you can see, the selects aren't that complex.

The simple way of storing a tree (parent and child in same table with an FK field in the table to its own PK) doesn't allow a hierarchy fetch in 1 go, unless you want to fetch everything. So it's not trivial to solve this as it relies on how the db looks.

Frans Bouma | Lead developer LLBLGen Pro