Skip to content

Commit 415c425

Browse files
committed
Refactoring (IAbstractComponentType)
SVN: trunk@3401
1 parent fd300d0 commit 415c425

File tree

6 files changed

+13
-10
lines changed

6 files changed

+13
-10
lines changed

src/NHibernate/Proxy/Poco/BasicLazyInitializer.cs

+4-5
Original file line numberDiff line numberDiff line change
@@ -127,11 +127,10 @@ public virtual object Invoke(MethodBase method, object[] args, object proxy)
127127
}
128128

129129
//if it is a property of an embedded component, invoke on the "identifier"
130-
// TODO H3.2 IsMethodOf in IAbstractComponentType
131-
//if (componentIdType != null && componentIdType.IsMethodOf(method))
132-
//{
133-
// return method.Invoke(Identifier, args);
134-
//}
130+
if (componentIdType != null && componentIdType.IsMethodOf(method))
131+
{
132+
return method.Invoke(Identifier, args);
133+
}
135134

136135
return InvokeImplementation;
137136
}

src/NHibernate/Tuple/Component/PocoComponentTuplizer.cs

+5-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,11 @@ public override System.Type MappedClass
4949

5050
public override object[] GetPropertyValues(object component)
5151
{
52-
// TODO: H3.2 BackrefPropertyAccessor
52+
if (component == BackrefPropertyAccessor.Unknown)
53+
{
54+
return new object[propertySpan];
55+
}
56+
5357
if (optimizer != null && optimizer.AccessOptimizer != null)
5458
{
5559
return optimizer.AccessOptimizer.GetPropertyValues(component);

src/NHibernate/Type/AnyType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ public override int Compare(object x, object y, EntityMode? entityMode)
376376
return 0; //TODO: entities CAN be compared, by PK and entity name, fix this!
377377
}
378378

379-
public virtual bool IsMethodOf(MethodInfo method)
379+
public virtual bool IsMethodOf(MethodBase method)
380380
{
381381
return false;
382382
}

src/NHibernate/Type/ComponentType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ public override bool IsEqual(object x, object y, EntityMode entityMode, ISession
617617
return true;
618618
}
619619

620-
public virtual bool IsMethodOf(MethodInfo method)
620+
public virtual bool IsMethodOf(MethodBase method)
621621
{
622622
return false;
623623
}

src/NHibernate/Type/CompositeCustomType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ public override bool IsEqual(object x, object y, EntityMode entityMode)
292292
return userType.Equals(x, y);
293293
}
294294

295-
public virtual bool IsMethodOf(MethodInfo method)
295+
public virtual bool IsMethodOf(MethodBase method)
296296
{
297297
return false;
298298
}

src/NHibernate/Type/IAbstractComponentType.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,6 @@ public interface IAbstractComponentType : IType
4444

4545
bool IsEmbedded { get;}
4646

47-
bool IsMethodOf(MethodInfo method);
47+
bool IsMethodOf(MethodBase method);
4848
}
4949
}

0 commit comments

Comments
 (0)