Modified:
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegateSetFieldAccessor.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegateSetFieldAccessor.cs?view=diff&rev=450157&r1=450156&r2=450157
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegateSetFieldAccessor.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/DelegateSetFieldAccessor.cs
Tue Sep 26 12:20:40 2006
@@ -80,29 +80,12 @@
ilgen = dynamicMethodSet.GetILGenerator();
- ilgen.Emit(OpCodes.Ldarg_0);//Load the first argument (target
object)
- ilgen.Emit(OpCodes.Castclass, targetObjectType); //Cast to the
source type
- ilgen.Emit(OpCodes.Ldarg_1);//Load the second argument (value
object)
- if (_fieldType.IsValueType)
- {
- ilgen.Emit(OpCodes.Unbox, _fieldType); //Unbox it
- if (typeToOpcode[_fieldType] != null)
- {
- OpCode load = (OpCode)typeToOpcode[_fieldType];
- ilgen.Emit(load); //and load
- }
- else
- {
- ilgen.Emit(OpCodes.Ldobj, _fieldType);
- }
- ilgen.Emit(OpCodes.Stfld, fieldInfo); //Set the field value
- }
- else
- {
- ilgen.Emit(OpCodes.Castclass, _fieldType); //Cast class
- }
-
+ ilgen.Emit(OpCodes.Ldarg_0);
+ ilgen.Emit(OpCodes.Ldarg_1);
+ UnboxIfNeeded(fieldInfo.FieldType, ilgen);
+ ilgen.Emit(OpCodes.Stfld, fieldInfo);
ilgen.Emit(OpCodes.Ret);
+
_set =
(SetValue)dynamicMethodSet.CreateDelegate(typeof(SetValue));
}
}
@@ -148,5 +131,14 @@
}
#endregion
+
+ private static void UnboxIfNeeded(Type type, ILGenerator generator)
+ {
+ if (type.IsValueType)
+ {
+ generator.Emit(OpCodes.Unbox_Any, type);
+ }
+ }
+
}
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/EmitFieldSetAccessor.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/EmitFieldSetAccessor.cs?view=diff&rev=450157&r1=450156&r2=450157
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/EmitFieldSetAccessor.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.Common/Utilities/Objects/Members/EmitFieldSetAccessor.cs
Tue Sep 26 12:20:40 2006
@@ -157,7 +157,8 @@
}
else
{
- setIL.Emit(OpCodes.Castclass, _fieldType); //Cast class
+ // setIL.Emit(OpCodes.Castclass, _fieldType); //Cast class
+ setIL.Emit(OpCodes.Stfld, targetField);
}
}
else
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt?view=diff&rev=450157&r1=450156&r2=450157
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt Tue Sep 26
12:20:40 2006
@@ -5,7 +5,7 @@
------------------------------
Issues
- IBATISNET-179 : Allow procedure statement without parameterMap
-
+ - IBATISNET-184 : Invalid support for public/protected field in result
property
Improvements/Changes
- IBATISNET-180 : Extends use of ISqlMapper in DataMapper + allow use of a
custom ISqlMapper
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs?view=diff&rev=450157&r1=450156&r2=450157
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs
Tue Sep 26 12:20:40 2006
@@ -241,7 +241,7 @@
{
throw new ConfigurationException(
string.Format("Could not configure
ResultMap. ResultMap named \"{0}\" not found, failed. {1} Cause: {2}", _id,
Environment.NewLine, e.Message)
- );
+ , e);
}
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs?view=diff&rev=450157&r1=450156&r2=450157
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Scope/ConfigurationScope.cs Tue
Sep 26 12:20:40 2006
@@ -47,6 +47,9 @@
/// </summary>
public class ConfigurationScope : IScope
{
+ /// <summary>
+ /// Empty parameter map
+ /// </summary>
public const string EMPTY_PARAMETER_MAP = "iBATIS.Empty.ParameterMap";
#region Fields