Author: gbayon
Date: Sun Apr 2 09:24:16 2006
New Revision: 390845
URL: http://svn.apache.org/viewcvs?rev=390845&view=rev
Log:
- Updated test for PostgreSQL
Added:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Simple.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/PostgreSQL/simple-init.sql
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Account.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Category.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Enumeration.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/LineItem.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Order.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Other.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ParameterClass.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Perf/PerformanceTest.cs
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/SqlMap_PostgreSQL_Npgsql.config
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.csproj
Sun Apr 2 09:24:16 2006
@@ -774,6 +774,10 @@
BuildAction = "Content"
/>
<File
+ RelPath = "Maps\PostgreSQL\Npgsql\Simple.xml"
+ BuildAction = "Content"
+ />
+ <File
RelPath = "NUnit\SqlMapTests\BaseTest.cs"
SubType = "Code"
BuildAction = "Compile"
@@ -1226,6 +1230,10 @@
/>
<File
RelPath = "Scripts\PostgreSQL\other-init.sql"
+ BuildAction = "Content"
+ />
+ <File
+ RelPath = "Scripts\PostgreSQL\simple-init.sql"
BuildAction = "Content"
/>
<File
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=390845&r1=390844&r2=390845&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
Sun Apr 2 09:24:16 2006
@@ -54,6 +54,11 @@
<property name="Type" value="Weak"/>
</cacheModel>
+ <cacheModel id="rw-account-cache" implementation="FIFO"
serialize="true" readOnly="false">
+ <flushInterval hours="24"/>
+ <flushOnExecute
statement="UpdateAccountViaInlineParameters"/>
+ </cacheModel>
+
<!--
<cacheModel name="account-cache" implementation="LRU" >
<flushInterval hours="24"/>
@@ -161,6 +166,11 @@
from Accounts
order by Account_ID
</select>
+
+ <select id="GetRWCachedAccountsViaResultMap"
+ resultMap="account-result"
+ cacheModel="rw-account-cache"
extends="GetCachedAccountsViaResultMap">
+ </select>
<select id="GetNoAccountWithCache"
parameterClass="Integer"
@@ -574,12 +584,16 @@
============================================= -->
<parameterMaps>
- <parameterMap id="swap-params">
+ <parameterMap id="swap-params" class="Hashtable">
<parameter property="email1" column="First_Email" />
<parameter property="email2" column="Second_Email" />
</parameterMap>
- <parameterMap id="insert-params">
+ <parameterMap id="select-params" class="Hashtable">
+ <parameter property="Account_ID" />
+ </parameterMap>
+
+ <parameterMap id="insert-params" class="Account">
<parameter property="Id" />
<parameter property="FirstName" />
<parameter property="LastName" />
@@ -588,14 +602,14 @@
<parameter property="CartOption"
column="Account_Cart_Option" typeHandler="HundredsBool"/>
</parameterMap>
- <parameterMap id="update-params">
+ <parameterMap id="update-params" class="Account">
<parameter property="FirstName" />
<parameter property="LastName" />
<parameter property="EmailAddress" nullValue="[EMAIL
PROTECTED]"/>
<parameter property="Id" />
</parameterMap>
- <parameterMap id="update-params2">
+ <parameterMap id="update-params2" class="Account">
<parameter property="Id" />
<parameter property="FirstName" />
<parameter property="LastName" />
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Category.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Category.xml?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Category.xml
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Category.xml
Sun Apr 2 09:24:16 2006
@@ -6,8 +6,25 @@
<typeAlias alias="Category"
type="IBatisNet.DataMapper.Test.Domain.Category, IBatisNet.DataMapper.Test"/>
</alias>
+ <resultMaps>
+ <resultMap id="Category-result" class="Category">
+ <result property="Id" column="Category_ID"/>
+ <result property="Name" column="Category_Name"/>
+ <result property="Guid" column="Category_Guid"
nullValue="00000000-0000-0000-0000-000000000000"/>
+ </resultMap>
+ </resultMaps >
+
<statements>
+ <select id="GetCategoryWithNullValueReplacementGuid"
resultMap="Category-result" >
+ select
+ Category_ID,
+ Category_Name,
+ Category_Guid
+ from Categories
+ where Category_ID = #value#
+ </select>
+
<select id="GetCategory" parameterClass="Integer"
resultClass="Category">
select
Category_ID as Id,
@@ -132,38 +149,33 @@
</statements>
<parameterMaps>
- <parameterMap id="insert-params">
- <parameter property="Id" column="Category_Id"
dbType="Integer" />
- <parameter property="Name" column="Category_Name"/>
- <parameter property="GuidString" column="Category_Guid"
dbType="Text"/>
- </parameterMap>
- <parameterMap id="InsertParam">
+ <parameterMap id="InsertParam" class="Category">
<parameter property="Name" column="Category_Name"/>
<parameter property="GuidString" column="Category_Guid"
dbType="Text"/>
</parameterMap>
- <parameterMap id="insert-null-params">
+ <parameterMap id="insert-null-params" class="Category">
<parameter property="Name" column="Category_Name"/>
<parameter property="GuidString" column="Category_Guid"
nullValue="00000000-0000-0000-0000-000000000000" dbType="Text"/>
</parameterMap>
- <parameterMap id="UpdateParam" extends="InsertParam">
+ <parameterMap id="UpdateParam" extends="InsertParam"
class="Category">
<parameter property="Id" column="Category_Id" />
</parameterMap>
<!-- Used by generated statement -->
- <parameterMap id="insert-generate-params">
+ <parameterMap id="insert-generate-params" class="Category">
<parameter property="Name" column="Category_Name"/>
<parameter property="GuidString" column="Category_Guid"
dbType="Text"/>
</parameterMap>
- <parameterMap id="update-generate-params"
extends="insert-generate-params">
+ <parameterMap id="update-generate-params"
extends="insert-generate-params" class="Category">
<parameter property="Id" column="Category_Id" />
</parameterMap>
- <parameterMap id="delete-generate-params">
+ <parameterMap id="delete-generate-params" class="Category">
<parameter property="Id" column="Category_Id" />
<parameter property="Name" column="Category_Name"/>
</parameterMap>
@@ -173,7 +185,7 @@
<parameter property="Id" column="Category_Id" />
</parameterMap>
-->
- <parameterMap id="select-generate-params">
+ <parameterMap id="select-generate-params" class="Category">
<parameter property="Id" column="Category_Id" />
<parameter property="Name" column="Category_Name"/>
<parameter property="GuidString" column="Category_Guid"
dbType="Text"/>
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Enumeration.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Enumeration.xml?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Enumeration.xml
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Enumeration.xml
Sun Apr 2 09:24:16 2006
@@ -49,7 +49,7 @@
</statements>
<parameterMaps>
- <parameterMap id="insert-params">
+ <parameterMap id="insert-params" class="Enumeration">
<parameter property="Id" column="Enum_ID" />
<parameter property="Day" column="Enum_Day"/>
<parameter property="Color" column="Enum_Color" />
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/LineItem.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/LineItem.xml?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/LineItem.xml
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/LineItem.xml
Sun Apr 2 09:24:16 2006
@@ -178,7 +178,7 @@
<parameterMaps>
- <parameterMap id="insert-params">
+ <parameterMap id="insert-params" class="LineItem">
<parameter property="Id" />
<parameter property="Order.Id" />
<parameter property="Code" />
@@ -186,7 +186,7 @@
<parameter property="Price" dbType="Numeric"
nullValue="-99.99"/>
</parameterMap>
- <parameterMap id="insert-params-picture">
+ <parameterMap id="insert-params-picture" class="LineItem">
<parameter property="Id" />
<parameter property="Order.Id" />
<parameter property="Code" />
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=390845&r1=390844&r2=390845&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
Sun Apr 2 09:24:16 2006
@@ -438,7 +438,7 @@
<parameterMaps>
- <parameterMap id="insert-params">
+ <parameterMap id="insert-params" class="Order">
<parameter property="Id" dbType="Integer"/>
<parameter property="Account.Id"/>
<parameter property="Date" nullValue="01-01-0001
00:00:00" /><!-- ISO format "YYYY-MM-DD HH:MM:SS" -->
@@ -451,7 +451,7 @@
<parameter property="PostalCode" />
</parameterMap>
- <parameterMap id="params-parent"> <!-- 1043181 support request
-->
+ <parameterMap id="params-parent" class="Order"> <!-- 1043181
support request -->
<parameter property="Id" dbType="Integer"/>
<parameter property="Account.Id"/>
<parameter property="Date" nullValue="01/01/0001
00:00:00" />
@@ -464,7 +464,7 @@
<parameter property="PostalCode" />
</parameterMap>
- <parameterMap id="insert-extend" extends="params-parent">
+ <parameterMap id="insert-extend" extends="params-parent"
class="Order">
</parameterMap>
</parameterMaps>
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Other.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Other.xml?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Other.xml
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Other.xml
Sun Apr 2 09:24:16 2006
@@ -156,7 +156,7 @@
</statements>
<parameterMaps>
- <parameterMap id="insert-params">
+ <parameterMap id="insert-params" class="Other">
<parameter property="Int" />
<parameter property="Long" />
<parameter property="Bool" />
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ParameterClass.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ParameterClass.xml?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ParameterClass.xml
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ParameterClass.xml
Sun Apr 2 09:24:16 2006
@@ -2,7 +2,7 @@
<sqlMap namespace="ParameterClass" xmlns="http://ibatis.apache.org/mapping"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://ibatis.apache.org
http://ibatis.apache.org/xsd/SqlMap.xsd">
<statements>
<select id="GetCountOfAccountsWithNullEmail">
- SELECT COUNT(*) FROM Accounts WHERE Account_Email IS
NULL
+ SELECT CAST(COUNT(*) as int) FROM Accounts WHERE
Account_Email IS NULL
</select>
<update id="UpdateNullEmailToDBNull" parameterClass="Hashtable">
UPDATE Accounts SET
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml
Sun Apr 2 09:24:16 2006
@@ -105,7 +105,7 @@
<statement id="GetSingle"
parameterClass="Int"
resultClass="float" >
- select CAST(92233.5as float4) from Orders where
Order_ID = #value#
+ select CAST(92233.5 as float4) from Orders where
Order_ID = #value#
</statement>
<statement id="GetSingleWithoutResultClass"
parameterClass="Int"
Added:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Simple.xml
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Simple.xml?rev=390845&view=auto
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Simple.xml
(added)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Simple.xml
Sun Apr 2 09:24:16 2006
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Simple"
+xmlns="http://ibatis.apache.org/mapping"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+<alias>
+ <typeAlias alias="Simple" type="IBatisNet.DataMapper.Test.Domain.Simple,
IBatisNet.DataMapper.Test"/>
+</alias>
+
+<statements>
+
+ <update id="UpdateSimple" parameterClass="Simple" >
+ update Simples
+ set
+ name = #Name#,
+ address = #Address#,
+ count = #Count#,
+ date = #Date#,
+ pay = #Pay#
+ where
+ id = #Id#
+ </update>
+
+
+ <delete id="DeleteSimple" parameterClass="int">
+ delete from Simples
+ where
+ id = #value#
+ </delete>
+
+ <insert id="InsertSimple" parameterClass="Simple" >
+ insert into Simples ( name, address, count, date, pay, id )
+ values
+ (#Name#, #Address#, #Count#, #Date#, #Pay#, #Id#)
+ </insert>
+
+</statements>
+</sqlMap>
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Perf/PerformanceTest.cs
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Perf/PerformanceTest.cs?rev=390845&r1=390844&r2=390845&view=diff
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Perf/PerformanceTest.cs
(original)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Perf/PerformanceTest.cs
Sun Apr 2 09:24:16 2006
@@ -14,10 +14,29 @@
namespace IBatisNet.DataMapper.Test.NUnit.SqlMapTests.Perf
{
[TestFixture]
- [Category("MSSQL")]
[Category("Performance")]
public class PerformanceTest : BaseTest
{
+
+ #region SetUp & TearDown
+
+ /// <summary>
+ /// SetUp
+ /// </summary>
+ [SetUp]
+ public void Init()
+ {
+ InitScript( sqlMap.DataSource, ScriptDirectory +
"simple-init.sql" );
+ }
+
+ /// <summary>
+ /// TearDown
+ /// </summary>
+ [TearDown]
+ public void Dispose()
+ { /* ... */ }
+
+ #endregion
#region DataMapper
[Test]
Added:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/PostgreSQL/simple-init.sql
URL:
http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/PostgreSQL/simple-init.sql?rev=390845&view=auto
==============================================================================
---
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/PostgreSQL/simple-init.sql
(added)
+++
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Scripts/PostgreSQL/simple-init.sql
Sun Apr 2 09:24:16 2006
@@ -0,0 +1,13 @@
+drop table Simples;
+
+create table Simples
+(
+ ID int4 not null,
+ Name varchar(64) NULL,
+ Address varchar(64) NULL,
+ Count int4 NULL,
+ Date timestamp NULL,
+ Pay numeric(18,2) NULL,
+ CONSTRAINT PK_Simples PRIMARY KEY (ID)
+) WITHOUT OIDS;
+ALTER TABLE Simples OWNER TO "IBatisNet";
\ No newline at end of file
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=390845&r1=390844&r2=390845&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
Sun Apr 2 09:24:16 2006
@@ -9,6 +9,7 @@
<settings>
<setting useStatementNamespaces="false"/>
<setting cacheModelsEnabled="true"/>
+ <setting useReflectionOptimizer="true"/>
</settings>
<!-- ==== PostgreSQL configuration ========= -->
@@ -44,6 +45,8 @@
<sqlMap
resource="../../Maps/PostgreSQL/Npgsql/ParameterClass.xml"/>
<sqlMap
resource="../../Maps/PostgreSQL/Npgsql/ResultClass.xml"/>
<sqlMap resource="../../Maps/PostgreSQL/Npgsql/Document.xml"/>
+ <sqlMap resource="../../Maps/PostgreSQL/Npgsql/Nullable.xml"/>
+ <sqlMap resource="../../Maps/PostgreSQL/Npgsql/Simple.xml"/>
<!-- Rem : If used as embbeded Resources, use
<sqlMap embedded="Account.xml, IBatisNet.DataMapper.Test"/>
-->