我怎样才能映射IDictionary<Entity, Component>
?我已经这样做了:
Map<GeneralResourceType, Quantity>(x => x.BookedResources,
c =>
{
c.Key(ck => ck.Column("ProposedAction"));
c.Table("BookedResources");
},
k => k.ManyToMany(key => key.Column("ResourceTypeId")),
r => r.Component(qc => QuantityMapping.Mapping()));
(其中 GeneralResourceType 是映射实体,Quantity 是 ValueObject)。但是在调用 BuildSession() 期间会抛出异常:
NHibernate.MappingException :来自表 BookedResources 的关联引用了一个未映射的类:{MyNamespace}.Quantity。像它这样的接缝尝试为 Quantity 查找 ClassMapping,而将值部分映射为 Component。