proxy classes can not be saved

Description

If you have a reference to another class which has a mapped property (not reference) with lazyload and that reference is a proxy you can not save it. it will throw that exception: "No persister for: ProductProxy"

this.Map(x => x.ProductImage).Not.Nullable().CustomSqlType("IMAGE").LazyLoad();{/code}

Environment

None

is related to

Activity

Show:

Kai Cissarek December 10, 2014 at 10:06 AM

it is fixed with it thank u!

Roger December 10, 2014 at 9:48 AM

Ricardo: Yes, they seem related. Thanks!
I close this issue as external issue.

Kai: Can you confirm retesting with NH Core fix? If not, please reopen the ticket with a small unit test please.

Ricardo Peres December 9, 2014 at 6:39 PM

I think this is fixed by NH-3448.

Kai Cissarek December 9, 2014 at 12:10 PM
Edited

It fails here: NHibernate.Envers.Tools.Toolz.getIdentifier

var objAsProxy = obj as INHibernateProxy;

return objAsProxy!=null ? objAsProxy.HibernateLazyInitializer.Identifier : session.GetEntityPersister(null, obj).GetIdentifier(obj, session.EntityMode);

because it is not a INHibernateProxy but it have the interface IProxy.

edit:
here is something that could be the root of evil "Proxy with lazy fields does not implement INHibernateProxy" https://groups.google.com/forum/#!topic/nhibernate-development/fLAs0gxVk-E

External Issue

Details

Assignee

Reporter

Labels

Components

Affects versions

Priority

Who's Looking?

Open Who's Looking?

Created December 9, 2014 at 11:51 AM
Updated December 10, 2014 at 10:06 AM
Resolved December 10, 2014 at 9:48 AM
Who's Looking?