Is mapping Dictionary<Entity,Collection<AnotherEntity>> supported?
Hey,
I have a need to map the following property, whereby many categories can be assigned to an object (based on strategy).
public virtual IDictionary<Strategy, ICollection> Categories
Is this currently supported, and if so, could somebody please point me in the right direction to getting it working? I have standard dictionary mappings working, but just not sure how the value type should be mapped to that of a collection?
Thanks in advance,
Frank
Comments are currently closed for this discussion. You can start a new one.
Support Staff 2 Posted by Paul Batum on 03 May, 2010 11:26 AM
I haven't seen anyone do this before. I would double check as to whether nhibernate supports this, and if so, what the xml looks like. If you can come up with some working xml, we can try to help you find the fluent version.
3 Posted by fb on 04 May, 2010 09:36 AM
Hi Paul,
Thanks for the reply. In the end I followed the approach suggested at
http://stackoverflow.com/questions/1308072/nhibernate-mapping-a-dictionary-of-lists
and introduced a "Categorisation" entity which simply contained a property
to store the collection, resulting in the following:
public virtual IDictionary<Strategy, Categorisation> Categories
It did mean introducing a few extra join tables, so hopefully this will be
supported in future...
Frank
--------------------------------------------------
From: "Paul Batum"
<tender+d4c27a428edbf84e311938c9216eeda0d648acf69@tenderapp.com>
Sent: Monday, May 03, 2010 12:29 PM
To: <fb@evilrobot.tv>
Subject: Re: Is mapping Dictionary<Entity,Collection<AnotherEntity>>
supported? [Help and guidance]
Paul Batum resolved this discussion on 09 May, 2010 03:27 AM.