Author: gbayon
Date: Mon Dec 5 11:29:54 2005
New Revision: 354139
URL: http://svn.apache.org/viewcvs?rev=354139&view=rev
Log:
- Closed IBATISNET-118
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/LazyLoadList.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs?rev=354139&r1=354138&r2=354139&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/DomSqlMapBuilder.cs
Mon Dec 5 11:29:54 2005
@@ -828,7 +828,7 @@
if (_logger.IsDebugEnabled)
{
-
_logger.Debug("Registering trigger statement [" + mappedStatement.Name + "] to
cache model [" + cacheModel.Id + "]");
+
_logger.Debug("Registering trigger statement [" + mappedStatement.Id + "] to
cache model [" + cacheModel.Id + "]");
}
cacheModel.RegisterTriggerStatement(mappedStatement);
@@ -1051,7 +1051,7 @@
// Build MappedStatement
mappedStatement = new MappedStatement(
_configScope.SqlMapper, statement);
-
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Name,
mappedStatement);
+
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
}
#endregion
@@ -1093,7 +1093,7 @@
mapStatement = new CachingStatement(
mappedStatement);
}
-
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Name, mapStatement);
+
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mapStatement);
}
#endregion
@@ -1131,7 +1131,7 @@
// Build MappedStatement
mappedStatement = new InsertMappedStatement(
_configScope.SqlMapper, insert);
-
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Name,
mappedStatement);
+
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
#region statement SelectKey
// Set sql statement SelectKey
@@ -1156,7 +1156,7 @@
// Build MappedStatement
mappedStatement = new MappedStatement(
_configScope.SqlMapper, insert.SelectKey);
-
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Name,
mappedStatement);
+
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
}
#endregion
}
@@ -1197,7 +1197,7 @@
// Build MappedStatement
mappedStatement = new UpdateMappedStatement(
_configScope.SqlMapper, update);
-
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Name,
mappedStatement);
+
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
}
#endregion
@@ -1235,7 +1235,7 @@
// Build MappedStatement
mappedStatement = new DeleteMappedStatement(
_configScope.SqlMapper, delete);
-
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Name,
mappedStatement);
+
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
}
#endregion
@@ -1266,7 +1266,7 @@
// Build MappedStatement
mappedStatement = new MappedStatement(
_configScope.SqlMapper, procedure);
-
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Name,
mappedStatement);
+
_configScope.SqlMapper.AddMappedStatement(mappedStatement.Id, mappedStatement);
}
#endregion
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/LazyLoadList.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/LazyLoadList.cs?rev=354139&r1=354138&r2=354139&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/LazyLoadList.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/LazyLoadList.cs Mon Dec 5
11:29:54 2005
@@ -80,7 +80,7 @@
internal LazyLoadList(IMappedStatement mappedSatement, object
param, object target,string propertyName)
{
_param = param;
- _statementName = mappedSatement.Name;
+ _statementName = mappedSatement.Id;
_sqlMap = mappedSatement.SqlMap;
_target = target;
_propertyName = propertyName;
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs?rev=354139&r1=354138&r2=354139&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
Mon Dec 5 11:29:54 2005
@@ -91,9 +91,9 @@
/// Name used to identify the MappedStatement amongst the
others.
/// This the name of the SQL statment by default.
/// </summary>
- public string Name
+ public string Id
{
- get { return _mappedStatement.Name; }
+ get { return _mappedStatement.Id; }
}
/// <summary>
@@ -135,28 +135,6 @@
cacheKey.Update(keyProperty);
cacheKey.Update(valueProperty);
-// CacheKey key = null;
-// if (this.Statement.ParameterMap != null)
-// {
-// key = new
CacheKey(this.SqlMap.TypeHandlerFactory, this.Name,
-// request.PreparedStatement.PreparedSql,
-// parameterObject,
-//
request.ParameterMap.GetPropertyNameArray(),
-// MappedStatement.NO_SKIPPED_RESULTS,
-// MappedStatement.NO_MAXIMUM_RESULTS,
-// CacheKeyType.Map);
-// }
-// else
-// {
-// key = new
CacheKey(this.SqlMap.TypeHandlerFactory, this.Name,
-// request.PreparedStatement.PreparedSql,
-// parameterObject,
-// new string[0],
-// MappedStatement.NO_SKIPPED_RESULTS,
-// MappedStatement.NO_MAXIMUM_RESULTS,
-// CacheKeyType.Map);
-// }
-
map = this.Statement.CacheModel[cacheKey] as
IDictionary;
if (map == null)
{
@@ -329,16 +307,14 @@
Cache.CacheKey cacheKey = new Cache.CacheKey();
for (int i = 0; i <
request.IDbCommand.Parameters.Count; i++)
{
- if (request.IDbCommand.Parameters[i] != null)
+ IDataParameter dataParameter =
(IDataParameter)request.IDbCommand.Parameters[i];
+ if (dataParameter.Value != null)
{
- cacheKey.Update(
((IDataParameter)request.IDbCommand.Parameters[i]).Value );
+ cacheKey.Update( dataParameter.Value );
}
}
- // cf BaseStatement public CacheKey getCacheKey(
- // cf SqMapExecutor public int hashCode()
-
- cacheKey.Update(_mappedStatement.Name);
+ cacheKey.Update(_mappedStatement.Id);
cacheKey.Update(_mappedStatement.SqlMap.DataSource.ConnectionString);
cacheKey.Update(request.IDbCommand.CommandText);
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs?rev=354139&r1=354138&r2=354139&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs
Mon Dec 5 11:29:54 2005
@@ -69,7 +69,7 @@
/// Name used to identify the MappedStatement amongst the
others.
/// This the name of the SQL statment by default.
/// </summary>
- string Name
+ string Id
{
get;
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs?rev=354139&r1=354138&r2=354139&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
Mon Dec 5 11:29:54 2005
@@ -169,7 +169,7 @@
/// Name used to identify the MappedStatement amongst the
others.
/// This the name of the SQL statement by default.
/// </summary>
- public string Name
+ public string Id
{
get { return _statement.Id; }
}
@@ -1121,7 +1121,7 @@
public override string ToString()
{
StringBuilder buffer = new StringBuilder();
- buffer.Append("\tMappedStatement: " + this.Name);
+ buffer.Append("\tMappedStatement: " + this.Id);
buffer.Append(Environment.NewLine);
if (_statement.ParameterMap != null)
buffer.Append(_statement.ParameterMap.Id);
if (_statement.ResultMap != null)
buffer.Append(_statement.ResultMap.Id);
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs?rev=354139&r1=354138&r2=354139&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/SqlMapper.cs Mon Dec 5
11:29:54 2005
@@ -1198,7 +1198,7 @@
{
if (_mappedStatements.Contains(key) == true)
{
- throw new DataMapperException("This SQL map
already contains a MappedStatement named " + mappedStatement.Name);
+ throw new DataMapperException("This SQL map
already contains a MappedStatement named " + mappedStatement.Id);
}
_mappedStatements.Add(key, mappedStatement);
}
@@ -1356,7 +1356,7 @@
{
IMappedStatement mappedStatement =
(IMappedStatement)enumerator.Value;
- buffer.Append(mappedStatement.Name);
+ buffer.Append(mappedStatement.Id);
buffer.Append(": ");
if (mappedStatement is CachingStatement)