-->
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: How to create a map which contain each element as a list
PostPosted: Fri Mar 28, 2008 12:29 pm 
Newbie

Joined: Fri Mar 28, 2008 12:18 pm
Posts: 3
Location: Tamp
I need to create a list of map. i.e a map which contain each element as a list.
My problem is listed below.
I have a ListMaster each ListMaster is subdivide into sub-list and sub-list is classified as different type.

My table structure is

LIST_MASTER

Code:
LIST_ID(P)       LIST_NAME
L1              Lst1
L2              Lst2
L3              Lst3


SUB_LIST

Code:
SUBLIST_ID(P)       LIST_ID(FK)     SUB_LIST_TYPE
SL1         L1         Type1
SL2         L1         Type1
SL3         L1         Type1
SL4         L1         Type2
SL5         L1         Type2
SL6         L2         Type1
SL7         L2         Type1
SL8         L2         Type2


ListMaster class has a map, which has to store all the sub list keyed by sub list type. So that L1’s (listMaster object which represent ‘L1’) map.get(“type1”) will return all the sublist(SL1,SL2,SL3 ‘L1’) for that particular type – ‘type1’.

Right now what am doing is like get this sublist as a set and writing my on logic to create the map. Is there any way to create the map using hibernate itself. If so please tell me how to write the hibernate-mapping for this?


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.