Added:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMapCollection.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMapCollection.cs?view=auto&rev=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMapCollection.cs
(added)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMapCollection.cs
Mon Oct 30 11:09:11 2006
@@ -0,0 +1,263 @@
+#region Apache Notice
+/*****************************************************************************
+ * $Revision: 450157 $
+ * $LastChangedDate$
+ * $LastChangedBy$
+ *
+ * iBATIS.NET Data Mapper
+ * Copyright (C) 2006/2005 - The Apache Software Foundation
+ *
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+
********************************************************************************/
+#endregion
+
+#region Using
+
+using System;
+
+#endregion
+
+namespace IBatisNet.DataMapper.Configuration.ResultMapping
+{
+ /// <summary>
+ /// Collection of <see cref="IResultMap"/>
+ /// </summary>
+ public class ResultMapCollection
+ {
+ private const int DEFAULT_CAPACITY = 2;
+ private const int CAPACITY_MULTIPLIER = 2;
+ private int _count = 0;
+ private IResultMap[] _innerList = null;
+
+
+ /// <summary>
+ /// Read-only property describing how many elements are in the
Collection.
+ /// </summary>
+ public int Count
+ {
+ get { return _count; }
+ }
+
+
+ /// <summary>
+ /// Constructs a ResultMapCollection. The list is initially empty and
has a capacity
+ /// of zero. Upon adding the first element to the list the capacity is
+ /// increased to 8, and then increased in multiples of two as required.
+ /// </summary>
+ public ResultMapCollection()
+ {
+ this.Clear();
+ }
+
+ /// <summary>
+ /// Removes all items from the collection.
+ /// </summary>
+ public void Clear()
+ {
+ _innerList = new IResultMap[DEFAULT_CAPACITY];
+ _count = 0;
+ }
+
+ /// <summary>
+ /// Constructs a ResultMapCollection with a given initial capacity.
+ /// The list is initially empty, but will have room for the given
number of elements
+ /// before any reallocations are required.
+ /// </summary>
+ /// <param name="capacity">The initial capacity of the list</param>
+ public ResultMapCollection(int capacity)
+ {
+ if (capacity < 0)
+ {
+ throw new ArgumentOutOfRangeException("Capacity", "The size of
the list must be >0.");
+ }
+ _innerList = new IResultMap[capacity];
+ }
+
+ /// <summary>
+ /// Length of the collection
+ /// </summary>
+ public int Length
+ {
+ get { return _innerList.Length; }
+ }
+
+
+ /// <summary>
+ /// Sets or Gets the ResultMap at the given index.
+ /// </summary>
+ public IResultMap this[int index]
+ {
+ get
+ {
+ if (index < 0 || index >= _count)
+ {
+ throw new ArgumentOutOfRangeException("index");
+ }
+ return _innerList[index];
+ }
+ set
+ {
+ if (index < 0 || index >= _count)
+ {
+ throw new ArgumentOutOfRangeException("index");
+ }
+ _innerList[index] = value;
+ }
+ }
+
+
+ /// <summary>
+ /// Add an ResultMap
+ /// </summary>
+ /// <param name="value"></param>
+ /// <returns>Index</returns>
+ public int Add(IResultMap value)
+ {
+ Resize(_count + 1);
+ int index = _count++;
+ _innerList[index] = value;
+
+ return index;
+ }
+
+
+ /// <summary>
+ /// Add a list of ResultMap to the collection
+ /// </summary>
+ /// <param name="value"></param>
+ public void AddRange(IResultMap[] value)
+ {
+ for (int i = 0; i < value.Length; i++)
+ {
+ Add(value[i]);
+ }
+ }
+
+
+ /// <summary>
+ /// Add a list of ResultMap to the collection
+ /// </summary>
+ /// <param name="value"></param>
+ public void AddRange(ResultMapCollection value)
+ {
+ for (int i = 0; i < value.Count; i++)
+ {
+ Add(value[i]);
+ }
+ }
+
+
+ /// <summary>
+ /// Indicate if a ResultMap is in the collection
+ /// </summary>
+ /// <param name="value">A ResultMap</param>
+ /// <returns>True fi is in</returns>
+ public bool Contains(IResultMap value)
+ {
+ for (int i = 0; i < _count; i++)
+ {
+ if (_innerList[i].Id == value.Id)
+ {
+ return true;
+ }
+ }
+ return false;
+ }
+
+
+ /// <summary>
+ /// Insert a ResultMap in the collection.
+ /// </summary>
+ /// <param name="index">Index where to insert.</param>
+ /// <param name="value">A ResultMap</param>
+ public void Insert(int index, IResultMap value)
+ {
+ if (index < 0 || index > _count)
+ {
+ throw new ArgumentOutOfRangeException("index");
+ }
+
+ Resize(_count + 1);
+ Array.Copy(_innerList, index, _innerList, index + 1, _count -
index);
+ _innerList[index] = value;
+ _count++;
+ }
+
+
+ /// <summary>
+ /// Remove a ResultMap of the collection.
+ /// </summary>
+ public void Remove(IResultMap value)
+ {
+ for (int i = 0; i < _count; i++)
+ {
+ if (_innerList[i].Id == value.Id)
+ {
+ RemoveAt(i);
+ return;
+ }
+ }
+
+ }
+
+ /// <summary>
+ /// Removes a ResultMap at the given index. The size of the list is
+ /// decreased by one.
+ /// </summary>
+ /// <param name="index"></param>
+ public void RemoveAt(int index)
+ {
+ if (index < 0 || index >= _count)
+ {
+ throw new ArgumentOutOfRangeException("index");
+ }
+
+ int remaining = _count - index - 1;
+
+ if (remaining > 0)
+ {
+ Array.Copy(_innerList, index + 1, _innerList, index,
remaining);
+ }
+
+ _count--;
+ _innerList[_count] = null;
+ }
+
+ /// <summary>
+ /// Ensures that the capacity of this collection is at least the given
minimum
+ /// value. If the currect capacity of the list is less than min, the
+ /// capacity is increased to twice the current capacity.
+ /// </summary>
+ /// <param name="minSize"></param>
+ private void Resize(int minSize)
+ {
+ int oldSize = _innerList.Length;
+
+ if (minSize > oldSize)
+ {
+ IResultMap[] oldEntries = _innerList;
+ int newSize = oldEntries.Length * CAPACITY_MULTIPLIER;
+
+ if (newSize < minSize)
+ {
+ newSize = minSize;
+ }
+ _innerList = new IResultMap[newSize];
+ Array.Copy(oldEntries, 0, _innerList, 0, _count);
+ }
+ }
+ }
+}
+
Propchange:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMapCollection.cs
------------------------------------------------------------------------------
svn:eol-style = native
Propchange:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMapCollection.cs
------------------------------------------------------------------------------
svn:keywords = Id LastChangedDate LastChangedBy
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
Mon Oct 30 11:09:11 2006
@@ -77,7 +77,7 @@
[NonSerialized]
private string _nestedResultMapName = string.Empty;
[NonSerialized]
- private ResultMap _nestedResultMap = null;
+ private IResultMap _nestedResultMap = null;
[NonSerialized]
private string _dbType = null;
[NonSerialized]
@@ -281,7 +281,7 @@
/// A nested ResultMap use to set a property
/// </summary>
[XmlIgnore]
- public ResultMap NestedResultMap
+ public IResultMap NestedResultMap
{
get { return _nestedResultMap; }
set { _nestedResultMap = value; }
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultPropertyCollection.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultPropertyCollection.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultPropertyCollection.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultPropertyCollection.cs
Mon Oct 30 11:09:11 2006
@@ -39,7 +39,7 @@
/// <summary>
- /// ead-only property describing how many elements are in the
Collection.
+ /// Read-only property describing how many elements are in the
Collection.
/// </summary>
public int Count
{
@@ -54,10 +54,18 @@
/// </summary>
public ResultPropertyCollection()
{
- _innerList = new ResultProperty[DEFAULT_CAPACITY];
- _count = 0;
+ this.Clear();
}
+ /// <summary>
+ /// Removes all items from the collection.
+ /// </summary>
+ public void Clear()
+ {
+ _innerList = new ResultProperty[DEFAULT_CAPACITY];
+ _count = 0;
+ }
+
/// <summary>
/// Constructs a ResultPropertyCollection with a given initial
capacity.
/// The list is initially empty, but will have room for the
given number of elements
@@ -140,7 +148,7 @@
/// <param name="value"></param>
public void AddRange(ResultPropertyCollection value)
{
- for (int i = 0; i < value.Length; i++)
+ for (int i = 0; i < value.Count; i++)
{
Add(value[i]);
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/SubMap.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/SubMap.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/SubMap.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/SubMap.cs
Mon Oct 30 11:09:11 2006
@@ -2,7 +2,7 @@
#region Apache Notice
/*****************************************************************************
* $Header: $
- * $Revision: $
+ * $Revision$
* $Date$
* Author : Gilles Bayon
* iBATIS.NET Data Mapper
@@ -63,7 +63,7 @@
[NonSerialized]
private string _resultMapName = string.Empty;
[NonSerialized]
- private ResultMap _resultMap = null;
+ private IResultMap _resultMap = null;
#endregion
#region Properties
@@ -92,7 +92,7 @@
/// The resultMap used if the column value is = to the
Discriminator Value
/// </summary>
[XmlIgnore]
- public ResultMap ResultMap
+ public IResultMap ResultMap
{
get { return _resultMap; }
set { _resultMap = value; }
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/DeleteDeSerializer.cs
Mon Oct 30 11:09:11 2006
@@ -59,7 +59,7 @@
delete.ParameterMapName =
NodeUtils.GetStringAttribute(prop, "parameterMap");
delete.ResultClassName =
NodeUtils.GetStringAttribute(prop, "resultClass");
delete.ResultMapName =
NodeUtils.GetStringAttribute(prop, "resultMap");
- delete.RemapResults =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
+ delete.AllowRemapping =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
int count = node.ChildNodes.Count;
for(int i=0;i<count;i++)
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/InsertDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/InsertDeSerializer.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/InsertDeSerializer.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/InsertDeSerializer.cs
Mon Oct 30 11:09:11 2006
@@ -58,7 +58,7 @@
insert.ParameterMapName =
NodeUtils.GetStringAttribute(prop, "parameterMap");
insert.ResultClassName =
NodeUtils.GetStringAttribute(prop, "resultClass");
insert.ResultMapName =
NodeUtils.GetStringAttribute(prop, "resultMap");
- insert.RemapResults =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
+ insert.AllowRemapping =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
int count = node.ChildNodes.Count;
for(int i=0;i<count;i++)
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/ResultMapDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/ResultMapDeSerializer.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/ResultMapDeSerializer.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/ResultMapDeSerializer.cs
Mon Oct 30 11:09:11 2006
@@ -25,7 +25,6 @@
#region Using
-using System;
using System.Collections.Specialized;
using System.Xml;
using IBatisNet.Common.Xml;
@@ -48,14 +47,8 @@
/// <returns></returns>
public static ResultMap Deserialize(XmlNode node,
ConfigurationScope configScope)
{
- ResultMap resultMap = new ResultMap(
configScope.DataExchangeFactory );
-
NameValueCollection prop =
NodeUtils.ParseAttributes(node, configScope.Properties);
- resultMap.ClassName = prop["class"];
- resultMap.ExtendMap = prop["extends"];
- resultMap.Id = prop["id"];
-
- resultMap.SqlMapNameSpace = configScope.SqlMapNamespace;
+ ResultMap resultMap = new ResultMap(configScope, prop["id"],
prop["class"], prop["extends"]);
configScope.ErrorContext.MoreInfo = "initialize
ResultMap";
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/SelectDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/SelectDeSerializer.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/SelectDeSerializer.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/SelectDeSerializer.cs
Mon Oct 30 11:09:11 2006
@@ -59,7 +59,7 @@
select.ParameterMapName =
NodeUtils.GetStringAttribute(prop, "parameterMap");
select.ResultClassName =
NodeUtils.GetStringAttribute(prop, "resultClass");
select.ResultMapName =
NodeUtils.GetStringAttribute(prop, "resultMap");
- select.RemapResults =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
+ select.AllowRemapping =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
int count = node.ChildNodes.Count;
for(int i=0;i<count;i++)
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/StatementDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/StatementDeSerializer.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/StatementDeSerializer.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/StatementDeSerializer.cs
Mon Oct 30 11:09:11 2006
@@ -59,7 +59,7 @@
statement.ParameterMapName =
NodeUtils.GetStringAttribute(prop, "parameterMap");
statement.ResultClassName =
NodeUtils.GetStringAttribute(prop, "resultClass");
statement.ResultMapName =
NodeUtils.GetStringAttribute(prop, "resultMap");
- statement.RemapResults =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
+ statement.AllowRemapping =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
return statement;
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Serializers/UpdateDeSerializer.cs
Mon Oct 30 11:09:11 2006
@@ -57,7 +57,7 @@
update.Id = NodeUtils.GetStringAttribute(prop, "id");
update.ParameterClassName =
NodeUtils.GetStringAttribute(prop, "parameterClass");
update.ParameterMapName =
NodeUtils.GetStringAttribute(prop, "parameterMap");
- update.RemapResults =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
+ update.AllowRemapping =
NodeUtils.GetBooleanAttribute(prop, "remapResults", false);
int count = node.ChildNodes.Count;
for(int i=0;i<count;i++)
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/IStatement.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/IStatement.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/IStatement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/IStatement.cs
Mon Oct 30 11:09:11 2006
@@ -24,12 +24,14 @@
********************************************************************************/
#endregion
-#region Imports
+#region Using
+
using System;
using System.Collections;
#if dotnet2
using System.Collections.Generic;
#endif
+
using System.Data;
using IBatisNet.DataMapper.Configuration.ResultMapping;
@@ -40,131 +42,126 @@
namespace IBatisNet.DataMapper.Configuration.Statements
{
- /// <summary>
- /// Summary description for ISql.
- /// </summary>
- public interface IStatement
- {
-
- #region Properties
-
- /// <summary>
- /// Allow remapping of dynamic SQL
- /// </summary>
- bool RemapResults
- {
- get;
- set;
- }
-
- /// <summary>
- /// Identifier used to identify the statement amongst the
others.
- /// </summary>
- string Id
- {
- get;
- set;
- }
-
- /// <summary>
- /// The type of the statement (text or procedure).
- /// </summary>
- CommandType CommandType
- {
- get;
- }
-
- /// <summary>
- /// Extend statement attribute
- /// </summary>
- string ExtendStatement
- {
- get;
- set;
- }
-
- /// <summary>
- /// The sql statement to execute.
- /// </summary>
- ISql Sql
- {
- get;
- set;
- }
-
- /// <summary>
- /// The ResultMap used by the statement.
- /// </summary>
- ResultMap ResultMap
- {
- get;
- }
-
-
- /// <summary>
- /// The parameterMap used by the statement.
- /// </summary>
- ParameterMap ParameterMap
- {
- get;
- set;
- }
-
- /// <summary>
- /// The CacheModel used by this statement.
- /// </summary>
- CacheModel CacheModel
- {
- get;
- set;
- }
-
- /// <summary>
- /// The CacheModel name to use.
- /// </summary>
- string CacheModelName
- {
- get;
- set;
- }
-
- /// <summary>
- /// The list class type to use for strongly typed collection.
- /// </summary>
- Type ListClass
- {
- get;
- }
-
- /// <summary>
- /// The result class type to used.
- /// </summary>
- Type ResultClass
- {
- get;
- }
-
- /// <summary>
- /// The parameter class type to used.
- /// </summary>
- Type ParameterClass
- {
- get;
- }
- #endregion
-
- #region Methods
- /// <summary>
- /// Create an instance of result class.
- /// </summary>
- /// <returns>An object.</returns>
- object CreateInstanceOfResultClass();
-
- /// <summary>
- /// Create an instance of 'IList' class.
- /// </summary>
- /// <returns>An object which implement IList.</returns>
- IList CreateInstanceOfListClass();
+ /// <summary>
+ /// Summary description for ISql.
+ /// </summary>
+ public interface IStatement
+ {
+
+ #region Properties
+
+ /// <summary>
+ /// Allow remapping of dynamic SQL
+ /// </summary>
+ bool AllowRemapping
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// Identifier used to identify the statement amongst the others.
+ /// </summary>
+ string Id
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// The type of the statement (text or procedure).
+ /// </summary>
+ CommandType CommandType
+ {
+ get;
+ }
+
+ /// <summary>
+ /// Extend statement attribute
+ /// </summary>
+ string ExtendStatement
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// The sql statement to execute.
+ /// </summary>
+ ISql Sql
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// The ResultMaps used by the statement.
+ /// </summary>
+ ResultMapCollection ResultsMap
+ {
+ get;
+ }
+
+
+ /// <summary>
+ /// The parameterMap used by the statement.
+ /// </summary>
+ ParameterMap ParameterMap
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// The CacheModel used by this statement.
+ /// </summary>
+ CacheModel CacheModel
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// The CacheModel name to use.
+ /// </summary>
+ string CacheModelName
+ {
+ get;
+ set;
+ }
+
+ /// <summary>
+ /// The list class type to use for strongly typed collection.
+ /// </summary>
+ Type ListClass
+ {
+ get;
+ }
+
+ /// <summary>
+ /// The result class type to used.
+ /// </summary>
+ Type ResultClass
+ {
+ get;
+ }
+
+ /// <summary>
+ /// The parameter class type to used.
+ /// </summary>
+ Type ParameterClass
+ {
+ get;
+ }
+ #endregion
+
+ #region Methods
+
+ /// <summary>
+ /// Create an instance of 'IList' class.
+ /// </summary>
+ /// <returns>An object which implement IList.</returns>
+ IList CreateInstanceOfListClass();
#if dotnet2
/// <summary>
/// Create an instance of a generic 'IList' class.
@@ -172,7 +169,7 @@
/// <returns>An object which implement IList.</returns>
IList<T> CreateInstanceOfGenericListClass<T>();
#endif
- #endregion
+ #endregion
- }
+ }
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/Statement.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/Statement.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/Statement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/Statements/Statement.cs
Mon Oct 30 11:09:11 2006
@@ -33,374 +33,326 @@
#endif
using System.Data;
using System.Xml.Serialization;
-using IBatisNet.Common.Utilities.TypesResolver;
using IBatisNet.Common.Utilities.Objects;
using IBatisNet.DataMapper.Configuration.Cache;
using IBatisNet.DataMapper.Configuration.ParameterMapping;
using IBatisNet.DataMapper.Configuration.ResultMapping;
using IBatisNet.DataMapper.Configuration.Sql;
+using IBatisNet.DataMapper.DataExchange;
using IBatisNet.DataMapper.Exceptions;
using IBatisNet.DataMapper.Scope;
-using IBatisNet.Common.Utilities;
#endregion
namespace IBatisNet.DataMapper.Configuration.Statements
{
- /// <summary>
- /// Summary description for Statement.
- /// </summary>
- [Serializable]
- [XmlRoot("statement", Namespace="http://ibatis.apache.org/mapping")]
- public class Statement : IStatement
- {
-
- #region Fields
-
- [NonSerialized]
- private bool _remapResults = false;
- [NonSerialized]
- private string _id = string.Empty;
- // ResultMap
- [NonSerialized]
- private string _resultMapName = string.Empty;
- [NonSerialized]
- private ResultMap _resultMap = null;
- // ParameterMap
- [NonSerialized]
- private string _parameterMapName = string.Empty;
- [NonSerialized]
- private ParameterMap _parameterMap = null;
- // Result Class
- [NonSerialized]
- private string _resultClassName = string.Empty;
- [NonSerialized]
- private Type _resultClass = null;
- // Parameter Class
- [NonSerialized]
- private string _parameterClassName = string.Empty;
- [NonSerialized]
- private Type _parameterClass = null;
- // List Class
- [NonSerialized]
- private string _listClassName = string.Empty;
- [NonSerialized]
- private Type _listClass = null;
- // CacheModel
- [NonSerialized]
- private string _cacheModelName = string.Empty;
- [NonSerialized]
- private CacheModel _cacheModel = null;
- [NonSerialized]
- private ISql _sql = null;
- [NonSerialized]
- private string _extendStatement = string.Empty;
+ /// <summary>
+ /// Summary description for Statement.
+ /// </summary>
+ [Serializable]
+ [XmlRoot("statement", Namespace = "http://ibatis.apache.org/mapping")]
+ public class Statement : IStatement
+ {
+
+ #region Fields
+
+ [NonSerialized]
+ private bool _allowRemapping = false;
+ [NonSerialized]
+ private string _id = string.Empty;
+ // ResultMap
+ [NonSerialized]
+ private string _resultMapName = string.Empty;
+ [NonSerialized]
+ private ResultMapCollection _resultsMap = new ResultMapCollection();
+ // ParameterMap
+ [NonSerialized]
+ private string _parameterMapName = string.Empty;
+ [NonSerialized]
+ private ParameterMap _parameterMap = null;
+ // Result Class
+ [NonSerialized]
+ private string _resultClassName = string.Empty;
+ [NonSerialized]
+ private Type _resultClass = null;
+ // Parameter Class
+ [NonSerialized]
+ private string _parameterClassName = string.Empty;
+ [NonSerialized]
+ private Type _parameterClass = null;
+ // List Class
+ [NonSerialized]
+ private string _listClassName = string.Empty;
+ [NonSerialized]
+ private Type _listClass = null;
+ // CacheModel
+ [NonSerialized]
+ private string _cacheModelName = string.Empty;
+ [NonSerialized]
+ private CacheModel _cacheModel = null;
+ [NonSerialized]
+ private ISql _sql = null;
+ [NonSerialized]
+ private string _extendStatement = string.Empty;
[NonSerialized]
- private IFactory _resultClassFactory = null;
- [NonSerialized]
private IFactory _listClassFactory = null;
- #endregion
+ #endregion
- #region Properties
+ #region Properties
- /// <summary>
- /// Allow remapping of dynamic SQL
- /// </summary>
- [XmlAttribute("remapResults")]
- public bool RemapResults
- {
- get { return _remapResults; }
- set { _remapResults = value; }
- }
-
- /// <summary>
- /// Extend statement attribute
- /// </summary>
- [XmlAttribute("extends")]
- public virtual string ExtendStatement
- {
- get { return _extendStatement; }
- set { _extendStatement = value; }
- }
-
- /// <summary>
- /// The CacheModel name to use.
- /// </summary>
- [XmlAttribute("cacheModel")]
- public string CacheModelName
- {
- get { return _cacheModelName; }
- set { _cacheModelName = value; }
- }
-
- /// <summary>
- /// Tell us if a cacheModel is attached to this statement.
- /// </summary>
- [XmlIgnore]
- public bool HasCacheModel
- {
- get{ return _cacheModelName.Length >0;}
- }
-
- /// <summary>
- /// The CacheModel used by this statement.
- /// </summary>
- [XmlIgnore]
- public CacheModel CacheModel
- {
- get { return _cacheModel; }
- set { _cacheModel = value; }
- }
-
- /// <summary>
- /// The list class name to use for strongly typed collection.
- /// </summary>
- [XmlAttribute("listClass")]
- public string ListClassName
- {
- get { return _listClassName; }
- set { _listClassName = value; }
- }
-
-
- /// <summary>
- /// The list class type to use for strongly typed collection.
- /// </summary>
- [XmlIgnore]
- public Type ListClass
- {
- get { return _listClass; }
- }
-
- /// <summary>
- /// The result class name to used.
- /// </summary>
- [XmlAttribute("resultClass")]
- public string ResultClassName
- {
- get { return _resultClassName; }
- set { _resultClassName = value; }
- }
-
- /// <summary>
- /// The result class type to used.
- /// </summary>
- [XmlIgnore]
- public Type ResultClass
- {
- get { return _resultClass; }
- }
-
- /// <summary>
- /// The parameter class name to used.
- /// </summary>
- [XmlAttribute("parameterClass")]
- public string ParameterClassName
- {
- get { return _parameterClassName; }
- set { _parameterClassName = value; }
- }
-
- /// <summary>
- /// The parameter class type to used.
- /// </summary>
- [XmlIgnore]
- public Type ParameterClass
- {
- get { return _parameterClass; }
- }
-
- /// <summary>
- /// Name used to identify the statement amongst the others.
- /// </summary>
- [XmlAttribute("id")]
- public string Id
- {
- get { return _id; }
- set
- {
- if ((value == null) || (value.Length < 1))
- throw new DataMapperException("The id
attribute is required in a statement tag.");
-
- _id= value;
- }
- }
-
-
- /// <summary>
- /// The sql statement
- /// </summary>
- [XmlIgnore]
- public ISql Sql
- {
- get { return _sql; }
- set
- {
- if (value == null)
- throw new DataMapperException("The sql
statement query text is required in the statement tag "+_id);
-
- _sql = value;
- }
- }
-
-
- /// <summary>
- /// The ResultMap name used by the statement.
- /// </summary>
- [XmlAttribute("resultMap")]
- public string ResultMapName
- {
- get { return _resultMapName; }
- set { _resultMapName = value; }
- }
-
- /// <summary>
- /// The ParameterMap name used by the statement.
- /// </summary>
- [XmlAttribute("parameterMap")]
- public string ParameterMapName
- {
- get { return _parameterMapName; }
- set { _parameterMapName = value; }
- }
-
- /// <summary>
- /// The ResultMap used by the statement.
- /// </summary>
- [XmlIgnore]
- public ResultMap ResultMap
- {
- get { return _resultMap; }
- }
-
- /// <summary>
- /// The parameterMap used by the statement.
- /// </summary>
- [XmlIgnore]
- public ParameterMap ParameterMap
- {
- get { return _parameterMap; }
- set { _parameterMap = value; }
- }
-
- /// <summary>
- /// The type of the statement (text or procedure)
- /// Default Text.
- /// </summary>
- /// <example>Text or StoredProcedure</example>
- [XmlIgnore]
- public virtual CommandType CommandType
- {
- get { return CommandType.Text; }
- }
- #endregion
-
- #region Constructor (s) / Destructor
- /// <summary>
- /// Do not use direclty, only for serialization.
- /// </summary>
- public Statement()
- {
-
- }
- #endregion
-
- #region Methods
- /// <summary>
- /// Initialize an statement for the sqlMap.
- /// </summary>
- /// <param name="configurationScope">The scope of the
configuration</param>
- internal virtual void Initialize(ConfigurationScope
configurationScope)
- {
- if (_resultMapName != string.Empty )
- {
- _resultMap =
configurationScope.SqlMapper.GetResultMap( _resultMapName);
- }
- if (_parameterMapName != string.Empty )
- {
- _parameterMap =
configurationScope.SqlMapper.GetParameterMap( _parameterMapName);
- }
- if (_resultClassName != string.Empty )
- {
- _resultClass =
configurationScope.SqlMapper.TypeHandlerFactory.GetType(_resultClassName);
- if (Type.GetTypeCode(_resultClass) ==
TypeCode.Object &&
- (_resultClass.IsValueType == false))
- {
- _resultClassFactory =
configurationScope.SqlMapper.ObjectFactory.CreateFactory(_resultClass,
Type.EmptyTypes);
- }
- }
- if (_parameterClassName != string.Empty )
- {
- _parameterClass =
configurationScope.SqlMapper.TypeHandlerFactory.GetType(_parameterClassName);
- }
- if (_listClassName != string.Empty )
- {
- _listClass =
configurationScope.SqlMapper.TypeHandlerFactory.GetType(_listClassName);
- _listClassFactory =
configurationScope.SqlMapper.ObjectFactory.CreateFactory(_listClass,
Type.EmptyTypes);
- }
- }
+ /// <summary>
+ /// Allow remapping of dynamic SQL
+ /// </summary>
+ [XmlAttribute("remapResults")]
+ public bool AllowRemapping
+ {
+ get { return _allowRemapping; }
+ set { _allowRemapping = value; }
+ }
+
+ /// <summary>
+ /// Extend statement attribute
+ /// </summary>
+ [XmlAttribute("extends")]
+ public virtual string ExtendStatement
+ {
+ get { return _extendStatement; }
+ set { _extendStatement = value; }
+ }
+
+ /// <summary>
+ /// The CacheModel name to use.
+ /// </summary>
+ [XmlAttribute("cacheModel")]
+ public string CacheModelName
+ {
+ get { return _cacheModelName; }
+ set { _cacheModelName = value; }
+ }
+
+ /// <summary>
+ /// Tell us if a cacheModel is attached to this statement.
+ /// </summary>
+ [XmlIgnore]
+ public bool HasCacheModel
+ {
+ get { return _cacheModelName.Length > 0; }
+ }
+
+ /// <summary>
+ /// The CacheModel used by this statement.
+ /// </summary>
+ [XmlIgnore]
+ public CacheModel CacheModel
+ {
+ get { return _cacheModel; }
+ set { _cacheModel = value; }
+ }
+
+ /// <summary>
+ /// The list class name to use for strongly typed collection.
+ /// </summary>
+ [XmlAttribute("listClass")]
+ public string ListClassName
+ {
+ get { return _listClassName; }
+ set { _listClassName = value; }
+ }
+
+
+ /// <summary>
+ /// The list class type to use for strongly typed collection.
+ /// </summary>
+ [XmlIgnore]
+ public Type ListClass
+ {
+ get { return _listClass; }
+ }
+
+ /// <summary>
+ /// The result class name to used.
+ /// </summary>
+ [XmlAttribute("resultClass")]
+ public string ResultClassName
+ {
+ get { return _resultClassName; }
+ set { _resultClassName = value; }
+ }
+
+ /// <summary>
+ /// The result class type to used.
+ /// </summary>
+ [XmlIgnore]
+ public Type ResultClass
+ {
+ get { return _resultClass; }
+ }
+
+ /// <summary>
+ /// The parameter class name to used.
+ /// </summary>
+ [XmlAttribute("parameterClass")]
+ public string ParameterClassName
+ {
+ get { return _parameterClassName; }
+ set { _parameterClassName = value; }
+ }
+
+ /// <summary>
+ /// The parameter class type to used.
+ /// </summary>
+ [XmlIgnore]
+ public Type ParameterClass
+ {
+ get { return _parameterClass; }
+ }
+
+ /// <summary>
+ /// Name used to identify the statement amongst the others.
+ /// </summary>
+ [XmlAttribute("id")]
+ public string Id
+ {
+ get { return _id; }
+ set
+ {
+ if ((value == null) || (value.Length < 1))
+ throw new DataMapperException("The id attribute is
required in a statement tag.");
+
+ _id = value;
+ }
+ }
+
+
+ /// <summary>
+ /// The sql statement
+ /// </summary>
+ [XmlIgnore]
+ public ISql Sql
+ {
+ get { return _sql; }
+ set
+ {
+ if (value == null)
+ throw new DataMapperException("The sql statement query
text is required in the statement tag " + _id);
+
+ _sql = value;
+ }
+ }
+
+
+ /// <summary>
+ /// The ResultMaps name used by the statement.
+ /// </summary>
+ [XmlAttribute("resultMap")]
+ public string ResultMapName
+ {
+ get { return _resultMapName; }
+ set { _resultMapName = value; }
+ }
+
+ /// <summary>
+ /// The ParameterMap name used by the statement.
+ /// </summary>
+ [XmlAttribute("parameterMap")]
+ public string ParameterMapName
+ {
+ get { return _parameterMapName; }
+ set { _parameterMapName = value; }
+ }
+
+ /// <summary>
+ /// The ResultMap used by the statement.
+ /// </summary>
+ [XmlIgnore]
+ public ResultMapCollection ResultsMap
+ {
+ get { return _resultsMap; }
+ }
+ /// <summary>
+ /// The parameterMap used by the statement.
+ /// </summary>
+ [XmlIgnore]
+ public ParameterMap ParameterMap
+ {
+ get { return _parameterMap; }
+ set { _parameterMap = value; }
+ }
- /// <summary>
- /// Create an instance of result class.
- /// </summary>
- /// <returns>An object.</returns>
- public object CreateInstanceOfResultClass()
- {
- if (_resultClass.IsPrimitive || _resultClass == typeof
(string))
- {
- TypeCode typeCode =
Type.GetTypeCode(_resultClass);
- return TypeUtils.InstantiatePrimitiveType(typeCode);
- }
- else
- {
- if (_resultClass.IsValueType)
+ /// <summary>
+ /// The type of the statement (text or procedure)
+ /// Default Text.
+ /// </summary>
+ /// <example>Text or StoredProcedure</example>
+ [XmlIgnore]
+ public virtual CommandType CommandType
+ {
+ get { return CommandType.Text; }
+ }
+ #endregion
+
+
+ #region Methods
+ /// <summary>
+ /// Initialize an statement for the sqlMap.
+ /// </summary>
+ /// <param name="configurationScope">The scope of the
configuration</param>
+ internal virtual void Initialize(ConfigurationScope configurationScope)
+ {
+ if (_resultMapName.Length > 0)
+ {
+ string[] names = _resultMapName.Split(',');
+ for (int i = 0; i < names.Length; i++)
{
- if (_resultClass == typeof (DateTime))
- {
- return new DateTime();
- }
- else if (_resultClass == typeof (Decimal))
- {
- return new Decimal();
- }
- else if (_resultClass == typeof (Guid))
- {
- return Guid.Empty;
- }
- else if (_resultClass == typeof (TimeSpan))
- {
- return new TimeSpan(0);
- }
-#if dotnet2
- else if (_resultClass.IsGenericType &&
typeof(Nullable<>).IsAssignableFrom(_resultClass.GetGenericTypeDefinition()))
+ string name =
configurationScope.ApplyNamespace(names[i].Trim());
+ _resultsMap.Add(
configurationScope.SqlMapper.GetResultMap(name) );
+ }
+ }
+ if (_parameterMapName.Length > 0)
+ {
+ _parameterMap =
configurationScope.SqlMapper.GetParameterMap(_parameterMapName);
+ }
+ if (_resultClassName.Length > 0)
+ {
+ string[] classNames = _resultClassName.Split(',');
+ for (int i = 0; i < classNames.Length; i++)
+ {
+ _resultClass =
configurationScope.SqlMapper.TypeHandlerFactory.GetType(classNames[i].Trim());
+ IFactory resultClassFactory = null;
+ if (Type.GetTypeCode(_resultClass) == TypeCode.Object &&
+ (_resultClass.IsValueType == false))
{
- return TypeUtils.InstantiateNullableType(_resultClass);
+ resultClassFactory =
configurationScope.SqlMapper.ObjectFactory.CreateFactory(_resultClass,
Type.EmptyTypes);
}
-#endif
- else
- {
- throw new NotImplementedException("Unable to
instanciate value type");
- }
-
+ IDataExchange dataExchange =
configurationScope.DataExchangeFactory.GetDataExchangeForClass(_resultClass);
+ IResultMap autoMap = new AutoResultMap(_resultClass,
resultClassFactory, dataExchange);
+ _resultsMap.Add(autoMap);
}
- else
- {
- return
_resultClassFactory.CreateInstance(null);
- }
- }
- }
-
-
- /// <summary>
- /// Create an instance of 'IList' class.
- /// </summary>
- /// <returns>An object which implment IList.</returns>
- public IList CreateInstanceOfListClass()
- {
- return (IList)_listClassFactory.CreateInstance(null); ;
- }
+
+
+ }
+ if (_parameterClassName.Length > 0)
+ {
+ _parameterClass =
configurationScope.SqlMapper.TypeHandlerFactory.GetType(_parameterClassName);
+ }
+ if (_listClassName.Length > 0)
+ {
+ _listClass =
configurationScope.SqlMapper.TypeHandlerFactory.GetType(_listClassName);
+ _listClassFactory =
configurationScope.SqlMapper.ObjectFactory.CreateFactory(_listClass,
Type.EmptyTypes);
+ }
+ }
+
+
+ /// <summary>
+ /// Create an instance of 'IList' class.
+ /// </summary>
+ /// <returns>An object which implment IList.</returns>
+ public IList CreateInstanceOfListClass()
+ {
+ return (IList)_listClassFactory.CreateInstance(null);
+ }
#if dotnet2
/// <summary>
/// Create an instance of a generic 'IList' class.
@@ -408,10 +360,10 @@
/// <returns>An object which implment IList.</returns>
public IList<T> CreateInstanceOfGenericListClass<T>()
{
- return (IList<T>)_listClassFactory.CreateInstance(null); ;
+ return (IList<T>)_listClassFactory.CreateInstance(null);
}
#endif
- #endregion
+ #endregion
- }
+ }
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.20005.csproj
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.20005.csproj?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.20005.csproj
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.20005.csproj
Mon Oct 30 11:09:11 2006
@@ -94,7 +94,9 @@
<Compile Include="AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Commands\DataReaderDecorator.cs" />
<Compile Include="Commands\DataReaderTransformer.cs" />
+ <Compile Include="Commands\DbCommandDecorator.cs" />
<Compile Include="Commands\DefaultPreparedCommand.cs">
<SubType>Code</SubType>
</Compile>
@@ -152,12 +154,15 @@
</Compile>
<Compile
Include="Configuration\ParameterMapping\ParameterPropertyCollection.cs" />
<Compile Include="Configuration\ResultMapping\ArgumentProperty.cs" />
+ <Compile Include="Configuration\ResultMapping\AutoResultMap.cs" />
<Compile Include="Configuration\ResultMapping\Discriminator.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Configuration\ResultMapping\IResultMap.cs" />
<Compile Include="Configuration\ResultMapping\ResultMap.cs">
<SubType>Code</SubType>
</Compile>
+ <Compile Include="Configuration\ResultMapping\ResultMapCollection.cs" />
<Compile Include="Configuration\ResultMapping\ResultProperty.cs">
<SubType>Code</SubType>
</Compile>
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.csproj
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.csproj?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.csproj
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/IBatisNet.DataMapper.csproj Mon
Oct 30 11:09:11 2006
@@ -155,11 +155,6 @@
BuildAction = "Content"
/>
<File
- RelPath = "SessionHolder.cs"
- SubType = "Code"
- BuildAction = "Compile"
- />
- <File
RelPath = "SqlMap.xsd"
BuildAction = "EmbeddedResource"
/>
@@ -178,11 +173,21 @@
BuildAction = "Compile"
/>
<File
+ RelPath = "Commands\DataReaderDecorator.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Commands\DataReaderTransformer.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
+ RelPath = "Commands\DbCommandDecorator.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Commands\DefaultPreparedCommand.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -288,12 +293,27 @@
BuildAction = "Compile"
/>
<File
+ RelPath = "Configuration\ResultMapping\AutoResultMap.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Configuration\ResultMapping\Discriminator.cs"
SubType = "Code"
BuildAction = "Compile"
/>
<File
+ RelPath = "Configuration\ResultMapping\IResultMap.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
RelPath = "Configuration\ResultMapping\ResultMap.cs"
+ SubType = "Code"
+ BuildAction = "Compile"
+ />
+ <File
+ RelPath =
"Configuration\ResultMapping\ResultMapCollection.cs"
SubType = "Code"
BuildAction = "Compile"
/>
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ISqlMapper.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ISqlMapper.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ISqlMapper.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper/ISqlMapper.cs Mon Oct 30
11:09:11 2006
@@ -23,6 +23,7 @@
********************************************************************************/
#endregion
+using System;
using System.Collections;
#if dotnet2
using System.Collections.Generic;
@@ -128,13 +129,13 @@
/// </summary>
/// <param name="name">The name of the result map</param>
/// <returns>The ResultMap</returns>
- ResultMap GetResultMap(string name);
+ IResultMap GetResultMap(string name);
/// <summary>
/// Adds a (named) ResultMap
/// </summary>
/// <param name="resultMap">The ResultMap to add</param>
- void AddResultMap(ResultMap resultMap);
+ void AddResultMap(IResultMap resultMap);
/// <summary>
/// The ParameterMap collection
@@ -432,6 +433,7 @@
/// <param name="parameterObject">The object used to set the
parameters in the SQL</param>
/// <param name="pageSize">The maximum number of objects to store in
each page</param>
/// <returns>A PaginatedList of beans containing the rows</returns>
+ [Obsolete("This method will be remove in future version.", false)]
PaginatedList QueryForPaginatedList(string statementName, object
parameterObject, int pageSize);
/// <summary>
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/ArgumentStrategy/ResultMapStrategy.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/ArgumentStrategy/ResultMapStrategy.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/ArgumentStrategy/ResultMapStrategy.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/ArgumentStrategy/ResultMapStrategy.cs
Mon Oct 30 11:09:11 2006
@@ -51,7 +51,7 @@
object[] parameters = null;
bool isParameterFound = false;
- ResultMap resultMapping =
mapping.NestedResultMap.ResolveSubMap(reader);
+ IResultMap resultMapping =
mapping.NestedResultMap.ResolveSubMap(reader);
if (resultMapping.Parameters.Count > 0)
{
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/BaseStrategy.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/BaseStrategy.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/BaseStrategy.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/BaseStrategy.cs
Mon Oct 30 11:09:11 2006
@@ -51,7 +51,7 @@
/// <param name="resultObject">The result object.</param>
/// <returns>Indicates if we have found a row.</returns>
protected bool FillObjectWithReaderAndResultMap(RequestScope
request,IDataReader reader,
- ResultMap
resultMap, object resultObject)
+ IResultMap
resultMap, object resultObject)
{
bool dataFound = false;
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=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
Mon Oct 30 11:09:11 2006
@@ -33,6 +33,7 @@
using IBatisNet.Common;
using IBatisNet.DataMapper.Commands;
using IBatisNet.DataMapper.Configuration.Cache;
+using IBatisNet.DataMapper.Configuration.ResultMapping;
using IBatisNet.DataMapper.Configuration.Statements;
using IBatisNet.DataMapper.Scope;
@@ -63,15 +64,6 @@
#region IMappedStatement Members
- /// <summary>
- /// Gets or sets the <see cref="ReaderAutoMapper"/>.
- /// </summary>
- /// <value>The <see cref="ReaderAutoMapper"/>.</value>
- public ReaderAutoMapper ReaderAutoMapper
- {
- set { _mappedStatement.ReaderAutoMapper = value; }
- get { return _mappedStatement.ReaderAutoMapper; }
- }
/// <summary>
/// The IPreparedCommand to use
@@ -207,7 +199,7 @@
list = this.Statement.CacheModel[cacheKey] as IList;
if (list == null)
{
- list =
_mappedStatement.RunQueryForList(request, session, parameterObject,
skipResults, maxResults, null);
+ list =
_mappedStatement.RunQueryForList(request, session, parameterObject,
skipResults, maxResults);
this.Statement.CacheModel[cacheKey] = list;
}
@@ -263,7 +255,7 @@
list = this.Statement.CacheModel[cacheKey] as IList<T>;
if (list == null)
{
- list = _mappedStatement.RunQueryForList<T>(request, session,
parameterObject, skipResults, maxResults, null);
+ list = _mappedStatement.RunQueryForList<T>(request, session,
parameterObject, skipResults, maxResults);
this.Statement.CacheModel[cacheKey] = list;
}
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs
URL:
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs?view=diff&rev=469233&r1=469232&r2=469233
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/IMappedStatement.cs
Mon Oct 30 11:09:11 2006
@@ -32,6 +32,7 @@
#endif
using IBatisNet.Common;
using IBatisNet.DataMapper.Commands;
+using IBatisNet.DataMapper.Configuration.ResultMapping;
using IBatisNet.DataMapper.Configuration.Statements;
#endregion
@@ -59,15 +60,7 @@
#region Properties
- /// <summary>
- /// Gets or sets the <see cref="ReaderAutoMapper"/>.
- /// </summary>
- /// <value>The <see cref="ReaderAutoMapper"/>.</value>
- ReaderAutoMapper ReaderAutoMapper
- {
- set;
- get;
- }
+
/// <summary>
/// The IPreparedCommand to use
/// </summary>