-->
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: Does anybody help me with this tree relationships
PostPosted: Fri Jan 14, 2005 11:30 pm 
Newbie

Joined: Wed Nov 10, 2004 2:46 am
Posts: 5
i have four class:Zone,Station,Mhouse,ConnectMap, they composed a tree structure.

Code:
Zone-|-Station----------|-Mhouse------------ConnectMap   
         |-ConnectMap     |-ConnectMap   



Zone's children node is Station and ConnectMap
Station's children node is Mhouse and ConnectMap
Mhouse's children node is ConnectMap

now ,the problem is :how to design ConnectMap?because it can act as Zone,Station,Mhouse's children node.

if like

Code:
public class ConnectMap (){

private Long id;
private String name;
private Zone zone;
private Station station ;
private Mhouse mhouse;

  ..............................
}

but how to design table,Zone,Station,Mhouse store in diffirent table,
if ConnectMap 's table is :

Code:
number id;
varchar2 name;
number  parentid;


hbm like:


Top
 Profile  
 
 Post subject: Re: Does anybody help me with this tree relationships
PostPosted: Fri Jan 14, 2005 11:36 pm 
Newbie

Joined: Wed Nov 10, 2004 2:46 am
Posts: 5
does anybody have occured above problem,are there some suggest?


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.