You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ibatis.apache.org by gb...@apache.org on 2006/02/28 20:01:55 UTC
svn commit: r381744 - in /ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test:
./ 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/PostgreSQL/N...
Author: gbayon
Date: Tue Feb 28 11:01:52 2006
New Revision: 381744
URL: http://svn.apache.org/viewcvs?rev=381744&view=rev
Log:
- Added some unit tests for nullable support in .NET V2
Added:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Nullable.xml
Modified:
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/IBatisNet.DataMapper.Test.2005.csproj
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Nullable.xml
ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/NullableTest.cs
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=381744&r1=381743&r2=381744&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 Tue Feb 28 11:01:52 2006
@@ -283,6 +283,7 @@
<Content Include="Maps\Access\OleDb\DynamicAccount.xml" />
<Content Include="Maps\Access\OleDb\Enumeration.xml" />
<Content Include="Maps\Access\OleDb\LineItem.xml" />
+ <Content Include="Maps\Access\OleDb\Nullable.xml" />
<Content Include="Maps\Access\OleDb\Order.xml" />
<Content Include="Maps\Access\OleDb\Other.xml" />
<Content Include="Maps\Access\OleDb\ParameterClass.xml" />
@@ -330,6 +331,7 @@
<Content Include="Maps\MySql\ByteFx\DynamicAccount.xml" />
<Content Include="Maps\MySql\ByteFx\Enumeration.xml" />
<Content Include="Maps\MySql\ByteFx\LineItem.xml" />
+ <Content Include="Maps\MySql\ByteFx\Nullable.xml" />
<Content Include="Maps\MySql\ByteFx\Order.xml" />
<Content Include="Maps\MySql\ByteFx\Other.xml" />
<Content Include="Maps\MySql\ByteFx\ParameterClass.xml" />
@@ -341,6 +343,7 @@
<Content Include="Maps\MySql\MySql\DynamicAccount.xml" />
<Content Include="Maps\MySql\MySql\Enumeration.xml" />
<Content Include="Maps\MySql\MySql\LineItem.xml" />
+ <Content Include="Maps\MySql\MySql\Nullable.xml" />
<Content Include="Maps\MySql\MySql\Order.xml" />
<Content Include="Maps\MySql\MySql\Other.xml" />
<Content Include="Maps\MySql\MySql\ParameterClass.xml" />
@@ -352,6 +355,7 @@
<Content Include="Maps\Oracle\ODP\DynamicAccount.xml" />
<Content Include="Maps\Oracle\ODP\Enumeration.xml" />
<Content Include="Maps\Oracle\ODP\LineItem.xml" />
+ <Content Include="Maps\Oracle\ODP\Nullable.xml" />
<Content Include="Maps\Oracle\ODP\Order.xml" />
<Content Include="Maps\Oracle\ODP\Other.xml" />
<Content Include="Maps\Oracle\ODP\ParameterClass.xml" />
@@ -363,6 +367,7 @@
<Content Include="Maps\Oracle\OracleClient\DynamicAccount.xml" />
<Content Include="Maps\Oracle\OracleClient\Enumeration.xml" />
<Content Include="Maps\Oracle\OracleClient\LineItem.xml" />
+ <Content Include="Maps\Oracle\OracleClient\Nullable.xml" />
<Content Include="Maps\Oracle\OracleClient\Order.xml" />
<Content Include="Maps\Oracle\OracleClient\Other.xml" />
<Content Include="Maps\Oracle\OracleClient\ParameterClass.xml" />
@@ -374,6 +379,7 @@
<Content Include="Maps\PostgreSQL\Npgsql\DynamicAccount.xml" />
<Content Include="Maps\PostgreSQL\Npgsql\Enumeration.xml" />
<Content Include="Maps\PostgreSQL\Npgsql\LineItem.xml" />
+ <Content Include="Maps\PostgreSQL\Npgsql\Nullable.xml" />
<Content Include="Maps\PostgreSQL\Npgsql\Order.xml" />
<Content Include="Maps\PostgreSQL\Npgsql\Other.xml" />
<Content Include="Maps\PostgreSQL\Npgsql\ParameterClass.xml" />
Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Nullable.xml?rev=381744&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Nullable.xml (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Nullable"
+xmlns="http://ibatis.apache.org/mapping"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Nullable" type="IBatisNet.DataMapper.Test.Domain.NullableClass, IBatisNet.DataMapper.Test"/>
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Nullable-result" class="Nullable">
+ <result property="Id" column="Id"/>
+ <result property="TestBool" column="TestBool" />
+ <result property="TestByte" column="TestByte" />
+ <result property="TestChar" column="TestChar" />
+ <result property="TestDateTime" column="TestDateTime" />
+ <result property="TestDecimal" column="TestDecimal" />
+ <result property="TestDouble" column="TestDouble" />
+ <result property="TestGuid" column="TestGuid"/>
+ <result property="TestInt16" column="TestInt16"/>
+ <result property="TestInt32" column="TestInt32"/>
+ <result property="TestInt64" column="TestInt64"/>
+ <result property="TestSingle" column="TestSingle" />
+ </resultMap>
+ </resultMaps >
+
+ <statements>
+
+ <select id="GetNullable" resultMap="Nullable-result" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+ <insert id="InsertNullable" parameterClass="Nullable" >
+ <selectKey property="Id" type="post" resultClass="int">
+ select SCOPE_IDENTITY() as value
+ </selectKey>
+ insert into Nullable
+ (TestBool, TestByte, TestChar, TestDateTime, TestDecimal, TestDouble, TestGuid, TestInt16, TestInt32, TestInt64, TestSingle)
+ values
+ (#TestBool#, #TestByte#, #TestChar#, #TestDateTime#, #TestDecimal#, #TestDouble#, #TestGuid#, #TestInt16#, #TestInt32#, #TestInt64#, #TestSingle#)
+ </insert>
+
+ </statements>
+</sqlMap>
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Nullable.xml?rev=381744&r1=381743&r2=381744&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Nullable.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -33,6 +33,12 @@
where Id = #value#
</select>
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
<insert id="InsertNullable" parameterClass="Nullable" >
<selectKey property="Id" type="post" resultClass="int">
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Nullable.xml?rev=381744&r1=381743&r2=381744&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Nullable.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -33,7 +33,13 @@
where Id = #value#
</select>
-
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
<insert id="InsertNullable" parameterClass="Nullable" >
<selectKey property="Id" type="post" resultClass="int">
select SCOPE_IDENTITY() as value
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Nullable.xml?rev=381744&r1=381743&r2=381744&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Nullable.xml (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -34,6 +34,13 @@
</select>
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
<insert id="InsertNullable" parameterClass="Nullable" >
<selectKey property="Id" type="post" resultClass="int">
select SCOPE_IDENTITY() as value
Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Nullable.xml?rev=381744&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Nullable.xml (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Nullable"
+xmlns="http://ibatis.apache.org/mapping"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Nullable" type="IBatisNet.DataMapper.Test.Domain.NullableClass, IBatisNet.DataMapper.Test"/>
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Nullable-result" class="Nullable">
+ <result property="Id" column="Id"/>
+ <result property="TestBool" column="TestBool" />
+ <result property="TestByte" column="TestByte" />
+ <result property="TestChar" column="TestChar" />
+ <result property="TestDateTime" column="TestDateTime" />
+ <result property="TestDecimal" column="TestDecimal" />
+ <result property="TestDouble" column="TestDouble" />
+ <result property="TestGuid" column="TestGuid"/>
+ <result property="TestInt16" column="TestInt16"/>
+ <result property="TestInt32" column="TestInt32"/>
+ <result property="TestInt64" column="TestInt64"/>
+ <result property="TestSingle" column="TestSingle" />
+ </resultMap>
+ </resultMaps >
+
+ <statements>
+
+ <select id="GetNullable" resultMap="Nullable-result" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+ <insert id="InsertNullable" parameterClass="Nullable" >
+ <selectKey property="Id" type="post" resultClass="int">
+ select SCOPE_IDENTITY() as value
+ </selectKey>
+ insert into Nullable
+ (TestBool, TestByte, TestChar, TestDateTime, TestDecimal, TestDouble, TestGuid, TestInt16, TestInt32, TestInt64, TestSingle)
+ values
+ (#TestBool#, #TestByte#, #TestChar#, #TestDateTime#, #TestDecimal#, #TestDouble#, #TestGuid#, #TestInt16#, #TestInt32#, #TestInt64#, #TestSingle#)
+ </insert>
+
+ </statements>
+</sqlMap>
Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Nullable.xml?rev=381744&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Nullable.xml (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Nullable"
+xmlns="http://ibatis.apache.org/mapping"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Nullable" type="IBatisNet.DataMapper.Test.Domain.NullableClass, IBatisNet.DataMapper.Test"/>
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Nullable-result" class="Nullable">
+ <result property="Id" column="Id"/>
+ <result property="TestBool" column="TestBool" />
+ <result property="TestByte" column="TestByte" />
+ <result property="TestChar" column="TestChar" />
+ <result property="TestDateTime" column="TestDateTime" />
+ <result property="TestDecimal" column="TestDecimal" />
+ <result property="TestDouble" column="TestDouble" />
+ <result property="TestGuid" column="TestGuid"/>
+ <result property="TestInt16" column="TestInt16"/>
+ <result property="TestInt32" column="TestInt32"/>
+ <result property="TestInt64" column="TestInt64"/>
+ <result property="TestSingle" column="TestSingle" />
+ </resultMap>
+ </resultMaps >
+
+ <statements>
+
+ <select id="GetNullable" resultMap="Nullable-result" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+ <insert id="InsertNullable" parameterClass="Nullable" >
+ <selectKey property="Id" type="post" resultClass="int">
+ select SCOPE_IDENTITY() as value
+ </selectKey>
+ insert into Nullable
+ (TestBool, TestByte, TestChar, TestDateTime, TestDecimal, TestDouble, TestGuid, TestInt16, TestInt32, TestInt64, TestSingle)
+ values
+ (#TestBool#, #TestByte#, #TestChar#, #TestDateTime#, #TestDecimal#, #TestDouble#, #TestGuid#, #TestInt16#, #TestInt32#, #TestInt64#, #TestSingle#)
+ </insert>
+
+ </statements>
+</sqlMap>
Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Nullable.xml?rev=381744&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Nullable.xml (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Nullable"
+xmlns="http://ibatis.apache.org/mapping"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Nullable" type="IBatisNet.DataMapper.Test.Domain.NullableClass, IBatisNet.DataMapper.Test"/>
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Nullable-result" class="Nullable">
+ <result property="Id" column="Id"/>
+ <result property="TestBool" column="TestBool" />
+ <result property="TestByte" column="TestByte" />
+ <result property="TestChar" column="TestChar" />
+ <result property="TestDateTime" column="TestDateTime" />
+ <result property="TestDecimal" column="TestDecimal" />
+ <result property="TestDouble" column="TestDouble" />
+ <result property="TestGuid" column="TestGuid"/>
+ <result property="TestInt16" column="TestInt16"/>
+ <result property="TestInt32" column="TestInt32"/>
+ <result property="TestInt64" column="TestInt64"/>
+ <result property="TestSingle" column="TestSingle" />
+ </resultMap>
+ </resultMaps >
+
+ <statements>
+
+ <select id="GetNullable" resultMap="Nullable-result" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+ <insert id="InsertNullable" parameterClass="Nullable" >
+ <selectKey property="Id" type="post" resultClass="int">
+ select SCOPE_IDENTITY() as value
+ </selectKey>
+ insert into Nullable
+ (TestBool, TestByte, TestChar, TestDateTime, TestDecimal, TestDouble, TestGuid, TestInt16, TestInt32, TestInt64, TestSingle)
+ values
+ (#TestBool#, #TestByte#, #TestChar#, #TestDateTime#, #TestDecimal#, #TestDouble#, #TestGuid#, #TestInt16#, #TestInt32#, #TestInt64#, #TestSingle#)
+ </insert>
+
+ </statements>
+</sqlMap>
Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Nullable.xml?rev=381744&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Nullable.xml (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Nullable"
+xmlns="http://ibatis.apache.org/mapping"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Nullable" type="IBatisNet.DataMapper.Test.Domain.NullableClass, IBatisNet.DataMapper.Test"/>
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Nullable-result" class="Nullable">
+ <result property="Id" column="Id"/>
+ <result property="TestBool" column="TestBool" />
+ <result property="TestByte" column="TestByte" />
+ <result property="TestChar" column="TestChar" />
+ <result property="TestDateTime" column="TestDateTime" />
+ <result property="TestDecimal" column="TestDecimal" />
+ <result property="TestDouble" column="TestDouble" />
+ <result property="TestGuid" column="TestGuid"/>
+ <result property="TestInt16" column="TestInt16"/>
+ <result property="TestInt32" column="TestInt32"/>
+ <result property="TestInt64" column="TestInt64"/>
+ <result property="TestSingle" column="TestSingle" />
+ </resultMap>
+ </resultMaps >
+
+ <statements>
+
+ <select id="GetNullable" resultMap="Nullable-result" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+ <insert id="InsertNullable" parameterClass="Nullable" >
+ <selectKey property="Id" type="post" resultClass="int">
+ select SCOPE_IDENTITY() as value
+ </selectKey>
+ insert into Nullable
+ (TestBool, TestByte, TestChar, TestDateTime, TestDecimal, TestDouble, TestGuid, TestInt16, TestInt32, TestInt64, TestSingle)
+ values
+ (#TestBool#, #TestByte#, #TestChar#, #TestDateTime#, #TestDecimal#, #TestDouble#, #TestGuid#, #TestInt16#, #TestInt32#, #TestInt64#, #TestSingle#)
+ </insert>
+
+ </statements>
+</sqlMap>
Added: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Nullable.xml
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Nullable.xml?rev=381744&view=auto
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Nullable.xml (added)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/Nullable.xml Tue Feb 28 11:01:52 2006
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<sqlMap namespace="Nullable"
+xmlns="http://ibatis.apache.org/mapping"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+
+ <alias>
+ <typeAlias alias="Nullable" type="IBatisNet.DataMapper.Test.Domain.NullableClass, IBatisNet.DataMapper.Test"/>
+ </alias>
+
+ <resultMaps>
+ <resultMap id="Nullable-result" class="Nullable">
+ <result property="Id" column="Id"/>
+ <result property="TestBool" column="TestBool" />
+ <result property="TestByte" column="TestByte" />
+ <result property="TestChar" column="TestChar" />
+ <result property="TestDateTime" column="TestDateTime" />
+ <result property="TestDecimal" column="TestDecimal" />
+ <result property="TestDouble" column="TestDouble" />
+ <result property="TestGuid" column="TestGuid"/>
+ <result property="TestInt16" column="TestInt16"/>
+ <result property="TestInt32" column="TestInt32"/>
+ <result property="TestInt64" column="TestInt64"/>
+ <result property="TestSingle" column="TestSingle" />
+ </resultMap>
+ </resultMaps >
+
+ <statements>
+
+ <select id="GetNullable" resultMap="Nullable-result" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+
+ <select id="GetClassNullable" resultClass="Nullable" >
+ select
+ *
+ from Nullable
+ where Id = #value#
+ </select>
+
+ <insert id="InsertNullable" parameterClass="Nullable" >
+ <selectKey property="Id" type="post" resultClass="int">
+ select SCOPE_IDENTITY() as value
+ </selectKey>
+ insert into Nullable
+ (TestBool, TestByte, TestChar, TestDateTime, TestDecimal, TestDouble, TestGuid, TestInt16, TestInt32, TestInt64, TestSingle)
+ values
+ (#TestBool#, #TestByte#, #TestChar#, #TestDateTime#, #TestDecimal#, #TestDouble#, #TestGuid#, #TestInt16#, #TestInt32#, #TestInt64#, #TestSingle#)
+ </insert>
+
+ </statements>
+</sqlMap>
Modified: ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/NullableTest.cs
URL: http://svn.apache.org/viewcvs/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/NullableTest.cs?rev=381744&r1=381743&r2=381744&view=diff
==============================================================================
--- ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/NullableTest.cs (original)
+++ ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/NUnit/SqlMapTests/Generics/NullableTest.cs Tue Feb 28 11:01:52 2006
@@ -33,8 +33,77 @@
#endregion
+ #region NullableClass
+ /// <summary>
+ /// Test a NullableClass resultClass
+ /// </summary>
+ [Test]
+ public void TestNullableViaResultClass()
+ {
+ NullableClass clazz = new NullableClass();
+
+ sqlMap.Insert("InsertNullable", clazz);
+ clazz = null;
+ clazz = sqlMap.QueryForObject<NullableClass>("GetClassNullable", 1);
+
+ Assert.IsNotNull(clazz);
+ Assert.AreEqual(1, clazz.Id);
+ Assert.IsNull(clazz.TestBool);
+ Assert.IsNull(clazz.TestByte);
+ Assert.IsNull(clazz.TestChar);
+ Assert.IsNull(clazz.TestDateTime);
+ Assert.IsNull(clazz.TestDecimal);
+ Assert.IsNull(clazz.TestDouble);
+ Assert.IsNull(clazz.TestGuid);
+ Assert.IsNull(clazz.TestInt16);
+ Assert.IsNull(clazz.TestInt32);
+ Assert.IsNull(clazz.TestInt64);
+ Assert.IsNull(clazz.TestSingle);
+ }
+
+ /// <summary>
+ /// Test a NullableClass resultClass
+ /// </summary>
+ [Test]
+ public void TestNullableViaResultClass2()
+ {
+ NullableClass clazz = new NullableClass();
+ clazz.TestBool = true;
+ clazz.TestByte = 155;
+ clazz.TestChar = 'a';
+ DateTime? date = new DateTime?(DateTime.Now);
+ clazz.TestDateTime = date;
+ clazz.TestDecimal = 99.53M;
+ clazz.TestDouble = 99.5125;
+ Guid? guid = new Guid?(Guid.NewGuid());
+ clazz.TestGuid = guid;
+ clazz.TestInt16 = 45;
+ clazz.TestInt32 = 99;
+ clazz.TestInt64 = 1234567890123456789;
+ clazz.TestSingle = 4578.46445454112f;
+
+ sqlMap.Insert("InsertNullable", clazz);
+ clazz = null;
+ clazz = sqlMap.QueryForObject<NullableClass>("GetClassNullable", 1);
+
+ Assert.IsNotNull(clazz);
+ Assert.AreEqual(1, clazz.Id);
+ Assert.IsTrue(clazz.TestBool.Value);
+ Assert.AreEqual(155, clazz.TestByte);
+ Assert.AreEqual('a', clazz.TestChar);
+ Assert.AreEqual(date.Value.ToString(), clazz.TestDateTime.Value.ToString());
+ Assert.AreEqual(99.53M, clazz.TestDecimal);
+ Assert.AreEqual(99.5125, clazz.TestDouble);
+ Assert.AreEqual(guid, clazz.TestGuid);
+ Assert.AreEqual(45, clazz.TestInt16);
+ Assert.AreEqual(99, clazz.TestInt32);
+ Assert.AreEqual(1234567890123456789, clazz.TestInt64);
+ Assert.AreEqual(4578.46445454112f, clazz.TestSingle);
+ }
+ #endregion
#region bool
+
/// <summary>
/// Test nullable bool
/// </summary>