-->
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.  [ 1 post ] 
Author Message
 Post subject: Tree like structure in a table
PostPosted: Thu Dec 14, 2006 1:28 am 
Newbie

Joined: Tue Sep 05, 2006 1:32 am
Posts: 2
Hi all am encoutering a challenage here how to u map a tree structure to a table?

e.g

public class Node{
Node parent;
List child=new ArrayList();//Stores a list of child nodes
}

And all the data is mapped to a table so in order to find the root i probably have a node where the parent is null.

How do i do the mapping for this table? How do i map the parent 'Node' back to the table itself?

I feel that i would probably need to create a composite type for Node so to put it in the mapping file but i have no idea how to let hibernate know that the object is mapping to the same table.


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

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.