-->
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: Mapping a Map
PostPosted: Wed Apr 28, 2004 6:25 pm 
Newbie

Joined: Mon Jan 19, 2004 7:44 pm
Posts: 7
Hi, here is my delimma,

I have three tables: User, Group, and UserInGroup. User has a HashMap Java object of all Groups that the User is a member of (as decided by the UserInGroup table.) I would like to keep the HashMap structure as I am grafting Hibernate on to some earlier code that I know works.

Can someone tell me how to put this structure into my Hibernate .hbm.xml file? I have already read the documentation online, but I learn a lot easier with an example in front of my face so please don't tell me to RTFM. I've RTFM and I got an "Element "map" requires additional elements." error.

For the purposes of this example User has a column called User_ID, Group has a column called Group_ID. Each are unique primary keys. The UserInGroup table has columns called User_ID and Group_ID. The combination of User and Group is unique in the UserInGroup table.

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.