Author: gbayon
Date: Tue Sep 20 10:39:58 2005
New Revision: 290492

URL: http://svn.apache.org/viewcvs?rev=290492&view=rev
Log:
- Added Nunit test for dynamic insert
- Updated PostgresSQL provider to last version 0.7.1

Modified:
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Account.xml
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Account.xml
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Account.xml
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Account.xml
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/SqlMap_PostgreSQL_Npgsql.config
    ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml 
Tue Sep 20 10:39:58 2005
@@ -481,9 +481,23 @@
                        <![CDATA[FROM ]]> 
                        Accounts 
                </statement> 
- 
                <!-- JIRA-110 -->
-                               
+
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+        </insert>
+                                       
                <!-- For procedure, the parameters of the parameterMap must in 
the same order 
                as for the procedure paramaters-->
                <procedure id="InsertAccountViaStoreProcedure" 
parameterMap="insert-params">

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml 
Tue Sep 20 10:39:58 2005
@@ -482,7 +482,22 @@
                        Accounts 
                </statement> 
                <!-- JIRA-110 -->
-                               
+
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+        </insert>
+                                       
                <!-- For procedure, the parameters of the parameterMap must in 
the same order 
                as for the procedure paramaters-->
                <procedure id="InsertAccountViaStoreProcedure" 
parameterMap="insert-params">

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
 Tue Sep 20 10:39:58 2005
@@ -528,8 +528,22 @@
                        <![CDATA[FROM ]]> 
                        Accounts 
                </statement> 
- 
                <!-- JIRA-110 -->
+                               
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+           </insert>
                                
                <!-- For procedure, the parameters of the parameterMap must in 
the same order 
                as for the procedure paramaters-->

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Account.xml 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Account.xml 
Tue Sep 20 10:39:58 2005
@@ -529,7 +529,22 @@
                        Accounts 
                </statement> 
                <!-- JIRA-110 -->
-                                                               
+
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+        </insert>
+                                                                       
                <!-- For procedure, the parameters of the parameterMap must in 
the same order 
                as for the procedure paramaters-->
                <procedure id="InsertAccountViaStoreProcedure" 
parameterMap="insert-params">

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Account.xml 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Account.xml 
Tue Sep 20 10:39:58 2005
@@ -529,7 +529,22 @@
                        Accounts 
                </statement> 
                <!-- JIRA-110 -->
-                                                               
+
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+        </insert>
+                                                                       
                <!-- For procedure, the parameters of the parameterMap must in 
the same order 
                as for the procedure paramaters-->
                <procedure id="InsertAccountViaStoreProcedure" 
parameterMap="insert-params">

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Account.xml 
Tue Sep 20 10:39:58 2005
@@ -590,7 +590,22 @@
                        Accounts 
                </statement> 
                <!-- JIRA-110 -->
-                                               
+
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+        </insert>
+                                                       
                <!-- For procedure, the parameters of the parameterMap must in 
the same order 
                as for the procedure paramaters-->
                <!--

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Account.xml
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Account.xml
 Tue Sep 20 10:39:58 2005
@@ -567,7 +567,22 @@
                        Accounts 
                </statement> 
                <!-- JIRA-110 -->
-                               
+
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+        </insert>
+                                       
                <procedure id="InsertAccountViaStoreProcedure" 
parameterMap="insert-params">
                        prc_InsertAccount
                </procedure>

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Account.xml
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Account.xml?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Account.xml
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Account.xml
 Tue Sep 20 10:39:58 2005
@@ -533,7 +533,22 @@
                        Accounts 
                </statement> 
                <!-- JIRA-110 -->
-               
+
+               <insert id="InsertAccountDynamic" parameterClass="Account">
+                       INSERT INTO Accounts
+                       (Account_ID, Account_FirstName, Account_LastName, 
Account_Email)
+                       VALUES(#Id#, #FirstName#, #LastName#
+                       <dynamic prepend=",">
+                               <isNotNull prepend="," property="EmailAddress">
+                                       #EmailAddress#
+                               </isNotNull>
+                               <isNull prepend="," property="EmailAddress">
+                                               null
+                               </isNull>
+                       </dynamic>
+                       )
+        </insert>
+                       
        </statements>
 
        <!-- =============================================

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/StatementTest.cs
 Tue Sep 20 10:39:58 2005
@@ -876,6 +876,40 @@
                }
 
                /// <summary>
+               /// Test Insert account via public fields
+               /// </summary>
+               public void TestInsertDynamic()
+               {
+                       Account account = new Account();
+
+                       account.Id = 10;
+                       account.FirstName = "Luky";
+                       account.LastName = "luke";
+                       account.EmailAddress = null;
+
+                       sqlMap.Insert("InsertAccountDynamic", account);
+
+                       Account testAccount = 
sqlMap.QueryForObject("GetAccountViaColumnIndex", 10) as Account;
+
+                       Assert.IsNotNull(testAccount);
+                       Assert.AreEqual(10, testAccount.Id);
+                       Assert.AreEqual("[EMAIL PROTECTED]", 
testAccount.EmailAddress);
+
+                       account.Id = 11;
+                       account.FirstName = "Luky";
+                       account.LastName = "luke";
+                       account.EmailAddress = "[EMAIL PROTECTED]";
+
+                       sqlMap.Insert("InsertAccountDynamic", account);
+
+                       testAccount = 
sqlMap.QueryForObject("GetAccountViaColumnIndex", 11) as Account;
+
+                       Assert.IsNotNull(testAccount);
+                       Assert.AreEqual(11, testAccount.Id);
+                       Assert.AreEqual("[EMAIL PROTECTED]", 
testAccount.EmailAddress);
+               }
+
+               /// <summary>
                /// Test Insert account via inline parameters
                /// </summary>
                [Test]

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/SqlMap_PostgreSQL_Npgsql.config
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/SqlMap_PostgreSQL_Npgsql.config?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/SqlMap_PostgreSQL_Npgsql.config
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/SqlMap_PostgreSQL_Npgsql.config
 Tue Sep 20 10:39:58 2005
@@ -14,7 +14,7 @@
        <!-- ==== PostgreSQL configuration =========    -->
        <!-- Rem : If used via a DataAccess context, database tag will be 
ignored -->
        <database>
-               <provider name="PostgreSql0.7"/>
+               <provider name="PostgreSql0.7.1"/>
                <!--
                connectionString=
                Server=127.0.0.1;Port=5432;User 
Id=joe;Password=secret;Database=joedata;

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config
URL: 
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config?rev=290492&r1=290491&r2=290492&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config 
(original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/providers.config 
Tue Sep 20 10:39:58 2005
@@ -190,6 +190,22 @@
        useParameterPrefixInSql="true" 
        useParameterPrefixInParameter="true" 
        parameterPrefix=":"/>
+<provider
+       name="PostgreSql0.7.1" 
+       description="PostgreSql, Npgsql provider V0.7.1.0" 
+       enabled="true" 
+       assemblyName="Npgsql, Version=0.7.1.0, Culture=neutral, 
PublicKeyToken=5d8b90d52f46fda7" 
+       connectionClass="Npgsql.NpgsqlConnection" 
+       commandClass="Npgsql.NpgsqlCommand" 
+       parameterClass="Npgsql.NpgsqlParameter" 
+       parameterDbTypeClass="NpgsqlTypes.NpgsqlDbType" 
+       parameterDbTypeProperty="NpgsqlDbType" 
+       dataAdapterClass="Npgsql.NpgsqlDataAdapter" 
+       commandBuilderClass="Npgsql.NpgsqlCommandBuilder" 
+       usePositionalParameters="false" 
+       useParameterPrefixInSql="true" 
+       useParameterPrefixInParameter="true" 
+       parameterPrefix=":"/>   
 <provider 
        name="iDb2.10" 
        description="IBM DB2 Provider, V 10.0" 


Reply via email to