Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/NHibernate/Proxy/AbstractProxyFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Reflection;
using NHibernate.Engine;
using NHibernate.Type;
using NHibernate.Util;

namespace NHibernate.Proxy
{
Expand All @@ -17,6 +18,7 @@ public abstract class AbstractProxyFactory: IProxyFactory
protected virtual MethodInfo GetIdentifierMethod { get; private set; }
protected virtual MethodInfo SetIdentifierMethod { get; private set; }
protected virtual IAbstractComponentType ComponentIdType { get; private set; }
protected virtual bool OverridesEquals { get; set; }

protected bool IsClassProxy
{
Expand All @@ -39,6 +41,7 @@ public virtual void PostInstantiate(string entityName, System.Type persistentCla
GetIdentifierMethod = getIdentifierMethod;
SetIdentifierMethod = setIdentifierMethod;
ComponentIdType = componentIdType;
OverridesEquals = ReflectHelper.OverridesEquals(persistentClass);
}


Expand Down
8 changes: 2 additions & 6 deletions src/NHibernate/Proxy/DefaultLazyInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@ public class DefaultLazyInitializer : BasicLazyInitializer, DynamicProxy.IInterc
{
public DefaultLazyInitializer(string entityName, System.Type persistentClass, object id, MethodInfo getIdentifierMethod,
MethodInfo setIdentifierMethod, IAbstractComponentType componentIdType,
ISessionImplementor session)
: base(entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session) {}

#region Implementation of IInterceptor
ISessionImplementor session, bool overridesEquals)
: base(entityName, persistentClass, id, getIdentifierMethod, setIdentifierMethod, componentIdType, session, overridesEquals) {}

public object Intercept(InvocationInfo info)
{
Expand All @@ -40,7 +38,5 @@ public object Intercept(InvocationInfo info)

return returnValue;
}

#endregion
}
}
2 changes: 1 addition & 1 deletion src/NHibernate/Proxy/DefaultProxyFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public override INHibernateProxy GetProxy(object id, ISessionImplementor session
{
try
{
var initializer = new DefaultLazyInitializer(EntityName, PersistentClass, id, GetIdentifierMethod, SetIdentifierMethod, ComponentIdType, session);
var initializer = new DefaultLazyInitializer(EntityName, PersistentClass, id, GetIdentifierMethod, SetIdentifierMethod, ComponentIdType, session, OverridesEquals);

object proxyInstance = IsClassProxy
? factory.CreateProxy(PersistentClass, initializer, Interfaces)
Expand Down
4 changes: 2 additions & 2 deletions src/NHibernate/Proxy/Poco/BasicLazyInitializer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ public abstract class BasicLazyInitializer : AbstractLazyInitializer

protected internal BasicLazyInitializer(string entityName, System.Type persistentClass, object id,
MethodInfo getIdentifierMethod, MethodInfo setIdentifierMethod,
IAbstractComponentType componentIdType, ISessionImplementor session)
IAbstractComponentType componentIdType, ISessionImplementor session, bool overridesEquals)
: base(entityName, id, session)
{
this.persistentClass = persistentClass;
this.getIdentifierMethod = getIdentifierMethod;
this.setIdentifierMethod = setIdentifierMethod;
this.componentIdType = componentIdType;
overridesEquals = ReflectHelper.OverridesEquals(persistentClass);
this.overridesEquals = overridesEquals;
}

/// <summary>
Expand Down