views:

118

answers:

1

I've found a number of posts about this but none seem to help me directly. Also there seems to be confusion about solutions working or not working during different stages of FluentNHibernate's development.

I have the following classes:

public class MappedClass
{
    ...
}

public enum MyEnum
{
    One,
    Two
}

public class Foo
{
    ...
    public virtual IDictionary<MappedClass, MyEnum> Values { get; set; }
}

My questions are:

  1. Will I need a separate (third) table of MyEnum?
  2. How can I map the MyEnum type? Should I?
  3. What should Foo's mapping look like?

I've tried mapping HasMany(x => x.Values).AsMap("MappedClass")... This results in: NHibernate.MappingException : Association references unmapped class: MyEnum

A: 

It looks like this questions is a duplicate of http://stackoverflow.com/questions/1360976/. The solution was to use hbm.xml to map a ternary association table. It looks like at the time FluentNHibernate's AsTernaryAssocation() method only worked for entity types. I can't tell if this has changed, or if it is a planned feature.

anthony

related questions