ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gba...@apache.org
Subject svn commit: r703678 [2/3] - in /ibatis/trunk/cs/V3/src: Apache.Ibatis.Common/Contracts/Constraints/ Apache.Ibatis.Common/Data/ Apache.Ibatis.Common/Logging/ Apache.Ibatis.Common/Utilities/ Apache.Ibatis.Common/Utilities/Objects/ Apache.Ibatis.Common/Ut...
Date Sat, 11 Oct 2008 16:07:47 GMT
Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypeUtils.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypeUtils.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypeUtils.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypeUtils.cs Sat Oct 11 09:07:44 2008
@@ -38,7 +38,7 @@
     /// Mainly for internal use within the framework.
     /// </p>
     /// </remarks>
-    public sealed class TypeUtils
+    public static class TypeUtils
     {
         #region Fields
 
@@ -48,19 +48,7 @@
 
         #region Constructor (s) / Destructor
 
-		/// <summary>
-        /// Creates a new instance of the <see cref="Apache.Ibatis.Common.Utilities.TypeUtils"/> class.
-		/// </summary>
-		/// <remarks>
-		/// <p>
-		/// This is a utility class, and as such exposes no public constructors.
-		/// </p>
-		/// </remarks>
-        private TypeUtils()
-		{
-		}
-
-		#endregion
+        #endregion
 
         /// <summary>
         /// Resolves the supplied type name into a <see cref="System.Type"/>
@@ -155,27 +143,24 @@
                     {
                         return new DateTime();
                     }
-                    else if (type == typeof(Decimal))
+                    if (type == typeof(Decimal))
                     {
                         return new Decimal();
-                    } 
-                    else if (type == typeof(Guid))
+                    }
+                    if (type == typeof(Guid))
                     {
                         return Guid.Empty;
                     }
-                    else if (type == typeof(TimeSpan))
+                    if (type == typeof(TimeSpan))
                     {
                         return new TimeSpan(0);
                     }
-                    else if (type.IsGenericType &&
+                    if (type.IsGenericType &&
                         typeof(Nullable<>).IsAssignableFrom(type.GetGenericTypeDefinition()))
                     {
                         return InstantiateNullableType(type);
                     }
-                    else
-                    {
-                        throw new NotImplementedException("Unable to instanciate value type");
-                    }
+                    throw new NotImplementedException("Unable to instanciate value type");
                 }
             }
 
@@ -271,16 +256,14 @@
             {
                 return true;
             }
-            else // check if one of the derived interfaces is IList<>
+            // check if one of the derived interfaces is IList<>
+            Type[] interfaceTypes = type.GetInterfaces();
+            foreach (Type interfaceType in interfaceTypes)
             {
-                Type[] interfaceTypes = type.GetInterfaces();
-                foreach (Type interfaceType in interfaceTypes)
+                ret = IsImplementGenericIListInterface(interfaceType);
+                if (ret)
                 {
-                    ret = IsImplementGenericIListInterface(interfaceType);
-                    if (ret)
-                    {
-                        break;
-                    }
+                    break;
                 }
             }
             return ret;

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/CachedTypeResolver.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/CachedTypeResolver.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/CachedTypeResolver.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/CachedTypeResolver.cs Sat Oct 11 09:07:44 2008
@@ -27,13 +27,9 @@
 // Inpspired from Spring.NET
 #endregion
 
-#region Imports
 
 using System;
-using System.Collections;
-using System.Collections.Specialized;
-
-#endregion
+using System.Collections.Generic;
 
 namespace Apache.Ibatis.Common.Utilities.TypesResolver
 {
@@ -49,9 +45,9 @@
         /// The cache, mapping type names (<see cref="System.String"/> instances) against
         /// <see cref="System.Type"/> instances.
         /// </summary>
-        private IDictionary _typeCache = new HybridDictionary();
+        private readonly IDictionary<string, Type> _typeCache = new Dictionary<string, Type>();
 
-        private ITypeResolver _typeResolver = null;
+        private readonly ITypeResolver _typeResolver = null;
         #endregion
 
         #region Constructor (s) / Destructor
@@ -99,8 +95,7 @@
             Type type = null;
             try
             {
-                type = _typeCache[typeName] as Type;
-                if (type == null)
+                if (!_typeCache.TryGetValue(typeName, out type))
                 {
                     type = _typeResolver.Resolve(typeName);
                     _typeCache[typeName] = type;

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/TypesResolver/TypeResolver.cs Sat Oct 11 09:07:44 2008
@@ -100,7 +100,7 @@
         /// If the supplied <paramref name="typeName"/> could not be resolved
         /// to a <see cref="System.Type"/>.
         /// </exception>
-        private Type ResolveGenericType(string typeName)
+        private static Type ResolveGenericType(string typeName)
         {
             Contract.Require.That(typeName, Is.Not.Null & Is.Not.Empty).When("retrieving argument typeName for ResolveType method");
 
@@ -108,37 +108,34 @@
             {
                 return null;
             }
-            else
+            GenericArgumentsInfo genericInfo = new GenericArgumentsInfo(typeName);
+            Type type = null;
+            try
             {
-                GenericArgumentsInfo genericInfo = new GenericArgumentsInfo(typeName);
-                Type type = null;
-                try
+                if (genericInfo.ContainsGenericArguments)
                 {
-                    if (genericInfo.ContainsGenericArguments)
+                    type = TypeUtils.ResolveType(genericInfo.GenericTypeName);
+                    if (!genericInfo.IsGenericDefinition)
                     {
-                        type = TypeUtils.ResolveType(genericInfo.GenericTypeName);
-                        if (!genericInfo.IsGenericDefinition)
+                        string[] unresolvedGenericArgs = genericInfo.GetGenericArguments();
+                        Type[] genericArgs = new Type[unresolvedGenericArgs.Length];
+                        for (int i = 0; i < unresolvedGenericArgs.Length; i++)
                         {
-                            string[] unresolvedGenericArgs = genericInfo.GetGenericArguments();
-                            Type[] genericArgs = new Type[unresolvedGenericArgs.Length];
-                            for (int i = 0; i < unresolvedGenericArgs.Length; i++)
-                            {
-                                genericArgs[i] = TypeUtils.ResolveType(unresolvedGenericArgs[i]);
-                            }
-                            type = type.MakeGenericType(genericArgs);
+                            genericArgs[i] = TypeUtils.ResolveType(unresolvedGenericArgs[i]);
                         }
+                        type = type.MakeGenericType(genericArgs);
                     }
                 }
-                catch (Exception ex)
+            }
+            catch (Exception ex)
+            {
+                if (ex is TypeLoadException)
                 {
-                    if (ex is TypeLoadException)
-                    {
-                        throw;
-                    }
-                    throw BuildTypeLoadException(typeName, ex);
+                    throw;
                 }
-                return type;
+                throw BuildTypeLoadException(typeName, ex);
             }
+            return type;
         }
 
         /// <summary>
@@ -157,7 +154,7 @@
         /// If the supplied <paramref name="typeName"/> could not be resolved
         /// to a <see cref="System.Type"/>.
         /// </exception>
-        private Type ResolveType(string typeName)
+        private static Type ResolveType(string typeName)
         {
             Contract.Require.That(typeName, Is.Not.Null & Is.Not.Empty).When("retrieving argument typeName for ResolveType method");
 
@@ -421,7 +418,7 @@
                  arguments.CopyTo(_unresolvedGenericArguments, 0);
            }
 
-            private IList<string> Parse(string args)
+            private static IList<string> Parse(string args)
             {
                 StringBuilder argument = new StringBuilder();
                 IList<string> arguments = new List<string>();
@@ -535,21 +532,18 @@
 
             #region Methods
 
-            private bool HasText(string target)
+            private static bool HasText(string target)
             {
                 if (target == null)
                 {
                     return false;
                 }
-                else
-                {
-                    return HasLength(target.Trim());
-                }
+                return HasLength(target.Trim());
             }
 
-            private bool HasLength(string target)
+            private static bool HasLength(string target)
             {
-                return (target != null && target.Length > 0);
+                return (!string.IsNullOrEmpty(target));
             }
 
             private void SplitTypeAndAssemblyNames(string originalTypeName)

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Xml/NodeUtils.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Xml/NodeUtils.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Xml/NodeUtils.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Xml/NodeUtils.cs Sat Oct 11 09:07:44 2008
@@ -47,11 +47,8 @@
 			if (value == null) 
 			{
 				return string.Empty;
-			} 
-			else 
-			{
-				return value;
 			}
+		    return value;
 		}
 
 		/// <summary>
@@ -67,11 +64,8 @@
 			if (value == null) 
 			{
 				return def;
-			} 
-			else 
-			{
-				return value;
 			}
+		    return value;
 		}
 		/// <summary>
 		/// Searches for the attribute with the specified name in this attributes list.
@@ -86,11 +80,8 @@
 			if (value == null) 
 			{
 				return def;
-			} 
-			else 
-			{
-				return XmlConvert.ToByte(value);
 			}
+		    return XmlConvert.ToByte(value);
 		}
 
 		/// <summary>
@@ -106,11 +97,8 @@
 			if (value == null) 
 			{
 				return def;
-			} 
-			else 
-			{
-				return XmlConvert.ToInt32(value);
 			}
+		    return XmlConvert.ToInt32(value);
 		}
 
 		/// <summary>
@@ -126,11 +114,8 @@
 			if (value == null) 
 			{
 				return def;
-			} 
-			else 
-			{
-				return XmlConvert.ToBoolean(value);
 			}
+		    return XmlConvert.ToBoolean(value);
 		}
 
 		/// <summary>
@@ -171,8 +156,8 @@
 		/// <returns></returns>
 		public static string ParsePropertyTokens(string str, NameValueCollection  properties) 
 		{
-			string OPEN = "${";
-			string CLOSE = "}";
+			const string OPEN = "${";
+			const string CLOSE = "}";
 
 			string newString = str;
 			if (newString != null && properties != null) 

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Apache.Ibatis.DataMapper.SqlClient.Test.2005.csproj
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Apache.Ibatis.DataMapper.SqlClient.Test.2005.csproj?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Apache.Ibatis.DataMapper.SqlClient.Test.2005.csproj (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Apache.Ibatis.DataMapper.SqlClient.Test.2005.csproj Sat Oct 11 09:07:44 2008
@@ -58,6 +58,7 @@
     <Compile Include="Fixtures\Mapping\Cache\WeakCacheTest.cs" />
     <Compile Include="Fixtures\Mapping\CircularReferenceTest.cs" />
     <Compile Include="Fixtures\Mapping\EventTest.cs" />
+    <Compile Include="Fixtures\Mapping\IterateTest.cs" />
     <Compile Include="Fixtures\Mapping\VelocityTest.cs" />
     <Compile Include="Fixtures\Modules\AliasModule.cs" />
     <Compile Include="Fixtures\Modules\EventModule.cs" />
@@ -182,6 +183,7 @@
     <Content Include="Maps\Enumeration.xml" />
     <Content Include="Maps\Event.xml" />
     <Content Include="Maps\GroupByMapping.xml" />
+    <Content Include="Maps\Iterate.xml" />
     <Content Include="Maps\LineItem.xml" />
     <Content Include="Maps\Mapping1.xml" />
     <EmbeddedResource Include="Maps\Mapping2.xml" />

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Domain/Account.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Domain/Account.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Domain/Account.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Domain/Account.cs Sat Oct 11 09:07:44 2008
@@ -19,6 +19,7 @@
 		private bool _cartOption = false;
 	    private Document _document = null;
         private bool? nullBannerOption = false;
+        private List<Account> accounts = new List<Account>();
 
         protected IList<Document> documents = new List<Document>();
 
@@ -99,5 +100,11 @@
             get { return _document; }
             set { _document = value; }
         }
+
+	    public List<Account> Accounts
+	    {
+	        get { return accounts; }
+	        set { accounts = value; }
+	    }
 	}
 }

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/DynamicTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/DynamicTest.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/DynamicTest.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/DynamicTest.cs Sat Oct 11 09:07:44 2008
@@ -1,12 +1,6 @@
-using System;
 using System.Collections;
-using System.Collections.Generic;
-using System.IO;
 using Apache.Ibatis.DataMapper.SqlClient.Test.Domain;
 using NUnit.Framework;
-using NUnit.Framework.SyntaxHelpers;
-using NVelocity;
-using NVelocity.App;
 
 namespace Apache.Ibatis.DataMapper.SqlClient.Test.Fixtures.Mapping
 {
@@ -261,36 +255,6 @@
         }
 
         /// <summary>
-        /// Test Iterate 
-        /// </summary>
-        [Test]
-        public void TestIterate()
-        {
-            IList parameters = new ArrayList();
-            parameters.Add(1);
-            parameters.Add(2);
-            parameters.Add(3);
-
-            IList list = dataMapper.QueryForList("DynamicIterate", parameters);
-            AssertAccount1((Account)list[0]);
-            Assert.AreEqual(3, list.Count);
-        }
-
-        /// <summary>
-        /// Test Iterate 2
-        /// </summary>
-        [Test]
-        public void TestIterate2()
-        {
-            Account account = new Account();
-            account.Ids = new int[3] { 1, 2, 3 };
-
-            IList list = dataMapper.QueryForList("DynamicIterate2", account);
-            AssertAccount1((Account)list[0]);
-            Assert.AreEqual(3, list.Count);
-        }
-
-        /// <summary>
         /// Test Empty Parameter Object
         /// </summary>
         [Test]

Added: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/IterateTest.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/IterateTest.cs?rev=703678&view=auto
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/IterateTest.cs (added)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/IterateTest.cs Sat Oct 11 09:07:44 2008
@@ -0,0 +1,149 @@
+using System.Collections;
+using Apache.Ibatis.DataMapper.SqlClient.Test.Domain;
+using NUnit.Framework;
+using System.Collections.Generic;
+
+namespace Apache.Ibatis.DataMapper.SqlClient.Test.Fixtures.Mapping
+{
+    /// <summary>
+    /// Summary description for DynamicTest.
+    /// </summary>
+    [TestFixture]
+    public class IterateTest : BaseTest
+    {
+        #region SetUp & TearDown
+
+        /// <summary>
+        /// SetUp
+        /// </summary>
+        [SetUp]
+        public void Init()
+        {
+            InitScript(sessionFactory.DataSource, scriptDirectory + "account-init.sql");
+        }
+
+        /// <summary>
+        /// TearDown
+        /// </summary>
+        [TearDown]
+        public void Dispose()
+        { /* ... */ }
+
+        #endregion
+
+        [Test]
+        public void Iterate()
+        {
+            IList parameters = new ArrayList();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = dataMapper.QueryForList("DynamicIterate", parameters);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        [Test]
+        public void Iterate2()
+        {
+            Account account = new Account();
+            account.Ids = new int[3] { 1, 2, 3 };
+
+            IList list = dataMapper.QueryForList("DynamicIterate2", account);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        [Test]
+        public void IterateNestedListProperty() 
+        {
+            Account accountParam = new Account();
+
+            Account account = new Account();
+            account.Id = 1;
+            accountParam.Accounts.Add(account);
+            account = new Account();
+            account.Id = 2;
+            accountParam.Accounts.Add(account);
+            account = new Account();
+            account.Id = 3;
+            accountParam.Accounts.Add(account);
+
+            IList<Account> accounts = dataMapper.QueryForList<Account>("IterateNestedListProperty", accountParam);
+            AssertAccount1((Account)accounts[0]);
+            Assert.AreEqual(3, accounts.Count);
+        }
+
+        [Test]
+        public void IterateNestedListPropertyB() 
+        {
+            Account accountParam = new Account();
+            accountParam.Id = 99;
+
+            Account account = new Account();
+            account.Id = 1;
+            accountParam.Accounts.Add(account);
+            account = new Account();
+            account.Id = 2;
+            accountParam.Accounts.Add(account);
+            account = new Account();
+            account.Id = 3;
+            accountParam.Accounts.Add(account);
+
+            IList<Account> accounts = dataMapper.QueryForList<Account>("IterateNestedListPropertyB", accountParam);
+            AssertAccount1((Account)accounts[0]);
+            Assert.AreEqual(3, accounts.Count);
+        }
+
+        [Test]
+        public void IterateNestedMapListProperty()
+        {
+            IDictionary map = new Hashtable();
+            IList<Account> accountList = new List<Account>();
+            map["Accounts"] = accountList;
+
+            Account account = new Account();
+            account.Id = 1;
+            accountList.Add(account);
+            account = new Account();
+            account.Id = 2;
+            accountList.Add(account);
+            account = new Account();
+            account.Id = 3;
+            accountList.Add(account);
+
+            IList<Account> accounts = dataMapper.QueryForList<Account>("IterateNestedMapListProperty", map);
+            AssertAccount1((Account)accounts[0]);
+            Assert.AreEqual(3, accounts.Count);
+        }
+
+        [Test]
+        public void IterateLiteral()
+        {
+            IList<int> parameters = new List<int>();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = dataMapper.QueryForList("DynamicIterateLiteral", parameters);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, list.Count);
+        }
+
+        [Ignore]
+        public void IterateInConditional()
+        {
+            IList<int> parameters = new List<int>();
+            parameters.Add(1);
+            parameters.Add(2);
+            parameters.Add(3);
+
+            IList list = dataMapper.QueryForList("DynamicIterateInConditional", parameters);
+            Assert.AreEqual(2, list.Count);
+            AssertAccount1((Account)list[0]);
+            Assert.AreEqual(3, ((Account)list[0]).Id);
+
+        }
+    }
+}

Propchange: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/IterateTest.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/IterateTest.cs
------------------------------------------------------------------------------
    svn:keywords = Id LastChangedDate LastChangedBy

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/DynamicAccount.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/DynamicAccount.xml?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/DynamicAccount.xml (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/DynamicAccount.xml Sat Oct 11 09:07:44 2008
@@ -220,35 +220,6 @@
       </dynamic>
     </statement>
 
-    <statement id="DynamicIterate"
-					parameterClass="list"
-					resultClass="Account">
-      select
-      Account_ID			as Id,
-      Account_FirstName	as FirstName,
-      Account_LastName	as LastName,
-      Account_Email		as EmailAddress
-      from Accounts
-      WHERE Account_ID IN
-      <iterate open="(" close=")" conjunction=",">
-        #[]#
-      </iterate>
-    </statement>
-
-    <statement id="DynamicIterate2"
-					parameterClass="Account"
-					resultClass="Account">
-      select
-      Account_ID			as Id,
-      Account_FirstName	as FirstName,
-      Account_LastName	as LastName,
-      Account_Email		as EmailAddress
-      from Accounts
-      WHERE Account_ID IN
-      <iterate property="Ids" open="(" close=")"  conjunction="," >
-        #Ids[]#
-      </iterate>
-    </statement>
 
     <statement id="MultiDynamicIterate"
             parameterClass="list"
@@ -511,6 +482,7 @@
       order by Account_LastName
     </statement>
 
+   
     <insert id="SelectKeyWithDynamicSql">
       INSERT INTO $AccountsTableName$
       (

Added: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Iterate.xml
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Iterate.xml?rev=703678&view=auto
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Iterate.xml (added)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Iterate.xml Sat Oct 11 09:07:44 2008
@@ -0,0 +1,107 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Iterate" xmlns="http://ibatis.apache.org/mapping" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  
+  <statements>
+
+    <select id="DynamicIterateInConditional" parameterClass="list" resultClass="Account">
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction=",">
+        <isEqual property="[]" compareValue="1">
+          #[]#
+        </isEqual>
+        <isEqual property="[]" compareValue="3">
+          #[]#
+        </isEqual>
+      </iterate>
+    </select>
+    
+    <statement id="DynamicIterate" parameterClass="list" resultClass="Account">
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction=",">
+        #[]#
+      </iterate>
+    </statement>
+
+    <statement id="DynamicIterate2" parameterClass="Account" resultClass="Account">
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate property="Ids" open="(" close=")"  conjunction="," >
+        #Ids[]#
+      </iterate>
+    </statement>
+
+    <select id="DynamicIterateLiteral" parameterClass="list" resultClass="Account">
+      select
+      Account_ID			as Id,
+      Account_FirstName	as FirstName,
+      Account_LastName	as LastName,
+      Account_Email		as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction=",">
+        $[]$
+      </iterate>
+    </select>
+    
+    <select id="IterateNestedListProperty" parameterClass="Account" resultClass="Account">
+      select
+      Account_ID          as Id,
+      Account_FirstName  as FirstName,
+      Account_LastName   as LastName,
+      Account_Email       as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction="," property="Accounts">
+        #Accounts[].Id#
+      </iterate>
+    </select>
+
+    <select id="IterateNestedListPropertyB" parameterClass="Account" resultClass="Account">
+      select
+      Account_ID          as Id,
+      Account_FirstName  as FirstName,
+      Account_LastName   as LastName,
+      Account_Email       as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction="," property="Accounts">
+        #Accounts[].Id#
+        <isNotEqual prepend="," compareProperty="FirstName" compareValue="test">
+          #Id#
+        </isNotEqual>
+      </iterate>
+    </select>
+
+    <select id="IterateNestedMapListProperty" parameterClass="map" resultClass="Account">
+      select
+      Account_ID          as Id,
+      Account_FirstName  as FirstName,
+      Account_LastName   as LastName,
+      Account_Email       as EmailAddress
+      from Accounts
+      WHERE Account_ID IN
+      <iterate open="(" close=")" conjunction="," property="Accounts">
+        #Accounts[].Id#
+      </iterate>
+    </select>
+    
+  </statements>
+  
+</sqlMap>
\ No newline at end of file

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/bin/Debug/SqlMap.config
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/bin/Debug/SqlMap.config?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/bin/Debug/SqlMap.config (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/bin/Debug/SqlMap.config Sat Oct 11 09:07:44 2008
@@ -49,5 +49,6 @@
 		<sqlMap uri="file://../../Maps/Coupons.xml"/>
     <sqlMap uri="file://../../Maps/ParentChild1.xml"/>
     <sqlMap uri="file://../../Maps/ParentChild2.xml"/>
+    <sqlMap uri="file://../../Maps/Iterate.xml"/>
   </sqlMaps>
 </sqlMapConfig>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Configuration/ModelBuilder/BuildStatements.cs Sat Oct 11 09:07:44 2008
@@ -338,7 +338,8 @@
                     }
                     else
                     {
-                        sqlText = paramParser.ParseInlineParameterMap(modelStore.DataExchangeFactory, null, child.Value);
+                        
+                        sqlText = InlineParameterMapParser.ParseInlineParameterMap(modelStore.DataExchangeFactory, statementConfig.Id, null, child.Value);
                     }
 
                     dynamic.AddChild(sqlText);

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DBHelperParameterCache.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DBHelperParameterCache.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DBHelperParameterCache.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DBHelperParameterCache.cs Sat Oct 11 09:07:44 2008
@@ -231,7 +231,7 @@
         /// <summary>
         /// Retrieves the set of IDataParameters appropriate for the stored procedure
         /// </summary>
-        /// <param name="dataSource">The data source.</param>
+        /// <param name="session">The session.</param>
         /// <param name="spName">the name of the stored procedure</param>
         /// <param name="includeReturnValueParameter">a bool value indicating whether the return value parameter should be included in the results</param>
         /// <returns>an array of IDataParameters</returns>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/BaseDataExchange.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/BaseDataExchange.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/BaseDataExchange.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/BaseDataExchange.cs Sat Oct 11 09:07:44 2008
@@ -33,7 +33,7 @@
 	/// </summary>
 	public abstract class BaseDataExchange : IDataExchange
 	{
-		private DataExchangeFactory _dataExchangeFactory = null;
+		private readonly DataExchangeFactory _dataExchangeFactory = null;
 
 		/// <summary>
 		/// Getter for the factory that created this object
@@ -47,7 +47,7 @@
 		/// Constructor
 		/// </summary>
 		/// <param name="dataExchangeFactory"></param>
-		public BaseDataExchange(DataExchangeFactory dataExchangeFactory)
+		protected BaseDataExchange(DataExchangeFactory dataExchangeFactory)
 		{
 			_dataExchangeFactory = dataExchangeFactory;
 		}

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ComplexDataExchange.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ComplexDataExchange.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ComplexDataExchange.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ComplexDataExchange.cs Sat Oct 11 09:07:44 2008
@@ -53,25 +53,18 @@
 		/// <param name="parameterObject"></param>
 		public override object GetData(ParameterProperty mapping, object parameterObject)
 		{
-            if (parameterObject!=null)
+		    if (parameterObject!=null)
             {
- 			    if (this.DataExchangeFactory.TypeHandlerFactory.IsSimpleType(parameterObject.GetType()))
+                if (DataExchangeFactory.TypeHandlerFactory.IsSimpleType(parameterObject.GetType()))
 			    {
 				    return parameterObject;
 			    }
-			    else
-			    {
-				    return ObjectProbe.GetMemberValue(parameterObject, mapping.PropertyName, this.DataExchangeFactory.AccessorFactory);
-			    }               
-            }
-		    else
-            {
-                return null;
+                return ObjectProbe.GetMemberValue(parameterObject, mapping.PropertyName, DataExchangeFactory.AccessorFactory);
             }
-
+		    return null;
 		}
 
-		/// <summary>
+	    /// <summary>
 		/// Sets the value to the result property.
 		/// </summary>
 		/// <param name="mapping"></param>
@@ -80,8 +73,8 @@
 		public override void SetData(ref object target, ResultProperty mapping, object dataBaseValue)
 		{
 			ObjectProbe.SetMemberValue(target, mapping.PropertyName, dataBaseValue, 
-				this.DataExchangeFactory.ObjectFactory,
-				this.DataExchangeFactory.AccessorFactory);
+				DataExchangeFactory.ObjectFactory,
+				DataExchangeFactory.AccessorFactory);
 		}
 
 		/// <summary>
@@ -94,8 +87,8 @@
 		public override void SetData(ref object target, ParameterProperty mapping, object dataBaseValue)
 		{
 			ObjectProbe.SetMemberValue(target, mapping.PropertyName, dataBaseValue, 
-				this.DataExchangeFactory.ObjectFactory,
-				this.DataExchangeFactory.AccessorFactory);
+				DataExchangeFactory.ObjectFactory,
+				DataExchangeFactory.AccessorFactory);
 		}
 
 		#endregion

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DataExchangeFactory.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DataExchangeFactory.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DataExchangeFactory.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DataExchangeFactory.cs Sat Oct 11 09:07:44 2008
@@ -29,9 +29,6 @@
 using Apache.Ibatis.Common.Utilities.Objects.Members;
 using Apache.Ibatis.DataMapper.TypeHandlers;
 
-
-using System.Collections.Generic;
-
 namespace Apache.Ibatis.DataMapper.DataExchange
 {
 	/// <summary>
@@ -39,14 +36,14 @@
 	/// </summary>
 	public class DataExchangeFactory
 	{
-		private TypeHandlerFactory _typeHandlerFactory = null;
-		private IObjectFactory _objectFactory = null;
-        private AccessorFactory _accessorFactory = null;
-
-		private IDataExchange _primitiveDataExchange = null;
-		private IDataExchange _complexDataExchange = null;
-		private IDataExchange _listDataExchange = null;
-		private IDataExchange _dictionaryDataExchange = null;
+		private readonly TypeHandlerFactory _typeHandlerFactory = null;
+		private readonly IObjectFactory _objectFactory = null;
+        private readonly AccessorFactory _accessorFactory = null;
+
+		private readonly IDataExchange _primitiveDataExchange = null;
+		private readonly IDataExchange _complexDataExchange = null;
+		private readonly IDataExchange _listDataExchange = null;
+		private readonly IDataExchange _dictionaryDataExchange = null;
 
 		/// <summary>
 		///  Getter for the type handler factory

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DictionaryDataExchange.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DictionaryDataExchange.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DictionaryDataExchange.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DictionaryDataExchange.cs Sat Oct 11 09:07:44 2008
@@ -54,7 +54,7 @@
 		public override object GetData(ParameterProperty mapping, object parameterObject)
 		{
 			return ObjectProbe.GetMemberValue(parameterObject, mapping.PropertyName,
-				this.DataExchangeFactory.AccessorFactory);
+				DataExchangeFactory.AccessorFactory);
 		}
 
         /// <summary>
@@ -78,8 +78,8 @@
 		public override void SetData(ref object target, ParameterProperty mapping, object dataBaseValue)
 		{
 			ObjectProbe.SetMemberValue(target, mapping.PropertyName, dataBaseValue, 
-				this.DataExchangeFactory.ObjectFactory,
-				this.DataExchangeFactory.AccessorFactory);
+				DataExchangeFactory.ObjectFactory,
+				DataExchangeFactory.AccessorFactory);
 		}
 
 		#endregion

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DotNetObjectDataExchange.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DotNetObjectDataExchange.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DotNetObjectDataExchange.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/DotNetObjectDataExchange.cs Sat Oct 11 09:07:44 2008
@@ -60,18 +60,15 @@
 		/// <param name="parameterObject"></param>
 		public override object GetData(ParameterProperty mapping, object parameterObject)
 		{
-            if (mapping.IsComplexMemberName || _parameterClass!=parameterObject.GetType())
+		    if (mapping.IsComplexMemberName || _parameterClass!=parameterObject.GetType())
 			{
 				return ObjectProbe.GetMemberValue(parameterObject, mapping.PropertyName,
-					this.DataExchangeFactory.AccessorFactory);
-			}
-			else
-			{
-				return mapping.GetAccessor.Get(parameterObject);
+					DataExchangeFactory.AccessorFactory);
 			}
+		    return mapping.GetAccessor.Get(parameterObject);
 		}
 
-		/// <summary>
+	    /// <summary>
 		/// Sets the value to the result property.
 		/// </summary>
 		/// <param name="mapping"></param>
@@ -88,8 +85,8 @@
 			if ( mapping.IsComplexMemberName)
 			{
 				ObjectProbe.SetMemberValue(target, mapping.PropertyName, dataBaseValue, 
-					this.DataExchangeFactory.ObjectFactory,
-					this.DataExchangeFactory.AccessorFactory);
+					DataExchangeFactory.ObjectFactory,
+					DataExchangeFactory.AccessorFactory);
 			}
 			else
 			{
@@ -109,12 +106,12 @@
 			if (mapping.IsComplexMemberName)
 			{	
 				ObjectProbe.SetMemberValue(target, mapping.PropertyName, dataBaseValue, 
-					this.DataExchangeFactory.ObjectFactory,
-					this.DataExchangeFactory.AccessorFactory);
+					DataExchangeFactory.ObjectFactory,
+					DataExchangeFactory.AccessorFactory);
 			}
 			else
 			{
-                ISetAccessorFactory setAccessorFactory = this.DataExchangeFactory.AccessorFactory.SetAccessorFactory;
+                ISetAccessorFactory setAccessorFactory = DataExchangeFactory.AccessorFactory.SetAccessorFactory;
                 ISetAccessor _setAccessor = setAccessorFactory.CreateSetAccessor(_parameterClass, mapping.PropertyName);
 
                 _setAccessor.Set(target, dataBaseValue);

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ListDataExchange.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ListDataExchange.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ListDataExchange.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/ListDataExchange.cs Sat Oct 11 09:07:44 2008
@@ -53,7 +53,7 @@
 		public override object GetData(ParameterProperty mapping, object parameterObject)
 		{
 			return ObjectProbe.GetMemberValue(parameterObject, mapping.PropertyName,
-				this.DataExchangeFactory.AccessorFactory);
+				DataExchangeFactory.AccessorFactory);
 		}
 
 		/// <summary>
@@ -65,8 +65,8 @@
 		public override void SetData(ref object target, ResultProperty mapping, object dataBaseValue)
 		{
 			ObjectProbe.SetMemberValue(target, mapping.PropertyName, dataBaseValue, 
-				this.DataExchangeFactory.ObjectFactory,
-				this.DataExchangeFactory.AccessorFactory);
+				DataExchangeFactory.ObjectFactory,
+				DataExchangeFactory.AccessorFactory);
 		}
 
 		/// <summary>
@@ -79,8 +79,8 @@
 		public override void SetData(ref object target, ParameterProperty mapping, object dataBaseValue)
 		{
 			ObjectProbe.SetMemberValue(target, mapping.PropertyName, dataBaseValue, 
-				this.DataExchangeFactory.ObjectFactory,
-				this.DataExchangeFactory.AccessorFactory);
+				DataExchangeFactory.ObjectFactory,
+				DataExchangeFactory.AccessorFactory);
 		}
 
 		#endregion

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/PrimitiveDataExchange.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/PrimitiveDataExchange.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/PrimitiveDataExchange.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DataExchange/PrimitiveDataExchange.cs Sat Oct 11 09:07:44 2008
@@ -55,18 +55,15 @@
 		/// <param name="parameterObject"></param>
 		public override object GetData(ParameterProperty mapping, object parameterObject)
 		{
-			if (mapping.IsComplexMemberName)
+		    if (mapping.IsComplexMemberName)
 			{
 				return ObjectProbe.GetMemberValue(parameterObject, mapping.PropertyName, 
-					this.DataExchangeFactory.AccessorFactory);
-			}
-			else
-			{
-				return parameterObject;
+					DataExchangeFactory.AccessorFactory);
 			}
+		    return parameterObject;
 		}
 
-		/// <summary>
+	    /// <summary>
 		/// Sets the value to the result property.
 		/// </summary>
 		/// <param name="mapping"></param>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DefaultMapperFactory.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DefaultMapperFactory.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DefaultMapperFactory.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/DefaultMapperFactory.cs Sat Oct 11 09:07:44 2008
@@ -24,7 +24,6 @@
 #endregion
 
 using System;
-using Apache.Ibatis.DataMapper.Configuration;
 
 namespace Apache.Ibatis.DataMapper
 {

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/BaseStrategy.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/BaseStrategy.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/BaseStrategy.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/BaseStrategy.cs Sat Oct 11 09:07:44 2008
@@ -49,7 +49,7 @@
 	    /// <param name="resultMap"></param>
 	    /// <param name="reader"></param>
 	    /// <returns></returns>
-        protected string GetUniqueKey(IResultMap resultMap, IDataReader reader)
+        protected static string GetUniqueKey(IResultMap resultMap, IDataReader reader)
         {
             if (resultMap.GroupByProperties.Count > 0)
             {
@@ -67,18 +67,12 @@
                     // we should never go here
                     return null;
                 }
-                else
-                {
-                    // separator value not likely to appear in a database
-                    keyBuffer.Append(KEY_SEPARATOR);
-                    return keyBuffer.ToString();
-                }
-            }
-            else
-            {
-                // we should never go here
-                return null;
+                // separator value not likely to appear in a database
+                keyBuffer.Append(KEY_SEPARATOR);
+                return keyBuffer.ToString();
             }
+	        // we should never go here
+	        return null;
         }
 	    
 		/// <summary>
@@ -89,7 +83,7 @@
 		/// <param name="resultMap">The result map.</param>
 		/// <param name="resultObject">The result object.</param>
 		/// <returns>Indicates if we have found a row.</returns>
-		protected bool FillObjectWithReaderAndResultMap(RequestScope request,IDataReader reader,
+		protected static bool FillObjectWithReaderAndResultMap(RequestScope request,IDataReader reader,
                                                         IResultMap resultMap, ref object resultObject)
 		{
 			bool dataFound = false;
@@ -108,11 +102,8 @@
 			    request.IsRowDataFound = dataFound;
 			    return dataFound;
 		    }
-		    else
-            {
-                return true;
-            }
-        }
+		    return true;
+		}
 
 	}
 }

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/MappedStatementEventSupport.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/MappedStatementEventSupport.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/MappedStatementEventSupport.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/MappedStatementEventSupport.cs Sat Oct 11 09:07:44 2008
@@ -121,10 +121,7 @@
                 handlers(this, eventArgs);            
                 return eventArgs.ParameterObject;
             }
-            else
-            {
-                return parameterObject;
-            }
+            return parameterObject;
         }
 
         /// <summary>
@@ -147,10 +144,7 @@
                 handlers(this, eventArgs);
                 return (TType)eventArgs.ResultObject;
             }
-            else
-            {
-                return resultObject;
-            }
+            return resultObject;
         }
     }
 }

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PostBindind.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PostBindind.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PostBindind.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PostBindind.cs Sat Oct 11 09:07:44 2008
@@ -40,7 +40,7 @@
 		/// <summary>
 		/// Enumeration of the ExecuteQuery method.
 		/// </summary>
-		public enum ExecuteMethod : int
+		public enum ExecuteMethod
 		{
 			/// <summary>
 			/// Execute Query For Object

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PropertStrategy/CircularStrategy.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PropertStrategy/CircularStrategy.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PropertStrategy/CircularStrategy.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/PropertStrategy/CircularStrategy.cs Sat Oct 11 09:07:44 2008
@@ -113,7 +113,7 @@
         /// <param name="resultMap">The result map.</param>
         /// <param name="reader">The reader.</param>
         /// <returns></returns>
-        private string GetCircularKey(IResultMap resultMap, IDataReader reader)
+        private static string GetCircularKey(IResultMap resultMap, IDataReader reader)
         {
             if (resultMap.KeysProperties.Count > 0)
             {

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ReaderAutoMapper.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ReaderAutoMapper.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ReaderAutoMapper.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ReaderAutoMapper.cs Sat Oct 11 09:07:44 2008
@@ -36,7 +36,6 @@
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
 using Apache.Ibatis.DataMapper.DataExchange;
 using Apache.Ibatis.DataMapper.Exceptions;
-using Apache.Ibatis.DataMapper.MappedStatements.PropertyStrategy;
 using Apache.Ibatis.DataMapper.TypeHandlers;
 using System.Collections.Generic;
 
@@ -124,7 +123,7 @@
 						}
 						catch
 						{
-							_logger.Error("The column [" + columnName + "] could not be auto mapped to a property on [" + resultObject.ToString() + "]");
+							_logger.Error("The column [" + columnName + "] could not be auto mapped to a property on [" + resultObject + "]");
 						}
 					}
 					else

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ResultStrategy/CirularStrategy.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ResultStrategy/CirularStrategy.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ResultStrategy/CirularStrategy.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/MappedStatements/ResultStrategy/CirularStrategy.cs Sat Oct 11 09:07:44 2008
@@ -108,7 +108,7 @@
         /// <param name="resultMap">The result map.</param>
         /// <param name="reader">The reader.</param>
         /// <returns></returns>
-        private string GetCircularKey(IResultMap resultMap, IDataReader reader)
+        private static string GetCircularKey(IResultMap resultMap, IDataReader reader)
         {
             if (resultMap.KeysProperties.Count > 0)
             {

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParameterMapParser.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParameterMapParser.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParameterMapParser.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParameterMapParser.cs Sat Oct 11 09:07:44 2008
@@ -56,10 +56,11 @@
         /// Parse Inline ParameterMap
         /// </summary>
         /// <param name="dataExchangeFactory">The data exchange factory.</param>
+        /// <param name="statementId">The statement id.</param>
         /// <param name="statement">The statement.</param>
         /// <param name="sqlStatement">The SQL statement.</param>
         /// <returns>A new sql command text.</returns>
-        public SqlText ParseInlineParameterMap(DataExchangeFactory dataExchangeFactory, IStatement statement, string sqlStatement)
+        public static SqlText ParseInlineParameterMap(DataExchangeFactory dataExchangeFactory, string statementId, IStatement statement, string sqlStatement)
 		{
 			string newSql = sqlStatement;
             List<ParameterProperty> mappingList = new List<ParameterProperty>();
@@ -89,7 +90,7 @@
                        
                         //EmailAddress,column=string,type=string,dbType=Varchar,nullValue=no_email@provided.com
                         string parameter = toAnalyse.Substring(start + NEW_BEGIN_TOKEN.Length, end - start - NEW_BEGIN_TOKEN.Length);
-                        ParameterProperty mapping = NewParseMapping(parameter, parameterClassType, dataExchangeFactory, statement);
+                        ParameterProperty mapping = NewParseMapping(parameter, parameterClassType, dataExchangeFactory, statementId);
                         mappingList.Add(mapping);
                         newSqlBuffer.Append(prepend);
                         newSqlBuffer.Append(MARK_TOKEN);
@@ -133,7 +134,7 @@
 						    } 
 						    else 
 						    {
-                                mapping = NewParseMapping(token, parameterClassType, dataExchangeFactory, statement);
+                                mapping = NewParseMapping(token, parameterClassType, dataExchangeFactory, statementId);
 						    }															 
 
 						    mappingList.Add(mapping);
@@ -143,7 +144,7 @@
 						    token = (string)enumerator.Current;
 						    if (!PARAMETER_TOKEN.Equals(token)) 
 						    {
-							    throw new DataMapperException("Unterminated inline parameter in mapped statement (" + statement.Id + ").");
+							    throw new DataMapperException("Unterminated inline parameter in mapped statement (" + statementId + ").");
 						    }
 						    token = null;
 					    }
@@ -180,12 +181,12 @@
         /// <param name="token">The token.</param>
         /// <param name="parameterClassType">Type of the parameter class.</param>
         /// <param name="dataExchangeFactory">The data exchange factory.</param>
-        /// <param name="statement">The statement.</param>
+        /// <param name="statementId">The statement id.</param>
         /// <returns></returns>
         /// <example>
         /// #propertyName,type=string,dbype=Varchar,direction=Input,nullValue=N/A,handler=string#
         /// </example>
-        private ParameterProperty NewParseMapping(string token, Type parameterClassType, DataExchangeFactory dataExchangeFactory,IStatement statement) 
+        private static ParameterProperty NewParseMapping(string token, Type parameterClassType, DataExchangeFactory dataExchangeFactory, string statementId) 
 		{
             string propertyName = string.Empty;
             string type = string.Empty;
@@ -203,15 +204,15 @@
 
 			while (enumeratorParam.MoveNext()) 
 			{
-				string field = (string)enumeratorParam.Current;
+                string field = ((string)enumeratorParam.Current).Trim().ToLower();
 				if (enumeratorParam.MoveNext()) 
 				{
-					string value = (string)enumeratorParam.Current;
+                    string value = ((string)enumeratorParam.Current).Trim();
 					if ("type".Equals(field)) 
 					{
                         type = value;
 					} 
-					else if ("dbtype".Equals(field.ToLower())) 
+					else if ("dbtype".Equals(field)) 
 					{
                         dbType = value;
 					} 
@@ -219,7 +220,7 @@
 					{
                         direction = value;
 					}
-                    else if ("nullvalue".Equals(field.ToLower())) 
+                    else if ("nullvalue".Equals(field)) 
 					{
                         if (value.StartsWith("\"") && value.EndsWith("\""))
                         {
@@ -240,7 +241,7 @@
                     } 
 					else 
 					{
-						throw new DataMapperException("When parsing inline parameter for statement '"+statement.Id+"', can't recognize parameter mapping field: '" + field + "' in " + token+", check your inline parameter syntax.");
+						throw new DataMapperException("When parsing inline parameter for statement '"+statementId+"', can't recognize parameter mapping field: '" + field + "' in " + token+", check your inline parameter syntax.");
 					}
 				} 
 				else 
@@ -274,7 +275,7 @@
         /// #propertyName:dbType:nullValue#
         /// </example>
         /// <returns></returns>
-        private ParameterProperty OldParseMapping(string token, Type parameterClassType, DataExchangeFactory dataExchangeFactory) 
+        private static ParameterProperty OldParseMapping(string token, Type parameterClassType, DataExchangeFactory dataExchangeFactory) 
 		{
             string propertyName = string.Empty;
             string dbType = string.Empty;

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParemeterMapBuilder.cs Sat Oct 11 09:07:44 2008
@@ -68,7 +68,7 @@
                 // Build a Parametermap with the inline parameters.
                 // if they exist. Then delete inline infos from sqltext.
 
-                SqlText sqlText = paramParser.ParseInlineParameterMap(modelStore.DataExchangeFactory, statement, newSqlCommandText);
+                SqlText sqlText = InlineParameterMapParser.ParseInlineParameterMap(modelStore.DataExchangeFactory, statement.Id, statement, newSqlCommandText);
 
                 if (sqlText.Parameters.Length > 0)
                 {

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/Dynamic/DynamicSql.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/Dynamic/DynamicSql.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/Dynamic/DynamicSql.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/Dynamic/DynamicSql.cs Sat Oct 11 09:07:44 2008
@@ -291,7 +291,7 @@
 
 									if (handler.IsPostParseRequired) 
 									{
-                                        SqlText sqlText = paramParser.ParseInlineParameterMap(dataExchangeFactory, null, body.ToString());
+                                        SqlText sqlText = InlineParameterMapParser.ParseInlineParameterMap(dataExchangeFactory, statement.Id, null, body.ToString());
 										buffer.Append(sqlText.Text);
 										ParameterProperty[] mappings = sqlText.Parameters;
 										if (mappings != null) 

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Scope/RequestScope.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Scope/RequestScope.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Scope/RequestScope.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Scope/RequestScope.cs Sat Oct 11 09:07:44 2008
@@ -26,7 +26,6 @@
 
 #region Using
 
-using System.Collections;
 using System.Data;
 using System.Runtime.CompilerServices;
 using Apache.Ibatis.DataMapper.Model.ParameterMapping;

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/AnsiStringTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/AnsiStringTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/AnsiStringTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/AnsiStringTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -28,7 +28,6 @@
 
 using System;
 using System.Data;
-using System.Globalization;
 
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
 #endregion 
@@ -64,14 +63,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
-                return System.DBNull.Value;
-            }
-            else
-            {
-                return dataReader.GetString(index);
+                return DBNull.Value;
             }
+            return dataReader.GetString(index);
         }
 
 
@@ -83,14 +79,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
-            {
-                return System.DBNull.Value;
-            }
-            else
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
-                return dataReader.GetString(mapping.ColumnIndex);
+                return DBNull.Value;
             }
+            return dataReader.GetString(mapping.ColumnIndex);
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/BaseTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/BaseTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/BaseTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/BaseTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -24,14 +24,11 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 
 using System;
 using System.Data;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
 
-#endregion 
-
 namespace Apache.Ibatis.DataMapper.TypeHandlers
 {
 	/// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -79,7 +79,7 @@
         /// <param name="columnIndex">Index of the column.</param>
         /// <param name="dataReader">The data reader.</param>
         /// <returns></returns>
-		private byte[] GetValueByIndex(int columnIndex, IDataReader dataReader) 
+		private static byte[] GetValueByIndex(int columnIndex, IDataReader dataReader) 
 		{
 			// determine the buffer size
 			int bufferLength = (int) dataReader.GetBytes(columnIndex, 0, null, 0, 0);

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/CustomTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/CustomTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/CustomTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/CustomTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -34,7 +34,7 @@
 	/// </summary>
     public sealed class CustomTypeHandler : BaseTypeHandler
 	{
-		private ITypeHandlerCallback _callback = null;
+		private readonly ITypeHandlerCallback _callback = null;
 
         /// <summary>
         /// Initializes a new instance of the <see cref="CustomTypeHandler"/> class.

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableBooleanTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableBooleanTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableBooleanTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableBooleanTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,9 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
-
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -71,15 +66,12 @@
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-			if (dataReader.IsDBNull(index) == true)
+			if (dataReader.IsDBNull(index))
 			{
 				return DBNull.Value;
 			}
-			else
-			{
-				// Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
-                return new bool?(Convert.ToBoolean(dataReader.GetValue(index)));
-			}
+            // Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
+            return new bool?(Convert.ToBoolean(dataReader.GetValue(index)));
 		}
 
         /// <summary>
@@ -88,17 +80,14 @@
         /// <param name="mapping"></param>
         /// <param name="dataReader"></param>
         /// <returns></returns>
-		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
-		{
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
-            {
-                return System.DBNull.Value;
-            }
-            else
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
+        {
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
-                return new bool?( Convert.ToBoolean(dataReader.GetValue(mapping.ColumnIndex)));
+                return DBNull.Value;
             }
-		}
+            return new bool?( Convert.ToBoolean(dataReader.GetValue(mapping.ColumnIndex)));
+        }
 
         /// <summary>
         /// Retrieve ouput database value of an output parameter

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableByteTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableByteTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableByteTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableByteTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,9 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
-
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -71,14 +66,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new byte?( Convert.ToByte(dataReader.GetValue(index)) );
-            }
+            return new byte?( Convert.ToByte(dataReader.GetValue(index)) );
         }
 
         /// <summary>
@@ -89,14 +81,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new byte?( Convert.ToByte(dataReader.GetValue(mapping.ColumnIndex)) );
-            }
+            return new byte?( Convert.ToByte(dataReader.GetValue(mapping.ColumnIndex)) );
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableCharTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableCharTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableCharTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableCharTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,10 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -71,14 +67,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new char?( dataReader.GetString(index)[0] );
-            }
+            return new char?( dataReader.GetString(index)[0] );
         }
 
         /// <summary>
@@ -89,14 +82,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new char?( dataReader.GetString(mapping.ColumnIndex)[0] );
-            }
+            return new char?( dataReader.GetString(mapping.ColumnIndex)[0] );
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDateTimeTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDateTimeTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDateTimeTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDateTimeTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,11 +23,9 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -68,14 +66,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new DateTime?( dataReader.GetDateTime(index) );
-            }
+            return new DateTime?( dataReader.GetDateTime(index) );
         }
 
         /// <summary>
@@ -86,14 +81,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new DateTime?(dataReader.GetDateTime(mapping.ColumnIndex));
-            }
+            return new DateTime?(dataReader.GetDateTime(mapping.ColumnIndex));
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDecimalTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDecimalTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDecimalTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDecimalTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,15 +23,11 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 using System.Globalization;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -72,14 +68,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new decimal?( dataReader.GetDecimal(index) );
-            }
+            return new decimal?( dataReader.GetDecimal(index) );
         }
 
         /// <summary>
@@ -90,14 +83,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new decimal?( dataReader.GetDecimal(mapping.ColumnIndex) );
-            }
+            return new decimal?( dataReader.GetDecimal(mapping.ColumnIndex) );
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDoubleTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDoubleTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDoubleTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableDoubleTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,10 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -71,14 +67,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new double?(dataReader.GetDouble(index));
-            }
+            return new double?(dataReader.GetDouble(index));
         }
 
         /// <summary>
@@ -89,14 +82,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new double?(dataReader.GetDouble(mapping.ColumnIndex) );
-            }
+            return new double?(dataReader.GetDouble(mapping.ColumnIndex) );
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableGuidTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableGuidTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableGuidTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableGuidTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,10 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -71,14 +67,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new Guid?( dataReader.GetGuid(index) );
-            }
+            return new Guid?( dataReader.GetGuid(index) );
         }
 
         /// <summary>
@@ -89,14 +82,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new Guid?( dataReader.GetGuid(mapping.ColumnIndex) );
-            }
+            return new Guid?( dataReader.GetGuid(mapping.ColumnIndex) );
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt16TypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt16TypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt16TypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt16TypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,10 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -71,15 +67,12 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                // Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
-                return new Int16?(Convert.ToInt16(dataReader.GetValue(index)));
-            }
+            // Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
+            return new Int16?(Convert.ToInt16(dataReader.GetValue(index)));
         }
 
         /// <summary>
@@ -90,14 +83,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new Int16?(Convert.ToInt16(dataReader.GetValue(mapping.ColumnIndex)));
-            }
+            return new Int16?(Convert.ToInt16(dataReader.GetValue(mapping.ColumnIndex)));
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt32TypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt32TypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt32TypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt32TypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,10 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -70,15 +66,12 @@
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-			if (dataReader.IsDBNull(index) == true)
+			if (dataReader.IsDBNull(index))
 			{
 				return DBNull.Value;
 			}
-			else
-			{
-				// Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
-				return new Int32?( Convert.ToInt32(dataReader.GetValue(index)) );
-			}
+		    // Don't used dataReader.GetInt32 to fix oracle who alwray return decimal type
+		    return new Int32?( Convert.ToInt32(dataReader.GetValue(index)) );
 		}
 
         /// <summary>
@@ -87,17 +80,14 @@
         /// <param name="mapping"></param>
         /// <param name="dataReader"></param>
         /// <returns></returns>
-		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
-		{
-			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
+        {
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
 			{
 				return DBNull.Value;
 			}
-			else
-			{
-				return new Int32?( Convert.ToInt32(dataReader.GetValue(mapping.ColumnIndex)) );
-			}
-		}
+            return new Int32?( Convert.ToInt32(dataReader.GetValue(mapping.ColumnIndex)) );
+        }
 
         /// <summary>
         /// Retrieve ouput database value of an output parameter

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt64TypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt64TypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt64TypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableInt64TypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,10 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -71,14 +67,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new Int64?(Convert.ToInt64(dataReader.GetValue(index)));
-            }
+            return new Int64?(Convert.ToInt64(dataReader.GetValue(index)));
         }
 
         /// <summary>
@@ -89,14 +82,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new Int64?(Convert.ToInt64(dataReader.GetValue(mapping.ColumnIndex)));
-            }
+            return new Int64?(Convert.ToInt64(dataReader.GetValue(mapping.ColumnIndex)));
         }
 
         /// <summary>

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableSByteTypeHandler.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableSByteTypeHandler.cs?rev=703678&r1=703677&r2=703678&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableSByteTypeHandler.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/TypeHandlers/Nullables/NullableSByteTypeHandler.cs Sat Oct 11 09:07:44 2008
@@ -23,14 +23,10 @@
  ********************************************************************************/
 #endregion
 
-#region Using
 using System;
 using System.Data;
 
-using System.Collections.Generic;
-using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.Model.ResultMapping;
-#endregion
 
 namespace Apache.Ibatis.DataMapper.TypeHandlers.Nullables
 {
@@ -72,14 +68,11 @@
         {
             int index = dataReader.GetOrdinal(mapping.ColumnName);
 
-            if (dataReader.IsDBNull(index) == true)
+            if (dataReader.IsDBNull(index))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new sbyte?(Convert.ToSByte(dataReader.GetValue(index)));
-            }
+            return new sbyte?(Convert.ToSByte(dataReader.GetValue(index)));
         }
 
         /// <summary>
@@ -90,14 +83,11 @@
         /// <returns></returns>
         public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
         {
-            if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
+            if (dataReader.IsDBNull(mapping.ColumnIndex))
             {
                 return DBNull.Value;
             }
-            else
-            {
-                return new sbyte?(Convert.ToSByte(dataReader.GetValue(mapping.ColumnIndex)));
-            }
+            return new sbyte?(Convert.ToSByte(dataReader.GetValue(mapping.ColumnIndex)));
         }
 
         /// <summary>



Mime
View raw message