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: Dictionary of list?
PostPosted: Thu Nov 13, 2008 12:16 pm 
Regular
Regular

Joined: Thu Nov 30, 2006 10:48 am
Posts: 59
We have the following:
- Owner and Thing are domain classes.
- Owner has a Property, Things, as follows: IDictionary<string, IList<Thing>>

We want to be able to map this dictionary w/ nHibernate. Without using nHibernate, we'd just create 3 tables and the queries are straightforward:

tblOwner: ID (int), other fields
tblThing: ID (int), other fields
tblOwnerThing: ID, FK_OwnerID, FK_ThingID, dictKey (string)

e.g. sample records in tblOwnerThing:
1) dictKey="owner1", FK_ThingID=ID for 'Thing1', FK_OwnerID=ID for 'OwnerA'
2) dictKey="owner1", FK_ThingID=ID for 'Thing2', FK_OwnerID=ID for 'OwnerA'
3) dictKey="owner2", FK_ThingID=ID for 'Thing3', FK_OwnerID=ID for 'OwnerB'
4) dictKey="owner2", FK_ThingID=ID for 'Thing4'
, FK_OwnerID=ID for 'OwnerB'

How can we do this in nHibernate?

Thanks,
Bill

_________________
metazone


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.