Author: gbayon
Date: Sun Sep 21 07:43:08 2008
New Revision: 697525

URL: http://svn.apache.org/viewvc?rev=697525&view=rev
Log:
cleaning code

Modified:
    ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Data/DbProvider.cs
    
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DefaultPreparedCommand.cs
    
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/External/ExternalSql.cs

Modified: ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Data/DbProvider.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Data/DbProvider.cs?rev=697525&r1=697524&r2=697525&view=diff
==============================================================================
--- ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Data/DbProvider.cs (original)
+++ ibatis/trunk/cs/V3/src/Apache.Ibatis.Common/Data/DbProvider.cs Sun Sep 21 
07:43:08 2008
@@ -451,15 +451,6 @@
                }
                #endregion
 
-               #region Constructor (s) / Destructor
-               /// <summary>
-               /// Do not use direclty, only for serialization.
-               /// </summary>
-               public DbProvider()
-               {
-               }
-               #endregion
-
                #region Methods
                /// <summary>
                /// Init the provider.
@@ -512,7 +503,7 @@
                /// <returns>An 'IDbConnection' object.</returns>
                public virtual IDbConnection CreateConnection()
                {
-                       // Cannot do that because on 
+                   // Cannot do that because on 
                        // IDbCommand.Connection = cmdConnection
                        // .NET cast the cmdConnection to the real type (as 
SqlConnection)
                        // and we pass a proxy --> exception invalid cast !
@@ -524,14 +515,11 @@
                        {
                                return (IDbConnection) 
((ICloneable)_templateConnection).Clone();
                        }
-                       else
-                       {
-                               return (IDbConnection) 
Activator.CreateInstance(_templateConnection.GetType());
-                       }
+                   return (IDbConnection) 
Activator.CreateInstance(_templateConnection.GetType());
                }
 
-               
-               /// <summary>
+
+        /// <summary>
                /// Create a command object for this provider.
                /// </summary>
                /// <returns>An 'IDbCommand' object.</returns>
@@ -546,18 +534,15 @@
                /// <returns>An 'IDbDataAdapter' object.</returns>
                public virtual IDbDataAdapter CreateDataAdapter()
                {
-                       if (_templateDataAdapterIsICloneable)
+                   if (_templateDataAdapterIsICloneable)
                        {
                                return (IDbDataAdapter) 
((ICloneable)_templateDataAdapter).Clone();
                        }
-                       else
-                       {
-                               return (IDbDataAdapter) 
Activator.CreateInstance(_templateDataAdapter.GetType());
-                       }
+                   return (IDbDataAdapter) 
Activator.CreateInstance(_templateDataAdapter.GetType());
                }
 
 
-               /// <summary>
+        /// <summary>
                /// Create a IDbDataParameter object for this provider.
                /// </summary>
                /// <returns>An 'IDbDataParameter' object.</returns>

Modified: 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DefaultPreparedCommand.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DefaultPreparedCommand.cs?rev=697525&r1=697524&r2=697525&view=diff
==============================================================================
--- 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DefaultPreparedCommand.cs 
(original)
+++ 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Data/DefaultPreparedCommand.cs 
Sun Sep 21 07:43:08 2008
@@ -24,14 +24,12 @@
  
********************************************************************************/
 #endregion
 
-#region Using
 
 using System;
 using System.Collections.Specialized;
 using System.Data;
 using System.Reflection;
 using System.Text;
-using Apache.Ibatis.Common;
 using Apache.Ibatis.Common.Logging;
 using Apache.Ibatis.Common.Utilities.Objects;
 using Apache.Ibatis.DataMapper.Model.ParameterMapping;
@@ -41,8 +39,6 @@
 using Apache.Ibatis.DataMapper.Session;
 using Apache.Ibatis.Common.Data;
 
-#endregion
-
 namespace Apache.Ibatis.DataMapper.Data
 {
        /// <summary>
@@ -163,15 +159,13 @@
                                        {
                                                throw new 
DataMapperException("A procedure statement tag must alway have a parameterMap 
attribute, which is not the case for the procedure '"+statement.Id+"'."); 
                                        }
-                                       else // Parameters via ParameterMap
+                                       // Parameters via ParameterMap
+                                       if (property.DirectionAttribute.Length 
== 0)
                                        {
-                                               if 
(property.DirectionAttribute.Length == 0)
-                                               {
-                                                       property.Direction = 
sqlParameter.Direction;
-                                               }
-
-                                               sqlParameter.Direction = 
property.Direction;                                    
+                                               property.Direction = 
sqlParameter.Direction;
                                        }
+
+                                       sqlParameter.Direction = 
property.Direction;                                    
                                        #endregion 
                                }
 
@@ -197,18 +191,9 @@
                                                
ObjectProbe.SetMemberValue(parameterCopy, dbTypePropertyName, propertyValue, 
                                                        
request.DataExchangeFactory.ObjectFactory, 
request.DataExchangeFactory.AccessorFactory);
                                        }
-                                       else
-                                       {
-                                               //parameterCopy.DbType = 
sqlParameter.DbType;
-                                       }
-                               }
-                               else
-                               {
-                                       //parameterCopy.DbType = 
sqlParameter.DbType;
                                }
 
-
-                               #region Logging
+                           #region Logging
                                if (logger.IsDebugEnabled)
                                {
                                        if (parameterCopy.Value == 
DBNull.Value) 

Modified: 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/External/ExternalSql.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/External/ExternalSql.cs?rev=697525&r1=697524&r2=697525&view=diff
==============================================================================
--- 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/External/ExternalSql.cs
 (original)
+++ 
ibatis/trunk/cs/V3/src/Apache.Ibatis.DataMapper/Model/Sql/External/ExternalSql.cs
 Sun Sep 21 07:43:08 2008
@@ -97,7 +97,10 @@
             string sqlCommandText = 
statement.SqlSource.GetSql(mappedStatement, parameterObject);
             string newSqlCommandText = string.Empty;
 
-            request.ParameterMap = 
inlineParemeterMapBuilder.BuildInlineParemeterMap(statement, sqlCommandText, 
out newSqlCommandText);
+            if (request.ParameterMap==null)
+            {               
+                request.ParameterMap = 
inlineParemeterMapBuilder.BuildInlineParemeterMap(statement, sqlCommandText, 
out newSqlCommandText);
+            }
 
             // Processes $substitutions$ after DynamicSql
             if (SimpleDynamicSql.IsSimpleDynamicSql(newSqlCommandText))


Reply via email to