-->
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 modeling with mapping files
PostPosted: Wed Mar 14, 2012 11:20 am 
Newbie

Joined: Mon Jul 04, 2011 7:10 am
Posts: 9
I've got a class called "Area". Each Area can have multiple sub-areas (of the same type).
I need to be able to determine sub-areas and root-areas. Sub-areas can have sub-areas themself.
This can be quite a few levels deep.
Example:
Code:
Rootarea 
|- Subarea 1 
|   |- Subarea 2 
|   |
|   |- Subarea 3
|
|- Subarea 4
|   |- Subarea 5



Code:
public class Area {

   private Area parent;
   private List<Area> children;

   private String name;

   //getters and setters here ommitted
}




How do I model such a Java-class with Hibernate xml config files?
..and
How do I load to memory the areas tree?

thanks


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.