Won't Fix
Details
Details
Assignee
Alex Zaytsev
Alex ZaytsevReporter
Ricardo Peres
Ricardo PeresLabels
Components
Affects versions
Priority
Who's Looking?
Open Who's Looking?
Created April 11, 2013 at 1:27 PM
Updated June 24, 2017 at 5:14 AM
Resolved June 24, 2017 at 5:14 AM
Both SessionFactoryImpl.GuessEntityName and NHibernateUtil.GuessEntityName implementations are broken because, when they are called with a proxy (all objects of lazy classes are proxies) they do not return the proper type name (that of the mapped class, not the proxy). This prevents usage of ISession.Replicate, ISession.SaveOrUpdate, etc, because NHibernate cannot find a persister for the proxy class (MappingException: no persister for xxxxProxy). Instead, both implementations might instead use something like NHibernateProxyHelper.GuessClass(entity).FullName.