1

When I use LazyLoad in NHibernate for my Entities I get the fallowing Exception:

NHibernate.MappingException: No persister for: PrivilegeLevelProxy

PrivilegeLevel is an Entity. It has also mapped correctly (it works without LazyLoad()). I ask me, why should NHibernate needs a Persister for a Proxy-Object?

BennoDual
  • 5,865
  • 15
  • 67
  • 153

1 Answers1

1

NHibernate doesn't need persister for proxies. This error probably means that NHibernate didn't get the chance to either lazy load the proxy, or the session has failed to recognize that the PrivilegeLevel is a proxy.

Are you using any custom interceptors? If you do, you need to override GetEntityName method.

Here are some similar SO questions that might help:
No persister for: Castle.Proxies.<EntityName>Proxy and lazy="true" in NHibernate?
No Persister for: error on save with INotifyPropertyChanged Interceptor

Community
  • 1
  • 1
Miroslav Popovic
  • 12,100
  • 2
  • 35
  • 47