2011-08-08 299 views
0

我试试MAPP此表:映射使用功能NHibernate

CREATE TABLE AHQ.ReportConfigurationAttribute (
    IdReportConfiguration integer NOT NULL, 
    IdAttribute integer NOT NULL, 
    [Order] integer NOT NULL, 
    [Type] integer NOT NULL, 
    CONSTRAINT PK_ReportConfiguration_Attribute PRIMARY KEY (IdReportConfiguration, IdAttribute) 
); 

,并

Schema("AHQ"); 
     CompositeId() 
      .KeyProperty(x => x.IdReportConfiguration) 
      .KeyProperty(x => x.IdAttribute); 
     Map(a => a.Order); 
     Map(a => a.Type).CustomType<ReportConfigurationAttribute.ReportConfigurationAttributeType>(); 

NHibernate.MappingException : No persister 

有什么建议?

谢谢

回答

1

您是否使用流畅配置?如果是这样,请同时发布此代码。

检查您的映射类是否公开。

+1

嗨UpTheCreek,你是对的,我忘了把我的课像公众一样。 – Tarlak

+0

非常感谢 – Tarlak