ibatis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gba...@apache.org
Subject svn commit: r381411 - in /ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test: ./ Domain/ Maps/Access/OleDb/ Maps/MSSQL/Odbc/ Maps/MSSQL/OleDb/ Maps/MSSQL/SqlClient/ Maps/MySql/ByteFx/ Maps/MySql/MySql/ Maps/Oracle/ODP/ Maps/Oracle/OracleClient/ Maps/Post...
Date Mon, 27 Feb 2006 19:30:58 GMT
Author: gbayon
Date: Mon Feb 27 11:30:51 2006
New Revision: 381411

URL: http://svn.apache.org/viewcvs?rev=381411&view=rev
Log:
- Added nunit test for generic (.NET V2 support)

Added:
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection2.cs   (with
props)
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/ps_SelectLineItem.sql
Modified:
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/Order.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/LineItem.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/LineItem.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/LineItem.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Order.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/ResultMapTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/MSSQL/Generics/StatementTest.cs
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/line-item-init.sql

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection.cs?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection.cs Mon Feb
27 11:30:51 2006
@@ -4,6 +4,7 @@
 
 namespace IBatisNet.DataMapper.Test.Domain 
 {
+	[Serializable]
 	public class LineItemCollection : CollectionBase 
 	{
 		public LineItemCollection() {}

Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection2.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection2.cs?rev=381411&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection2.cs (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection2.cs Mon Feb
27 11:30:51 2006
@@ -0,0 +1,13 @@
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+
+using System.Text;
+
+namespace IBatisNet.DataMapper.Test.Domain
+{
+    [Serializable]
+    public class LineItemCollection2 : Collection<LineItem>
+    {
+    }
+}

Propchange: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection2.cs
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/LineItemCollection2.cs
------------------------------------------------------------------------------
    svn:keywords = Id LastChangedDate LastChangedBy

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/Order.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/Order.cs?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/Order.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/Order.cs Mon Feb 27 11:30:51 2006
@@ -34,6 +34,14 @@
             get { return _genericList; }
             set { _genericList = value; }
         }
+
+        private LineItemCollection2 _genericCollection = null;
+
+        public LineItemCollection2 LineItemsCollection
+        {
+            get { return _genericCollection; }
+            set { _genericCollection = value; }
+        }
 #else
         private IList _genericList;
 
@@ -41,6 +49,14 @@
         {
             get { return _genericList; }
             set { _genericList = value; }
+        }
+
+        private LineItemCollection _collection = null;
+
+        public LineItemCollection LineItemsCollection
+        {
+            get { return _collection; }
+            set { _collection = value; }
         }
 #endif
 

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
Mon Feb 27 11:30:51 2006
@@ -157,6 +157,7 @@
     <Compile Include="Domain\LineItemCollection.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="Domain\LineItemCollection2.cs" />
     <Compile Include="Domain\Newspaper.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -185,6 +186,7 @@
     <Compile Include="NUnit\SqlMapTests\BaseTest.cs">
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="NUnit\SqlMapTests\CacheController\CacheModelTest.cs" />
     <Compile Include="NUnit\SqlMapTests\CacheController\FifoCacheControllerTest.cs">
       <SubType>Code</SubType>
     </Compile>
@@ -407,6 +409,7 @@
     <Content Include="Scripts\MSSQL\order-init.sql" />
     <Content Include="Scripts\MSSQL\other-init.sql" />
     <Content Include="Scripts\MSSQL\ps_SelectAccount.sql" />
+    <Content Include="Scripts\MSSQL\ps_SelectLineItem.sql" />
     <Content Include="Scripts\MSSQL\README-embed-param.txt" />
     <Content Include="Scripts\MSSQL\swap-procedure.sql" />
     <Content Include="Scripts\MSSQL\user-init.sql" />

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Order.xml Mon Feb 27
11:30:51 2006
@@ -21,7 +21,13 @@
             extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
-    
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
+
+   
 		<resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
 			<result property="LineItemsIList" lazyLoad="true" column="Order_ID" select="GetLineItemsForOrder"
/>
@@ -194,6 +200,19 @@
 	</resultMaps>  
 	
 	<statements>
+
+    <statement id="GetOrderWithGenericListLineItem"
+      parameterClass="Integer"
+      resultMap="order-with-generic-list-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+   
 		<statement id="GetOrderLiteByColumnName"
 					parameterClass="Int"
 					resultMap="lite-order-result-by-name" >

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/LineItem.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/LineItem.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/LineItem.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/LineItem.xml Mon Feb
27 11:30:51 2006
@@ -30,6 +30,11 @@
 	</resultMaps>  
 	
 	<statements>
+
+    <procedure id="SelectLineItemForOrder" parameterMap="select-params" resultClass="LineItem">
+      ps_SelectLineItem
+    </procedure>
+    
 		<statement id="GetLineItemPrice"
 					parameterClass="Hashtable"
 					resultMap="LineItem-Price" >
@@ -175,8 +180,12 @@
 	
 
   
-	<parameterMaps>   
-		
+	<parameterMaps>
+
+    <parameterMap id="select-params">
+      <parameter property="Order_ID" />
+    </parameterMap>
+    
 		<parameterMap id="insert-params">
 			<parameter property="Id" />
 			<parameter property="Order.Id" />

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Order.xml Mon Feb 27
11:30:51 2006
@@ -21,8 +21,18 @@
             extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
-    
-		<resultMap id="order-with-lines-result" class="Order" 
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
+
+    <resultMap id="order-with-generic-collection-via-sp" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="SelectLineItemForOrder"
/>
+    </resultMap>
+        
+    <resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
 			<result property="LineItemsIList" lazyLoad="true" column="Order_ID" select="GetLineItemsForOrder"
/>
 		</resultMap>
@@ -206,12 +216,18 @@
 	
 	<statements>
 
-    <statement id="GetOrderWithGenricListLineItem"
+    <statement id="GetOrderWithGenericListLineItem"
       parameterClass="Integer"
       resultMap="order-with-generic-list-lineitem" >
           select * from Orders where Order_ID = #value#
     </statement>
-    
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+   
 		<statement id="GetOrderByHashTable"
 					parameterClass="Int"
 					resultMap="order-hash" >

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/LineItem.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/LineItem.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/LineItem.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/LineItem.xml Mon Feb
27 11:30:51 2006
@@ -30,7 +30,12 @@
 	</resultMaps>  
 	
 	<statements>
-		<statement id="GetLineItemPrice"
+
+    <procedure id="SelectLineItemForOrder" parameterMap="select-params" resultClass="LineItem">
+      ps_SelectLineItem
+    </procedure>
+
+    <statement id="GetLineItemPrice"
 					parameterClass="Hashtable"
 					resultMap="LineItem-Price" >
 			select
@@ -175,8 +180,12 @@
 	
 
   
-	<parameterMaps>   
-		
+	<parameterMaps>
+
+    <parameterMap id="select-params">
+      <parameter property="Order_ID" />
+    </parameterMap>
+    
 		<parameterMap id="insert-params">
 			<parameter property="Id" />
 			<parameter property="Order.Id" />

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Order.xml Mon Feb 27
11:30:51 2006
@@ -18,9 +18,19 @@
 		</resultMap>
 
     <resultMap id="order-with-generic-list-lineitem" class="Order" 
-        extends="lite-order-result-by-name" >
+            extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
+
+    <resultMap id="order-with-generic-collection-via-sp" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="SelectLineItemForOrder"
/>
+    </resultMap>
     
 		<resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
@@ -206,7 +216,27 @@
 	</resultMaps>  
 	
 	<statements>
-		<statement id="GetOrderLiteByColumnName"
+
+    <statement id="GetOrderWithGenericListLineItem"
+     parameterClass="Integer"
+     resultMap="order-with-generic-list-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericViaSP"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-via-sp" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    
+    <statement id="GetOrderLiteByColumnName"
 					parameterClass="Int"
 					resultMap="lite-order-result-by-name" >
 			select * from Orders where Order_ID = #value#

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/LineItem.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/LineItem.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/LineItem.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/LineItem.xml Mon
Feb 27 11:30:51 2006
@@ -31,6 +31,11 @@
 	</resultMaps>  
 	
 	<statements>
+
+    <procedure id="SelectLineItemForOrder" parameterMap="select-params" resultClass="LineItem">
+      ps_SelectLineItem
+    </procedure>
+    
 		<statement id="GetLineItemPrice"
 					parameterClass="Hashtable"
 					resultMap="LineItem-Price" >
@@ -176,8 +181,12 @@
 	
 
   
-	<parameterMaps>   
-		
+	<parameterMaps>
+
+    <parameterMap id="select-params">
+      <parameter property="Order_ID" />
+    </parameterMap>
+    
 		<parameterMap id="insert-params">
 			<parameter property="Id" />
 			<parameter property="Order.Id" />

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Order.xml Mon Feb
27 11:30:51 2006
@@ -34,6 +34,16 @@
             extends="lite-order-result-by-name" >
         <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
+
+    <resultMap id="order-with-generic-collection-via-sp" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="SelectLineItemForOrder"
/>
+    </resultMap>
     
     <resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
@@ -220,6 +230,24 @@
 			WHERE     Orders.Order_ID = #value#
 		</select>-->
 
+   
+    <statement id="GetOrderWithGenericListLineItem"
+      parameterClass="Integer"
+      resultMap="order-with-generic-list-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+    
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericViaSP"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-via-sp" >
+      select * from Orders where Order_ID = #value#
+    </statement>
 
     
 		<statement id="GetOrderLiteByColumnName"

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Order.xml Mon Feb 27
11:30:51 2006
@@ -18,11 +18,16 @@
 		</resultMap>
 
     <resultMap id="order-with-generic-list-lineitem" class="Order" 
-        extends="lite-order-result-by-name" >
+            extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
-    
-		<resultMap id="order-with-lines-result" class="Order" 
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
+
+    <resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
 			<result property="LineItemsIList" lazyLoad="true" column="Order_ID" select="GetLineItemsForOrder"
/>
 		</resultMap>
@@ -194,13 +199,19 @@
 	
 	<statements>
 
-    <statement id="GetOrderWithGenricListLineItem"
+    <statement id="GetOrderWithGenericListLineItem"
       parameterClass="Integer"
       resultMap="order-with-generic-list-lineitem" >
-          select * from Orders where Order_ID = #value#
+      select * from Orders where Order_ID = #value#
     </statement>
-    
-		<statement id="GetOrderByHashTable"
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+     <statement id="GetOrderByHashTable"
 					parameterClass="Int"
 					resultMap="order-hash" >
 			select Order_Date from Orders where Order_ID = #value#

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Order.xml Mon Feb 27
11:30:51 2006
@@ -18,9 +18,14 @@
 		</resultMap>
 
     <resultMap id="order-with-generic-list-lineitem" class="Order" 
-           extends="lite-order-result-by-name" >
+            extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
     
     <resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
@@ -194,9 +199,15 @@
 	
 	<statements>
 
-    <statement id="GetOrderWithGenricListLineItem"
+    <statement id="GetOrderWithGenericListLineItem"
       parameterClass="Integer"
       resultMap="order-with-generic-list-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
       select * from Orders where Order_ID = #value#
     </statement>
     

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Order.xml Mon Feb 27
11:30:51 2006
@@ -21,6 +21,11 @@
             extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
     
 		<resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
@@ -193,9 +198,15 @@
 	</resultMaps>  
 	
 	<statements>
-    <statement id="GetOrderWithGenricListLineItem"
+    <statement id="GetOrderWithGenericListLineItem"
       parameterClass="Integer"
       resultMap="order-with-generic-list-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
       select * from Orders where Order_ID = #value#
     </statement>
     

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Order.xml Mon
Feb 27 11:30:51 2006
@@ -18,9 +18,14 @@
 		</resultMap>
 
     <resultMap id="order-with-generic-list-lineitem" class="Order" 
-           extends="lite-order-result-by-name" >
+            extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
     
 		<resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
@@ -194,10 +199,16 @@
 	
 	<statements>
 
-    <statement id="GetOrderWithGenricListLineItem"
+    <statement id="GetOrderWithGenericListLineItem"
       parameterClass="Integer"
       resultMap="order-with-generic-list-lineitem" >
-          select * from Orders where Order_ID = #value#
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
+      select * from Orders where Order_ID = #value#
     </statement>
     
 		<statement id="GetOrderByHashTable"

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Order.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Order.xml?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Order.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Order.xml Mon
Feb 27 11:30:51 2006
@@ -21,6 +21,11 @@
             extends="lite-order-result-by-name" >
       <result property="LineItemsGenericList" column="Order_ID" select="GetLineItemsForOrder"
/>
     </resultMap>
+
+    <resultMap id="order-with-generic-collection-lineitem" class="Order" 
+        extends="lite-order-result-by-name" >
+      <result property="LineItemsCollection" column="Order_ID" select="GetLineItemsForOrder"
/>
+    </resultMap>
     
     <resultMap id="order-with-lines-result" class="Order" 
 								extends="lite-order-result-by-name" >
@@ -193,9 +198,15 @@
 	</resultMaps>  
 	
 	<statements>
-    <statement id="GetOrderWithGenricListLineItem"
+    <statement id="GetOrderWithGenericListLineItem"
       parameterClass="Integer"
       resultMap="order-with-generic-list-lineitem" >
+      select * from Orders where Order_ID = #value#
+    </statement>
+
+    <statement id="GetOrderWithGenericLineItemCollection"
+      parameterClass="Integer"
+      resultMap="order-with-generic-collection-lineitem" >
       select * from Orders where Order_ID = #value#
     </statement>
     

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/ResultMapTest.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/ResultMapTest.cs?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/ResultMapTest.cs
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/ResultMapTest.cs
Mon Feb 27 11:30:51 2006
@@ -21,7 +21,6 @@
         public void Init()
         {
             InitScript(sqlMap.DataSource, ScriptDirectory + "account-init.sql");
-            InitScript(sqlMap.DataSource, ScriptDirectory + "account-procedure.sql", false);
             InitScript(sqlMap.DataSource, ScriptDirectory + "order-init.sql");
             InitScript(sqlMap.DataSource, ScriptDirectory + "line-item-init.sql");
             InitScript(sqlMap.DataSource, ScriptDirectory + "enumeration-init.sql");
@@ -40,12 +39,11 @@
 
         /// <summary>
         /// Test generic Ilist  
-        /// order.LineItemsGenericList 
         /// </summary>
         [Test]
         public void TestGenricListMapping()
         {
-            Order order = sqlMap.QueryForObject<Order>("GetOrderWithGenricListLineItem",
1);
+            Order order = sqlMap.QueryForObject<Order>("GetOrderWithGenericListLineItem",
1);
 
             AssertOrder1(order);
 
@@ -54,6 +52,22 @@
             Assert.AreEqual(2, order.LineItemsGenericList.Count);
 
         }
+
+        /// <summary>
+        /// Test generic Collection  
+        /// </summary>
+        [Test]
+        public void TestGenricCollectionMapping()
+        {
+            Order order = sqlMap.QueryForObject<Order>("GetOrderWithGenericLineItemCollection",
1);
+
+            AssertOrder1(order);
+
+            // Check generic collection
+            Assert.IsNotNull(order.LineItemsCollection);
+            Assert.AreEqual(2, order.LineItemsCollection.Count);
+        }
+
         #endregion
     }
 }

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/MSSQL/Generics/StatementTest.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/MSSQL/Generics/StatementTest.cs?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/MSSQL/Generics/StatementTest.cs
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/MSSQL/Generics/StatementTest.cs
Mon Feb 27 11:30:51 2006
@@ -29,8 +29,11 @@
 			InitScript( sqlMap.DataSource, ScriptDirectory + "account-init.sql" );
 			InitScript( sqlMap.DataSource, ScriptDirectory + "account-procedure.sql", false );
 			InitScript( sqlMap.DataSource, ScriptDirectory + "ps_SelectAccount.sql", false );
+
 			InitScript( sqlMap.DataSource, ScriptDirectory + "category-init.sql" );
 			InitScript( sqlMap.DataSource, ScriptDirectory + "order-init.sql" );
+            InitScript(sqlMap.DataSource, ScriptDirectory + "line-item-init.sql");
+            InitScript(sqlMap.DataSource, ScriptDirectory + "ps_SelectLineItem.sql", false);
 		}
 
 		/// <summary>
@@ -167,6 +170,21 @@
 			AssertOrder1(order);
 			AssertAccount1(order.Account);
 		}
+
+        /// <summary>
+        /// Test generic Collection via store procedure
+        /// </summary>
+        [Test]
+        public void TestGenricCollectionMappingViaSP()
+        {
+            Order order = sqlMap.QueryForObject<Order>("GetOrderWithGenericViaSP",
1);
+
+            AssertOrder1(order);
+
+            // Check generic collection
+            Assert.IsNotNull(order.LineItemsCollection);
+            Assert.AreEqual(2, order.LineItemsCollection.Count);
+        }
 		#endregion
 
 

Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/line-item-init.sql
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/line-item-init.sql?rev=381411&r1=381410&r2=381411&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/line-item-init.sql (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/line-item-init.sql Mon
Feb 27 11:30:51 2006
@@ -51,3 +51,6 @@
 INSERT INTO [dbo].[LineItems] VALUES (1, 1, 'ESM-48', 8, 87.60, null);
 INSERT INTO [dbo].[LineItems] VALUES (2, 1, 'ESM-23', 1, 55.40, null);
 
+if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[ps_SelectLineItem]')
and OBJECTPROPERTY(id, N'IsProcedure') = 1)
+drop procedure [dbo].[ps_SelectLineItem]
+

Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/ps_SelectLineItem.sql
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/ps_SelectLineItem.sql?rev=381411&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/ps_SelectLineItem.sql (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/MSSQL/ps_SelectLineItem.sql Mon
Feb 27 11:30:51 2006
@@ -0,0 +1,9 @@
+CREATE PROCEDURE dbo.[ps_SelectLineItem]
+@Order_ID  [int]
+AS
+select
+	LineItem_ID as Id,
+	LineItem_Code as Code,
+	LineItem_Quantity as Quantity,
+	LineItem_Price as Price
+from LineItems where Order_ID = @Order_ID
\ No newline at end of file



Mime
View raw message