2009年11月9日 星期一

NHibernate 常見錯誤

"NHibernate.MappingException : Unknown entity class:xxx.Class":
關聯table的xxx.hbm.XML檔沒有設定為內嵌資源


"NHibernate.InvalidProxyTypeException : The following types may not be used as proxies"
把xxx.hbm.xml檔中加入lazy="false"

"NHibernate.MappingException : persistent class ClassName not found" or "NHibernate.MappingException : associated class not found: ClassName"
NH找不到對應的類別,通常是設定問題。
一個簡單的做法是去assembly中設定

沒有留言: