You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2007/02/25 14:47:00 UTC
svn commit: r511513 - in /ibatis/trunk/cs/mapper: IBatisNet.Common.Test/
IBatisNet.Common.Test/Domain/
IBatisNet.Common.Test/NUnit/CommonTests/Utilities/ IBatisNet.Common/
IBatisNet.Common/Utilities/Objects/
IBatisNet.Common/Utilities/Objects/Members/ ...
Author: gbayon
Date: Sun Feb 25 05:46:57 2007
New Revision: 511513
URL: http://svn.apache.org/viewvc?view=rev&rev=511513
Log:
Fixed IBATISNET-210 Finding properties on interfaces which "inherites" other interfaces
Added:
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/Address.cs
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/BaseDomain.cs
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IAddress.cs
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IBaseDomain.cs
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IUser.cs
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/User.cs
Modified:
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.2005.csproj
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/PropertyAccessorTest.cs
ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/ReflectionInfoTest.cs
ibatis/trunk/cs/mapper/IBatisNet.Common/AssemblyInfo.cs
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/BaseAccessor.cs
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertyGetAccessor.cs
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertySetAccessor.cs
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/ReflectionInfo.cs
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/AssemblyInfo.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/AssemblyInfo.cs
Added: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/Address.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/Address.cs?view=auto&rev=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/Address.cs (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/Address.cs Sun Feb 25 05:46:57 2007
@@ -0,0 +1,18 @@
+
+using System;
+
+namespace IBatisNet.Common.Test.Domain
+{
+public class Address : BaseDomain, IAddress
+{
+ private string streetname;
+ public string Streetname
+ {
+ get { return streetname; }
+ set { streetname = value; }
+ }
+}
+
+
+}
+
Added: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/BaseDomain.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/BaseDomain.cs?view=auto&rev=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/BaseDomain.cs (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/BaseDomain.cs Sun Feb 25 05:46:57 2007
@@ -0,0 +1,16 @@
+using System;
+
+namespace IBatisNet.Common.Test.Domain
+{
+ public class BaseDomain : IBaseDomain
+ {
+ private Guid _id;
+ public Guid Id
+ {
+ get { return _id; }
+ set { _id = value; }
+ }
+
+ }
+
+}
Added: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IAddress.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IAddress.cs?view=auto&rev=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IAddress.cs (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IAddress.cs Sun Feb 25 05:46:57 2007
@@ -0,0 +1,9 @@
+
+
+namespace IBatisNet.Common.Test.Domain
+{
+ public interface IAddress : IBaseDomain
+ {
+ string Streetname { get; set; }
+ }
+}
Added: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IBaseDomain.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IBaseDomain.cs?view=auto&rev=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IBaseDomain.cs (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IBaseDomain.cs Sun Feb 25 05:46:57 2007
@@ -0,0 +1,11 @@
+
+using System;
+
+namespace IBatisNet.Common.Test.Domain
+{
+ public interface IBaseDomain
+ {
+ Guid Id { get; set; }
+ }
+
+}
Added: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IUser.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IUser.cs?view=auto&rev=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IUser.cs (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/IUser.cs Sun Feb 25 05:46:57 2007
@@ -0,0 +1,9 @@
+
+
+namespace IBatisNet.Common.Test.Domain
+{
+ public interface IUser : IBaseDomain
+ {
+ IAddress Address { get; set; }
+ }
+}
Added: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/User.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/User.cs?view=auto&rev=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/User.cs (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/Domain/User.cs Sun Feb 25 05:46:57 2007
@@ -0,0 +1,15 @@
+
+namespace IBatisNet.Common.Test.Domain
+{
+ public class User : BaseDomain, IUser
+ {
+ private IAddress address;
+
+ public IAddress Address
+ {
+ get { return address; }
+ set { address = value; }
+ }
+
+ }
+}
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.2005.csproj
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.2005.csproj?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.2005.csproj (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.2005.csproj Sun Feb 25 05:46:57 2007
@@ -100,14 +100,20 @@
<Compile Include="Domain\Account.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Domain\Address.cs" />
+ <Compile Include="Domain\BaseDomain.cs" />
<Compile Include="Domain\Book.cs" />
<Compile Include="Domain\Document.cs" />
<Compile Include="Domain\DocumentCollection.cs" />
<Compile Include="Domain\GenericDocumentCollection.cs" />
+ <Compile Include="Domain\IAddress.cs" />
+ <Compile Include="Domain\IBaseDomain.cs" />
<Compile Include="Domain\Item.cs" />
+ <Compile Include="Domain\IUser.cs" />
<Compile Include="Domain\Order.cs" />
<Compile Include="Domain\Property.cs" />
<Compile Include="Domain\Simple.cs" />
+ <Compile Include="Domain\User.cs" />
<Compile Include="NUnit\CommonTests\ConfigWatcher\ConfigWatcherTest.cs">
<SubType>Code</SubType>
</Compile>
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/IBatisNet.Common.Test.csproj Sun Feb 25 05:46:57 2007
@@ -213,6 +213,16 @@
BuildAction = "Compile"
/>
<File
+ RelPath = "Domain\Address.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Domain\BaseDomain.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Domain\Book.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -223,11 +233,26 @@
BuildAction = "Compile"
/>
<File
+ RelPath = "Domain\IAddress.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Domain\IBaseDomain.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Domain\Item.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
+ RelPath = "Domain\IUser.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Domain\Order.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -239,6 +264,11 @@
/>
<File
RelPath = "Domain\Simple.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath = "Domain\User.cs"
SubType = "Code"
BuildAction = "Compile"
/>
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/PropertyAccessorTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/PropertyAccessorTest.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/PropertyAccessorTest.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/PropertyAccessorTest.cs Sun Feb 25 05:46:57 2007
@@ -93,6 +93,46 @@
#endregion
/// <summary>
+ /// Test Finding properties on interfaces which "inherites" other interfaces
+ /// </summary>
+ [Test]
+ public void TestJIRA210OnGet()
+ {
+ //----------------------------
+ IGetAccessor addressGet = factoryGet.CreateGetAccessor(typeof(User), "Address");
+
+ User user = new User();
+ user.Address = new Address();
+ Guid newGuid = Guid.NewGuid();
+ user.Address.Id = newGuid;
+
+ IAddress address = (IAddress)addressGet.Get(user);
+ Assert.IsNotNull(address);
+ Assert.AreEqual(newGuid, address.Id);
+
+ IGetAccessor domainGet = factoryGet.CreateGetAccessor(typeof(IAddress), "Id");
+
+ Guid guid = (Guid)domainGet.Get(address);
+ Assert.AreEqual(newGuid, guid);
+ }
+
+ /// <summary>
+ /// Test Finding properties on interfaces which "inherites" other interfaces
+ /// </summary>
+ [Test]
+ public void TestJIRA210OnSet()
+ {
+ Address adr = new Address();
+
+ Guid newGuid = Guid.NewGuid();
+
+ ISetAccessor domainSet = factorySet.CreateSetAccessor(typeof(IAddress), "Id");
+
+ domainSet.Set(adr, newGuid);
+ Assert.AreEqual(newGuid, adr.Id );
+ }
+
+ /// <summary>
/// Test multiple call to factory
/// </summary>
[Test]
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/ReflectionInfoTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/ReflectionInfoTest.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/ReflectionInfoTest.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common.Test/NUnit/CommonTests/Utilities/ReflectionInfoTest.cs Sun Feb 25 05:46:57 2007
@@ -23,5 +23,29 @@
Type type = info.GetGetterType("PageNumber");
}
+
+ /// <summary>
+ /// Test Finding properties on interfaces which "inherites" other interfaces
+ /// </summary>
+ [Test]
+ public void TestJIRA210OnGet()
+ {
+ ReflectionInfo info = ReflectionInfo.GetInstance(typeof(IAddress));
+
+ Type type = info.GetGetterType("Id");
+ Assert.IsNotNull(type);
+ }
+
+ /// <summary>
+ /// Test Finding properties on interfaces which "inherites" other interfaces
+ /// </summary>
+ [Test]
+ public void TestJIRA210OnSet()
+ {
+ ReflectionInfo info = ReflectionInfo.GetInstance(typeof(IAddress));
+
+ Type type = info.GetSetterType("Id");
+ Assert.IsNotNull(type);
+ }
}
}
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common/AssemblyInfo.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common/AssemblyInfo.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common/AssemblyInfo.cs Sun Feb 25 05:46:57 2007
@@ -11,25 +11,24 @@
[assembly: AssemblyCompany("http://ibatis.apache.org/")]
[assembly: AssemblyProduct("iBATIS.NET")]
-[assembly: AssemblyCopyright("Copyright 2006,2005 The Apache Software Foundation")]
+[assembly: AssemblyCopyright("Copyright 2007,2005 The Apache Software Foundation")]
[assembly: AssemblyTrademark("Licensed under the Apache License, Version 2.0")]
[assembly: AssemblyCulture("")]
#if DEBUG
#else
-#if dotnet2
-[assembly: AssemblyConfiguration("net-2.0.win32; Release")]
-#else
-[assembly: AssemblyConfiguration("net-1.1.win32; Release")]
-#endif
-[assembly: AssemblyDelaySign(false)]
-[assembly: AssemblyKeyFile("..\\..\\..\\AssemblyKey.snk")]
-#endif
-
+ #if dotnet2
+ [assembly: AssemblyConfiguration("net-2.0.win32; Release")]
+ #else
+ [assembly: AssemblyConfiguration("net-1.1.win32; Release")]
+ #endif
+ [assembly: AssemblyDelaySign(false)]
+ [assembly: AssemblyKeyFile("..\\..\\..\\AssemblyKey.snk")]
+ #endif
#endif
[assembly: AssemblyTitle("iBATIS.Common")]
[assembly: AssemblyDescription("Common object used by DataAccess and DataMapper component in iBATIS.Net")]
-[assembly: AssemblyVersion("1.5.0")]
+[assembly: AssemblyVersion("1.6.1")]
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/BaseAccessor.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/BaseAccessor.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/BaseAccessor.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/BaseAccessor.cs Sun Feb 25 05:46:57 2007
@@ -26,6 +26,7 @@
using System;
using System.Collections;
using System.Collections.Specialized;
+using System.Reflection;
using System.Reflection.Emit;
namespace IBatisNet.Common.Utilities.Objects.Members
@@ -36,6 +37,16 @@
public abstract class BaseAccessor
{
/// <summary>
+ /// The property name
+ /// </summary>
+ protected string propertyName = string.Empty;
+
+ /// <summary>
+ /// The target type
+ /// </summary>
+ protected Type targetType = null;
+
+ /// <summary>
/// The null internal value used by this member type
/// </summary>
protected object nullInternal = null;
@@ -65,6 +76,45 @@
typeToOpcode[typeof(float)] = OpCodes.Ldind_R4;
}
+
+ /// <summary>
+ /// Gets the property info.
+ /// </summary>
+ /// <param name="target">The target type.</param>
+ /// <returns></returns>
+ protected PropertyInfo GetPropertyInfo(Type target)
+ {
+ PropertyInfo propertyInfo = null;
+
+ propertyInfo = target.GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
+ if (propertyInfo == null)
+ {
+ if (target.IsInterface)
+ {
+ // JIRA 210
+ // Fix for interface inheriting
+ // Loop through interfaces of the type
+ foreach (Type interfaceType in target.GetInterfaces())
+ {
+ // Get propertyinfo and if found the break out of loop
+ propertyInfo = GetPropertyInfo(interfaceType);
+ if (propertyInfo != null)
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ // deals with Overriding a property using new and reflection
+ // http://blogs.msdn.com/thottams/archive/2006/03/17/553376.aspx
+ propertyInfo = target.GetProperty(propertyName);
+ }
+ }
+
+ return propertyInfo;
+ }
+
/// <summary>
/// Get the null value for a given type
/// </summary>
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertyGetAccessor.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertyGetAccessor.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertyGetAccessor.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertyGetAccessor.cs Sun Feb 25 05:46:57 2007
@@ -39,16 +39,11 @@
private delegate object GetValue(object instance);
private GetValue _get = null;
- /// <summary>
- /// The property name
- /// </summary>
- private string _propertyName = string.Empty;
- /// <summary>
+ /// <summary>
/// The property type
/// </summary>
private Type _propertyType = null;
private bool _canRead = false;
- private Type _targetType = null;
/// <summary>
/// Initializes a new instance of the <see cref="DelegatePropertyGetAccessor"/> class
@@ -58,15 +53,14 @@
/// <param name="propertyName">Name of the property.</param>
public DelegatePropertyGetAccessor(Type targetObjectType, string propertyName)
{
- _targetType = targetObjectType;
- _propertyName = propertyName;
+ targetType = targetObjectType;
+ this.propertyName = propertyName;
+
+ PropertyInfo propertyInfo = GetPropertyInfo(targetObjectType);
- // deals with Overriding a property using new and reflection
- // http://blogs.msdn.com/thottams/archive/2006/03/17/553376.aspx
- PropertyInfo propertyInfo = _targetType.GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
if (propertyInfo == null)
{
- propertyInfo = _targetType.GetProperty(propertyName);
+ propertyInfo = targetType.GetProperty(propertyName);
}
// Make sure the property exists
@@ -74,7 +68,7 @@
{
throw new NotSupportedException(
string.Format("Property \"{0}\" does not exist for type "
- + "{1}.", propertyName, _targetType));
+ + "{1}.", propertyName, targetType));
}
else
{
@@ -107,7 +101,7 @@
}
}
}
-
+
#region IAccessor Members
/// <summary>
@@ -116,7 +110,7 @@
/// <value></value>
public string Name
{
- get { return _propertyName; }
+ get { return propertyName; }
}
/// <summary>
@@ -147,7 +141,7 @@
{
throw new NotSupportedException(
string.Format("Property \"{0}\" on type "
- + "{1} doesn't have a get method.", _propertyName, _targetType));
+ + "{1} doesn't have a get method.", propertyName, targetType));
}
}
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertySetAccessor.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertySetAccessor.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertySetAccessor.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegatePropertySetAccessor.cs Sun Feb 25 05:46:57 2007
@@ -41,41 +41,30 @@
private SetValue _set = null;
/// <summary>
- /// The property name
- /// </summary>
- private string _propertyName = string.Empty;
- /// <summary>
/// The property type
/// </summary>
private Type _propertyType = null;
private bool _canWrite = false;
- private Type _targetType = null;
/// <summary>
/// Initializes a new instance of the <see cref="DelegatePropertySetAccessor"/> class
/// for set property access via DynamicMethod.
/// </summary>
/// <param name="targetObjectType">Type of the target object.</param>
- /// <param name="propertyName">Name of the property.</param>
- public DelegatePropertySetAccessor(Type targetObjectType, string propertyName)
+ /// <param name="propName">Name of the property.</param>
+ public DelegatePropertySetAccessor(Type targetObjectType, string propName)
{
- _targetType = targetObjectType;
- _propertyName = propertyName;
+ targetType = targetObjectType;
+ propertyName = propName;
- // deals with Overriding a property using new and reflection
- // http://blogs.msdn.com/thottams/archive/2006/03/17/553376.aspx
- PropertyInfo propertyInfo = _targetType.GetProperty(propertyName, BindingFlags.Public | BindingFlags.Instance | BindingFlags.DeclaredOnly);
- if (propertyInfo == null)
- {
- propertyInfo = _targetType.GetProperty(propertyName);
- }
+ PropertyInfo propertyInfo = GetPropertyInfo(targetObjectType);
// Make sure the property exists
if(propertyInfo == null)
{
throw new NotSupportedException(
string.Format("Property \"{0}\" does not exist for type "
- + "{1}.", propertyName, _targetType));
+ + "{1}.", propertyName, targetType));
}
else
{
@@ -95,7 +84,7 @@
Type paramType = targetSetMethod.GetParameters()[0].ParameterType;
ilgen.DeclareLocal(paramType);
ilgen.Emit(OpCodes.Ldarg_0); //Load the first argument (target object)
- ilgen.Emit(OpCodes.Castclass, _targetType); //Cast to the source type
+ ilgen.Emit(OpCodes.Castclass, targetType); //Cast to the source type
ilgen.Emit(OpCodes.Ldarg_1); //Load the second argument (value object)
if (paramType.IsValueType)
{
@@ -130,7 +119,7 @@
/// <value></value>
public string Name
{
- get { return _propertyName; }
+ get { return propertyName; }
}
/// <summary>
@@ -168,7 +157,7 @@
{
throw new NotSupportedException(
string.Format("Property \"{0}\" on type "
- + "{1} doesn't have a set method.", _propertyName, _targetType));
+ + "{1} doesn't have a set method.", propertyName, targetType));
}
}
Modified: ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/ReflectionInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/ReflectionInfo.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/ReflectionInfo.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/ReflectionInfo.cs Sun Feb 25 05:46:57 2007
@@ -45,7 +45,7 @@
public static BindingFlags BINDING_FLAGS_PROPERTY
= BindingFlags.Public
| BindingFlags.NonPublic
- | BindingFlags.Instance
+ | BindingFlags.Instance
;
@@ -173,6 +173,17 @@
_getTypes[name] = fields[i].FieldType;
}
#endregion
+
+ // Fix for problem with interfaces inheriting other interfaces
+ if (type.IsInterface)
+ {
+ // Loop through interfaces for the type and add members from
+ // these types too
+ foreach (Type interf in type.GetInterfaces())
+ {
+ AddMembers(interf);
+ }
+ }
}
/// <summary>
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataAccess/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/AssemblyInfo.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataAccess/AssemblyInfo.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataAccess/AssemblyInfo.cs Sun Feb 25 05:46:57 2007
@@ -12,7 +12,7 @@
[assembly: AssemblyCompany("http://ibatis.apache.org/")]
[assembly: AssemblyProduct("iBATIS.NET")]
-[assembly: AssemblyCopyright("Copyright 2006,2005 The Apache Software Foundation")]
+[assembly: AssemblyCopyright("Copyright 2007,2005 The Apache Software Foundation")]
[assembly: AssemblyTrademark("Licensed under the Apache License, Version 2.0")]
[assembly: AssemblyCulture("")]
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/AssemblyInfo.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/AssemblyInfo.cs?view=diff&rev=511513&r1=511512&r2=511513
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/AssemblyInfo.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/AssemblyInfo.cs Sun Feb 25 05:46:57 2007
@@ -12,7 +12,7 @@
[assembly: AssemblyCompany("http://ibatis.apache.org/")]
[assembly: AssemblyProduct("iBATIS.NET")]
-[assembly: AssemblyCopyright("Copyright 2006,2005 The Apache Software Foundation")]
+[assembly: AssemblyCopyright("Copyright 2007,2005 The Apache Software Foundation")]
[assembly: AssemblyTrademark("Licensed under the Apache License, Version 2.0")]
[assembly: AssemblyCulture("")]