在 ISessionFactory factory = config.BuildSessionFactory();时发生
NHibernate.InvalidProxyTypeException: The following types may not be used as proxies: TestCleanSnow.BjkptOaxtCleanupsnow: method set_IsDeleted should be virtual TestCleanSnow.BjkptOaxtCleanupsnow: method set_IsChanged should be virtual TestCleanSnow.BjkptOaxtCleanupsnow: method Clone should be virtual TestCleanSnow.BjkptOaxtCleanupsnow: method get_IsChanged should be virtual TestCleanSnow.BjkptOaxtCleanupsnow: method get_IsDeleted should be virtual
解决办法:
在XML的 <class name="TestCleanSnow.BjkptOaxtCleanupsnow,TestCleanSnow" table="B_JKPT_OAXT_CLEANUPSNOW"> 添加 lazy="false" .