You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2006/10/30 20:34:06 UTC

svn commit: r469246 - in /ibatis/trunk/cs/mapper/IBatisNet.DataMapper: ChangeLog.txt Configuration/DomSqlMapBuilder.cs MappedStatements/CachingStatement.cs

Author: gbayon
Date: Mon Oct 30 11:34:05 2006
New Revision: 469246

URL: http://svn.apache.org/viewvc?view=rev&rev=469246
Log:
Fiexed IBATISNET-191 : Allows Cache for Procedure / Statement tag

Modified:
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt?view=diff&rev=469246&r1=469245&r2=469246
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ChangeLog.txt Mon Oct 30 11:34:05 2006
@@ -4,9 +4,10 @@
 1.6.0 - BETA
 ------------------------------
 Issues
- - IBATISNET-179 : Allow procedure statement without parameterMap  
- - IBATISNET-184 : Invalid support for public/protected field in result property
-
+- IBATISNET-191 : Allows Cache for Procedure / Statement tag
+- IBATISNET-179 : Allow procedure statement without parameterMap  
+- IBATISNET-184 : Invalid support for public/protected field in result property
+ 
 Improvements/Changes
 - IBATISNET-185 : Allow custom ISessionStore
 - IBATISNET-181 : Allow mapping of multiple result sets

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs?view=diff&rev=469246&r1=469245&r2=469246
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs Mon Oct 30 11:34:05 2006
@@ -1150,8 +1150,6 @@
 				_configScope.ErrorContext.MoreInfo = "loading statement tag";
 				_configScope.NodeContext = xmlNode; // A statement tag
 
-				MappedStatement mappedStatement;
-
 				statement = StatementDeSerializer.Deserialize(xmlNode, _configScope);
                 statement.CacheModelName = _configScope.ApplyNamespace(statement.CacheModelName);
                 statement.ParameterMapName = _configScope.ApplyNamespace(statement.ParameterMapName);
@@ -1168,9 +1166,14 @@
 				ProcessSqlStatement( statement  );
 
 				// Build MappedStatement
-				mappedStatement = new MappedStatement( _configScope.SqlMapper, statement);
+                MappedStatement mappedStatement = new MappedStatement(_configScope.SqlMapper, statement);
+                IMappedStatement mapStatement = mappedStatement;
+                if (statement.CacheModelName != null && statement.CacheModelName.Length > 0 && _configScope.IsCacheModelsEnabled)
+                {
+                    mapStatement = new CachingStatement(mappedStatement);
+                }
 
-				_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
+                _configScope.SqlMapper.AddMappedStatement(mapStatement.Id, mapStatement);
 			}
 			#endregion
 
@@ -1205,14 +1208,14 @@
 				}
 
 				// Build MappedStatement
-				MappedStatement mappedStatement = new SelectMappedStatement( _configScope.SqlMapper, select);
-				IMappedStatement mapStatement = mappedStatement;
+                MappedStatement mappedStatement = new SelectMappedStatement(_configScope.SqlMapper, select);
+                IMappedStatement mapStatement = mappedStatement;
 				if (select.CacheModelName != null && select.CacheModelName.Length> 0 && _configScope.IsCacheModelsEnabled)
 				{
-					mapStatement = new CachingStatement( mappedStatement);
+                    mapStatement = new CachingStatement(mappedStatement);
 				}
 
-				_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mapStatement);
+                _configScope.SqlMapper.AddMappedStatement(mapStatement.Id, mapStatement);
 			}
 			#endregion
 
@@ -1363,8 +1366,6 @@
 				_configScope.ErrorContext.MoreInfo = "loading procedure tag";
 				_configScope.NodeContext = xmlNode; // A procedure tag
 
-				MappedStatement mappedStatement;
-
 				procedure = ProcedureDeSerializer.Deserialize(xmlNode, _configScope);
                 procedure.CacheModelName = _configScope.ApplyNamespace(procedure.CacheModelName);
                 procedure.ParameterMapName = _configScope.ApplyNamespace(procedure.ParameterMapName);
@@ -1381,9 +1382,14 @@
 				ProcessSqlStatement( procedure );
 
 				// Build MappedStatement
-				mappedStatement = new MappedStatement( _configScope.SqlMapper, procedure);
+                MappedStatement mappedStatement = new MappedStatement(_configScope.SqlMapper, procedure);
+                IMappedStatement mapStatement = mappedStatement;		    
+                if (procedure.CacheModelName != null && procedure.CacheModelName.Length > 0 && _configScope.IsCacheModelsEnabled)
+                {
+                    mapStatement = new CachingStatement(mappedStatement);
+                }
 
-				_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
+                _configScope.SqlMapper.AddMappedStatement(mapStatement.Id, mapStatement);
 			}
 			#endregion
 

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
URL: http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs?view=diff&rev=469246&r1=469245&r2=469246
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs Mon Oct 30 11:34:05 2006
@@ -57,7 +57,7 @@
 		/// Constructor
 		/// </summary>
 		/// <param name="statement"></param>
-		public CachingStatement(MappedStatement statement) 
+        public CachingStatement(MappedStatement statement) 
 		{
 			_mappedStatement = statement;
 		}