Is mapping Dictionary<Entity,Collection<AnotherEntity>> supported?

Original Post fb's Avatar

fb

29 Apr, 2010 10:02 AM via web

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

  1. Support Staff 2 Posted by Paul Batum on 03 May, 2010 11:26 AM

    Paul Batum's Avatar

    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.

  2. 3 Posted by fb on 04 May, 2010 09:36 AM

    fb's Avatar

    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]

  3. Paul Batum resolved this discussion on 09 May, 2010 03:27 AM.

Comments are currently closed for this discussion. You can start a new one.

Recent Discussions

05 Jul, 2010 10:29 PM
05 Jul, 2010 12:45 PM
05 Jul, 2010 12:42 PM
05 Jul, 2010 12:17 PM
05 Jul, 2010 12:12 PM

 

03 Jul, 2010 12:26 AM
02 Jul, 2010 02:17 PM
02 Jul, 2010 08:18 AM
02 Jul, 2010 12:20 AM
01 Jul, 2010 10:14 PM