views:

19

answers:

0

I have the following classes:

public class A {  
  public virtual int Id { get; private set; } 
  public virtual IDictionary<MyEnum, B> MyBValues { get; set; }  
} 

public class B {  
  public virtual int Id { get; private set; } 
} 

public enum MyEnum { Value1, Value2, Value3 } 

And would like the following tables:

A 
---------------- 
Id : int 

B 
---------------- 
Id : int 

MyBValues 
---------------- 
AId : int -- FK to A 
BId : int -- FK to B 
MyValue : int -- One of the enum values

This is my mapping, which is part of the mapping for A:

<map cascasde="none" inverse="true" name="MyBValues" mutable="true">
    <key column="AId"/>
    <index column="MyValue" type="MyNamespace.MyEnum, assembly" />
    <element column="BId" type="MyNamespace.B, assembly" />
</map>

However I get the following exception: MappingException: Could not determine type for: Mynamespace.B, assembly, for columns: BId

B is also mapped correctly, as everything appears as it should if I take out the map element. Any ideas?

Thanks Andy

related questions