Author: gbayon
Date: Sat May 31 00:21:56 2008
New Revision: 661968

URL: http://svn.apache.org/viewvc?rev=661968&view=rev
Log:
Fix IBATISNET-266

Modified:
    ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/StringTokenizer.cs
    
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/ParameterMapTest.cs
    
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Account.xml
    
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/ParameterMapping/InlineParameterMapParser.cs
    
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/Dynamic/DynamicSql.cs

Modified: 
ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/StringTokenizer.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/StringTokenizer.cs?rev=661968&r1=661967&r2=661968&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/StringTokenizer.cs 
(original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Utilities/StringTokenizer.cs 
Sat May 31 00:21:56 2008
@@ -24,23 +24,21 @@
  
********************************************************************************/
 #endregion
 
-using System;
 using System.Collections;
-using System.Text;
 
 namespace Apache.Ibatis.Common.Utilities
 {
                
        /// <summary>
        /// A StringTokenizer java like object 
+    /// Allows to break a string into tokens
        /// </summary>
-       public class StringTokenizer : IEnumerable 
+       public sealed class StringTokenizer : IEnumerable 
        {
-
-               private static readonly string _defaultDelim=" \t\n\r\f";
-               string _origin = string.Empty;
-               string _delimiters = string.Empty;
-               bool _returnDelimiters = false;
+               private static readonly string defaultDelim=" \t\n\r\f";
+        private readonly string  origin = string.Empty;
+        private readonly string delimiters = string.Empty;
+        private readonly bool returnDelimiters = false;
 
                /// <summary>
                /// Constructs a StringTokenizer on the specified String, using 
the
@@ -49,9 +47,9 @@
                /// <param name="str">The input String</param>
                public StringTokenizer(string str) 
                {
-                       _origin = str;
-                       _delimiters = _defaultDelim;
-                       _returnDelimiters = false;
+                       origin = str;
+                       delimiters = defaultDelim;
+                       returnDelimiters = false;
                }
 
 
@@ -63,9 +61,9 @@
                /// <param name="delimiters">The delimiter String</param>
                public StringTokenizer(string str, string delimiters) 
                {
-                       _origin = str;
-                       _delimiters = delimiters;
-                       _returnDelimiters = false;
+                       origin = str;
+                       this.delimiters = delimiters;
+                       returnDelimiters = false;
                }
 
 
@@ -78,16 +76,18 @@
                /// <param name="returnDelimiters">Returns delimiters as tokens 
or skip them</param>
                public StringTokenizer(string str, string delimiters, bool 
returnDelimiters) 
                {
-                       _origin = str;
-                       _delimiters = delimiters;
-                       _returnDelimiters = returnDelimiters;
+                       origin = str;
+                       this.delimiters = delimiters;
+                       this.returnDelimiters = returnDelimiters;
                }
 
 
-               /// <summary>
-               /// 
-               /// </summary>
-               /// <returns></returns>
+        /// <summary>
+        /// Returns an enumerator that iterates through a collection.
+        /// </summary>
+        /// <returns>
+        /// An <see cref="T:System.Collections.IEnumerator"/> object that can 
be used to iterate through the collection.
+        /// </returns>
                public IEnumerator GetEnumerator() 
                {
                        return new StringTokenizerEnumerator(this);
@@ -108,13 +108,13 @@
                        {
                                int count = 0;
                                int currpos = 0;
-                               int maxPosition = _origin.Length;
+                               int maxPosition = origin.Length;
 
                                while (currpos < maxPosition) 
                                {
-                                       while (!_returnDelimiters &&
+                                       while (!returnDelimiters &&
                                                (currpos < maxPosition) &&
-                                               
(_delimiters.IndexOf(_origin[currpos]) >= 0))
+                                               
(delimiters.IndexOf(origin[currpos]) >= 0))
                                        {
                                                currpos++;
                                        }
@@ -126,12 +126,12 @@
 
                                        int start = currpos;
                                        while ((currpos < maxPosition) && 
-                                               
(_delimiters.IndexOf(_origin[currpos]) < 0))
+                                               
(delimiters.IndexOf(origin[currpos]) < 0))
                                        {
                                                currpos++;
                                        }
-                                       if (_returnDelimiters && (start == 
currpos) &&
-                                               
(_delimiters.IndexOf(_origin[currpos]) >= 0))
+                                       if (returnDelimiters && (start == 
currpos) &&
+                                               
(delimiters.IndexOf(origin[currpos]) >= 0))
                                        {
                                                currpos++;
                                        }
@@ -144,33 +144,33 @@
                }
 
 
-               private class StringTokenizerEnumerator : IEnumerator 
+               private sealed class StringTokenizerEnumerator : IEnumerator 
                {
-                       private StringTokenizer _stokenizer;
-                       private int _cursor = 0;
-                       private string _next = null;
+                       private readonly StringTokenizer stokenizer;
+                       private int cursor = 0;
+                       private string next = null;
                
                        public StringTokenizerEnumerator(StringTokenizer stok) 
                        {
-                               _stokenizer = stok;
+                               stokenizer = stok;
                        }
 
                        public bool MoveNext() 
                        {
-                               _next = GetNext();
-                               return _next != null;
+                               next = GetNext();
+                               return next != null;
                        }
 
                        public void Reset() 
                        {
-                               _cursor = 0;
+                               cursor = 0;
                        }
 
                        public object Current 
                        {
                                get 
                                {
-                                       return _next;
+                                       return next;
                                }
                        }
 
@@ -179,30 +179,30 @@
                                char c;
                                bool isDelim;
                        
-                               if( _cursor >= _stokenizer._origin.Length )
+                               if( cursor >= stokenizer.origin.Length )
                                        return null;
 
-                               c = _stokenizer._origin[_cursor];
-                               isDelim = (_stokenizer._delimiters.IndexOf(c) 
!= -1);
+                               c = stokenizer.origin[cursor];
+                               isDelim = (stokenizer.delimiters.IndexOf(c) != 
-1);
                        
                                if ( isDelim ) 
                                {
-                                       _cursor++;
-                                       if ( _stokenizer._returnDelimiters ) 
+                                       cursor++;
+                                       if ( stokenizer.returnDelimiters ) 
                                        {
                                                return c.ToString();
                                        }
                                        return GetNext();
                                }
 
-                               int nextDelimPos = 
_stokenizer._origin.IndexOfAny(_stokenizer._delimiters.ToCharArray(), _cursor);
+                               int nextDelimPos = 
stokenizer.origin.IndexOfAny(stokenizer.delimiters.ToCharArray(), cursor);
                                if (nextDelimPos == -1) 
                                {
-                                       nextDelimPos = 
_stokenizer._origin.Length;
+                                       nextDelimPos = stokenizer.origin.Length;
                                }
 
-                               string nextToken = 
_stokenizer._origin.Substring(_cursor, nextDelimPos - _cursor);
-                               _cursor = nextDelimPos;
+                               string nextToken = 
stokenizer.origin.Substring(cursor, nextDelimPos - cursor);
+                               cursor = nextDelimPos;
                                return nextToken;
                        }
 

Modified: 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/ParameterMapTest.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/ParameterMapTest.cs?rev=661968&r1=661967&r2=661968&view=diff
==============================================================================
--- 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/ParameterMapTest.cs
 (original)
+++ 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Fixtures/Mapping/ParameterMapTest.cs
 Sat May 31 00:21:56 2008
@@ -6,6 +6,7 @@
 
 using Apache.Ibatis.Common.Resources;
 using Apache.Ibatis.Common.Utilities;
+using Apache.Ibatis.DataMapper.Model.ParameterMapping;
 using Apache.Ibatis.DataMapper.SqlClient.Test.Domain;
 using Apache.Ibatis.DataMapper.SqlClient.Test.Fixtures;
 using NUnit.Framework;
@@ -45,6 +46,37 @@
 
         #region Parameter map tests
 
+        [Test]
+        public void New_parameter_syntax_should_work_on_update()
+        {
+            Account account = 
dataMapper.QueryForObject<Account>("GetAccountViaColumnName", 1);
+
+            account.EmailAddress = "[EMAIL PROTECTED]";
+            dataMapper.Update("NewUpdateAccountViaInlineParameters", account);
+
+            account = 
dataMapper.QueryForObject<Account>("GetAccountViaColumnName", 1);
+
+            Assert.AreEqual("[EMAIL PROTECTED]", account.EmailAddress);
+
+            account.EmailAddress = null;
+            dataMapper.Update("NewUpdateAccountViaInlineParameters", account);
+
+            account = 
dataMapper.QueryForObject<Account>("GetAccountViaColumnName", 1);
+
+            Assert.AreEqual("[EMAIL PROTECTED]", account.EmailAddress);
+        }
+        [Test]
+        public void New_parameter_syntax_should_work_on_insert()
+        {
+            Account account = NewAccount6();
+
+            dataMapper.Insert("NewInsertAccountViaInlineParameters", account);
+
+            account = 
dataMapper.QueryForObject<Account>("GetAccountNullableEmail", 6);
+
+            AssertAccount6(account);
+        }
+
         /// <summary>
         /// Test null replacement in ParameterMap property
         /// </summary>

Modified: 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Account.xml
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Account.xml?rev=661968&r1=661967&r2=661968&view=diff
==============================================================================
--- 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Account.xml
 (original)
+++ 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper.SqlClient.Test.2005/Maps/Account.xml
 Sat May 31 00:21:56 2008
@@ -140,6 +140,36 @@
     -->
   <statements>
 
+    <!-- New parmeter syntax-->
+    <update id="NewUpdateAccountViaInlineParameters" parameterClass="Account">
+      update Accounts set
+      Account_FirstName = @{FirstName},
+      Account_LastName = @{LastName},
+      Account_Email = @{EmailAddress,type=string,dbType=Varchar,[EMAIL 
PROTECTED]
+      where
+      Account_ID = @{Id}
+    </update>
+
+    <insert id="NewInsertAccountViaInlineParameters"
+                       parameterClass="Account" >
+      insert into Accounts
+      (Account_ID, Account_FirstName, Account_LastName, Account_Email)
+      values
+      (
+      @{Id}, @{FirstName}, @{LastName}, @{EmailAddress,dbType=VarChar,[EMAIL 
PROTECTED]
+      )
+    </insert>
+
+    <insert id="NewInsertAccountNullableEmail"
+                       parameterClass="Account" >
+      insert into Accounts
+      (Account_ID, Account_FirstName, Account_LastName, Account_Email)
+      values
+      ( @{Id}, @{FirstName}, @{LastName}, @{EmailAddress,dbType=VarChar} )
+    </insert>
+    
+    <!--  -->
+    
     <select id="JIRA260" parameterClass="Integer" 
resultMap="account-extends-constructor">
       select *
       from Accounts

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=661968&r1=661967&r2=661968&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 May 31 00:21:56 2008
@@ -27,16 +27,14 @@
 
 using System;
 using System.Collections;
+using System.Collections.Generic;
 using System.Text;
 using Apache.Ibatis.Common.Exceptions;
 using Apache.Ibatis.Common.Utilities;
-using Apache.Ibatis.Common.Utilities.Objects;
+using Apache.Ibatis.DataMapper.DataExchange;
+using Apache.Ibatis.DataMapper.Exceptions;
 using Apache.Ibatis.DataMapper.Model.Sql.Dynamic;
 using Apache.Ibatis.DataMapper.Model.Statements;
-using Apache.Ibatis.DataMapper.Exceptions;
-using Apache.Ibatis.DataMapper.Scope;
-using Apache.Ibatis.DataMapper.TypeHandlers;
-using Apache.Ibatis.DataMapper.DataExchange;
 
 #endregion 
 
@@ -49,6 +47,10 @@
        {
                private const string PARAMETER_TOKEN = "#";
                private const string PARAM_DELIM = ":";
+        private const string MARK_TOKEN = "?";
+
+        private const string NEW_BEGIN_TOKEN = "@{";
+        private const string NEW_END_TOKEN = "}";
 
         /// <summary>
         /// Parse Inline ParameterMap
@@ -60,7 +62,7 @@
         public SqlText ParseInlineParameterMap(DataExchangeFactory 
dataExchangeFactory, IStatement statement, string sqlStatement)
                {
                        string newSql = sqlStatement;
-                       ArrayList mappingList = new ArrayList();
+            List<ParameterProperty> mappingList = new 
List<ParameterProperty>();
                        Type parameterClassType = null;
 
                        if (statement != null)
@@ -68,63 +70,98 @@
                                parameterClassType = statement.ParameterClass;
                        }
 
-                       StringTokenizer parser = new 
StringTokenizer(sqlStatement, PARAMETER_TOKEN, true);
-                       StringBuilder newSqlBuffer = new StringBuilder();
-
-                       string token = null;
-                       string lastToken = null;
-
-                       IEnumerator enumerator = parser.GetEnumerator();
-
-                       while (enumerator.MoveNext()) 
-                       {
-                               token = (string)enumerator.Current;
-
-                               if (PARAMETER_TOKEN.Equals(lastToken)) 
-                               {
-                                       if (PARAMETER_TOKEN.Equals(token)) 
-                                       {
-                                               
newSqlBuffer.Append(PARAMETER_TOKEN);
-                                               token = null;
-                                       } 
-                                       else 
-                                       {
-                                               ParameterProperty mapping = 
null; 
-                                               if (token.IndexOf(PARAM_DELIM) 
> -1) 
-                                               {
-                            mapping = OldParseMapping(token, 
parameterClassType, dataExchangeFactory);
-                                               } 
-                                               else 
-                                               {
-                            mapping = NewParseMapping(token, 
parameterClassType, dataExchangeFactory);
-                                               }                               
                                                                                
         
-
-                                               mappingList.Add(mapping);
-                                               newSqlBuffer.Append("? ");
-
-                                               enumerator.MoveNext();
-                                               token = 
(string)enumerator.Current;
-                                               if 
(!PARAMETER_TOKEN.Equals(token)) 
-                                               {
-                                                       throw new 
DataMapperException("Unterminated inline parameter in mapped statement (" + 
statement.Id + ").");
-                                               }
-                                               token = null;
-                                       }
-                               } 
-                               else 
-                               {
-                                       if (!PARAMETER_TOKEN.Equals(token)) 
-                                       {
-                                               newSqlBuffer.Append(token);
-                                       }
-                               }
-
-                               lastToken = token;
-                       }
-
-                       newSql = newSqlBuffer.ToString();
+            if (sqlStatement.Contains(NEW_BEGIN_TOKEN))
+            {
+                if (newSql != null)
+                {
+                    string toAnalyse = newSql;
+                    int start = toAnalyse.IndexOf(NEW_BEGIN_TOKEN);
+                    int end = toAnalyse.IndexOf(NEW_END_TOKEN);
+                    StringBuilder newSqlBuffer = new StringBuilder();
+
+                    while (start > -1 && end > start)
+                    {
+                        string prepend = toAnalyse.Substring(0, start);
+                        string append = toAnalyse.Substring(end + 
NEW_END_TOKEN.Length);
+                       
+                        //EmailAddress,type=string,dbType=Varchar,[EMAIL 
PROTECTED]
+                        string parameter = toAnalyse.Substring(start + 
NEW_BEGIN_TOKEN.Length, end - start - NEW_BEGIN_TOKEN.Length);
+                        ParameterProperty mapping = NewParseMapping(parameter, 
parameterClassType, dataExchangeFactory);
+                        mappingList.Add(mapping);
+                        newSqlBuffer.Append(prepend);
+                        newSqlBuffer.Append(MARK_TOKEN);
+                        toAnalyse = append;
+                        start = toAnalyse.IndexOf(NEW_BEGIN_TOKEN);
+                        end = toAnalyse.IndexOf(NEW_END_TOKEN);
+                    }
+                    newSqlBuffer.Append(toAnalyse);
+                    newSql = newSqlBuffer.ToString();
+                }
+            }
+            else
+            {
+                #region old syntax
+                               StringTokenizer parser = new 
StringTokenizer(sqlStatement, PARAMETER_TOKEN, true);
+                           StringBuilder newSqlBuffer = new StringBuilder();
+
+                           string token = null;
+                           string lastToken = null;
+
+                           IEnumerator enumerator = parser.GetEnumerator();
+
+                           while (enumerator.MoveNext()) 
+                           {
+                                   token = (string)enumerator.Current;
+
+                                   if (PARAMETER_TOKEN.Equals(lastToken)) 
+                                   {
+                        // Double token ## = # 
+                                           if (PARAMETER_TOKEN.Equals(token)) 
+                                           {
+                                                   
newSqlBuffer.Append(PARAMETER_TOKEN);
+                                                   token = null;
+                                           } 
+                                           else 
+                                           {
+                                                   ParameterProperty mapping = 
null; 
+                                                   if 
(token.IndexOf(PARAM_DELIM) > -1) 
+                                                   {
+                                mapping = OldParseMapping(token, 
parameterClassType, dataExchangeFactory);
+                                                   } 
+                                                   else 
+                                                   {
+                                mapping = NewParseMapping(token, 
parameterClassType, dataExchangeFactory);
+                                                   }                           
                                                                                
         
+
+                                                   mappingList.Add(mapping);
+                                                   
newSqlBuffer.Append(MARK_TOKEN+" ");
+
+                                                   enumerator.MoveNext();
+                                                   token = 
(string)enumerator.Current;
+                                                   if 
(!PARAMETER_TOKEN.Equals(token)) 
+                                                   {
+                                                           throw new 
DataMapperException("Unterminated inline parameter in mapped statement (" + 
statement.Id + ").");
+                                                   }
+                                                   token = null;
+                                           }
+                                   } 
+                                   else 
+                                   {
+                                           if (!PARAMETER_TOKEN.Equals(token)) 
+                                           {
+                                                   newSqlBuffer.Append(token);
+                                           }
+                                   }
+
+                                   lastToken = token;
+                           }
+
+                           newSql = newSqlBuffer.ToString();
+ 
+                   #endregion            
+            }
 
-                       ParameterProperty[] mappingArray = 
(ParameterProperty[]) mappingList.ToArray(typeof(ParameterProperty));
+                       ParameterProperty[] mappingArray =  
mappingList.ToArray();                
 
                        SqlText sqlText = new SqlText();
                        sqlText.Text = newSql;
@@ -133,15 +170,17 @@
                        return sqlText;
                }
 
-
-               /// <summary>
-               /// Parse inline parameter with syntax as
-               /// 
#propertyName,type=string,dbype=Varchar,direction=Input,nullValue=N/A,handler=string#
-               /// </summary>
-               /// <param name="token"></param>
-               /// <param name="parameterClassType"></param>
-               /// <param name="scope"></param>
-               /// <returns></returns>
+        /// <summary>
+        /// Parse inline parameter with syntax as
+        /// 
#propertyName,type=string,dbype=Varchar,direction=Input,nullValue=N/A,handler=string#
+        /// </summary>
+        /// <param name="token">The token.</param>
+        /// <param name="parameterClassType">Type of the parameter 
class.</param>
+        /// <param name="dataExchangeFactory">The data exchange 
factory.</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) 
                {
             string propertyName = string.Empty;
@@ -194,27 +233,6 @@
                                }
                        }
 
-            //if (mapping.CallBackName.Length >0)
-            //{
-            //    mapping.Initialize( scope, parameterClassType );
-            //}
-            //else
-            //{
-            //    ITypeHandler handler = null;
-            //    if (parameterClassType == null) 
-            //    {
-            //        handler = 
scope.DataExchangeFactory.TypeHandlerFactory.GetUnkownTypeHandler();
-            //    } 
-            //    else 
-            //    {
-            //        handler = ResolveTypeHandler( 
scope.DataExchangeFactory.TypeHandlerFactory, 
-            //            parameterClassType, mapping.PropertyName,  
-            //            mapping.CLRType, mapping.DbType );
-            //    }
-            //    mapping.TypeHandler = handler;
-            //    mapping.Initialize(  scope, parameterClassType );            
                
-            //}
-
             return new ParameterProperty(
                 propertyName,
                 string.Empty,
@@ -230,14 +248,15 @@
                 dataExchangeFactory);
                }
 
-
         /// <summary>
         /// Parse inline parameter with syntax as
-        /// #propertyName:dbType:nullValue#
         /// </summary>
         /// <param name="token">The token.</param>
         /// <param name="parameterClassType">Type of the parameter 
class.</param>
         /// <param name="dataExchangeFactory">The data exchange 
factory.</param>
+        /// <example>
+        /// #propertyName:dbType:nullValue#
+        /// </example>
         /// <returns></returns>
         private ParameterProperty OldParseMapping(string token, Type 
parameterClassType, DataExchangeFactory dataExchangeFactory) 
                {
@@ -259,18 +278,6 @@
                                        enumeratorParam.MoveNext();
                                        enumeratorParam.MoveNext(); //ignore ":"
                     dbType = ((string)enumeratorParam.Current).Trim();
-
-                    //ITypeHandler handler = null;
-                    //if (parameterClassType == null) 
-                    //{
-                    //    handler = 
scope.DataExchangeFactory.TypeHandlerFactory.GetUnkownTypeHandler();
-                    //} 
-                    //else 
-                    //{
-                    //    handler = 
ResolveTypeHandler(scope.DataExchangeFactory.TypeHandlerFactory, 
parameterClassType, propertyName, null, dBType);
-                    //}
-                    //mapping.TypeHandler = handler;
-                    //mapping.Initialize( scope, parameterClassType );
                                } 
                                else if (n1 >= 5) 
                                {
@@ -289,18 +296,6 @@
                                        {
                                                nullValue = nullValue + 
((string)enumeratorParam.Current).Trim();
                                        }
-
-                    //ITypeHandler handler = null;
-                    //if (parameterClassType == null) 
-                    //{
-                    //    handler = 
scope.DataExchangeFactory.TypeHandlerFactory.GetUnkownTypeHandler();
-                    //} 
-                    //else 
-                    //{
-                    //    handler = 
ResolveTypeHandler(scope.DataExchangeFactory.TypeHandlerFactory, 
parameterClassType, propertyName, null, dBType);
-                    //}
-                    //mapping.TypeHandler = handler;
-                    //mapping.Initialize( scope, parameterClassType );
                                } 
                                else 
                                {
@@ -310,19 +305,6 @@
                        else 
                        {
                                propertyName = token;
-                //ITypeHandler handler = null;
-                //if (parameterClassType == null) 
-                //{
-                //    handler = 
scope.DataExchangeFactory.TypeHandlerFactory.GetUnkownTypeHandler();
-                //} 
-                //else 
-                //{
-                //    handler = 
ResolveTypeHandler(scope.DataExchangeFactory.TypeHandlerFactory, 
parameterClassType, token, null, null);
-                //}
-                //mapping.TypeHandler = handler;
-                //mapping.Initialize( scope, parameterClassType );
-
-
                        }
 
             return new ParameterProperty(
@@ -340,60 +322,5 @@
                 dataExchangeFactory);
                }
 
-
-        ///// <summary>
-        ///// Resolve TypeHandler
-        ///// </summary>
-        ///// <param name="parameterClassType"></param>
-        ///// <param name="propertyName"></param>
-        ///// <param name="propertyType"></param>
-        ///// <param name="dbType"></param>
-        ///// <param name="typeHandlerFactory"></param>
-        ///// <returns></returns>
-        //private ITypeHandler ResolveTypeHandler(
-        //    TypeHandlerFactory typeHandlerFactory, 
-        //    Type classType, 
-        //    string memberName, 
-        //    string memberType, 
-        //    string dbType) 
-        //{
-        //    ITypeHandler handler = null;
-
-        //    if (classType == null) 
-        //    {
-        //        handler = typeHandlerFactory.GetUnkownTypeHandler();
-        //    } 
-        //    else if (typeof(IDictionary).IsAssignableFrom(classType))
-        //    {
-        //        if (memberType == null || memberType.Length==0) 
-        //        {
-        //            handler = typeHandlerFactory.GetUnkownTypeHandler();
-        //        } 
-        //        else 
-        //        {
-        //            try 
-        //            {
-        //                Type typeClass = TypeUtils.ResolveType(memberType);
-        //                handler = 
typeHandlerFactory.GetTypeHandler(typeClass, dbType);
-        //            } 
-        //            catch (Exception e) 
-        //            {
-        //                throw new ConfigurationException("Error. Could not 
set TypeHandler.  Cause: " + e.Message, e);
-        //            }
-        //        }
-        //    } 
-        //    else if (typeHandlerFactory.GetTypeHandler(classType, dbType) != 
null) 
-        //    {
-        //        handler = typeHandlerFactory.GetTypeHandler(classType, 
dbType);
-        //    } 
-        //    else 
-        //    {
-        //        Type typeClass = 
ObjectProbe.GetMemberTypeForGetter(classType, memberName);
-        //        handler = typeHandlerFactory.GetTypeHandler(typeClass, 
dbType);
-        //    }
-
-        //    return handler;
-        //}
-
        }
 }

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=661968&r1=661967&r2=661968&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 May 31 00:21:56 2008
@@ -41,7 +41,6 @@
 using Apache.Ibatis.DataMapper.Session;
 using Apache.Ibatis.DataMapper.Data;
 using Apache.Ibatis.Common.Contracts;
-using System;
 
 #endregion
 


Reply via email to