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 2005/05/18 22:47:02 UTC

svn commit: r170826 - /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers

Author: gbayon
Date: Wed May 18 13:47:00 2005
New Revision: 170826

URL: http://svn.apache.org/viewcvs?rev=170826&view=rev
Log:
- Fixed IBATISNET-66 
- Refactor ITypeHandler interface to correct IBATISNET-66 
- Refactor and ITypeHandlerCallback to follow Java API
- Refactor process to apply ParameterMap and ResutMap to correct IBATISNET-66

Modified:
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/CustomInheritance.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/GuidStringTypeHandlerCallback.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/HundredsTypeHandlerCallback.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OneZeroBoolTypeHandlerCallback.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OuiNonBoolTypeHandlerCallback.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/DefaultPreparedCommand.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/EmbedParamsPreparedCommand.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/InlineParameterMapParser.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/ParameterMap.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BaseTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BooleanTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CharTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CustomTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DateTimeTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DecimalTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DoubleTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/EnumTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/GuidTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandlerCallback.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int16TypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int32TypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int64TypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ObjectTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/SingleTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/StringTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TimeSpanTypeHandler.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs
    incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/UnknownTypeHandler.cs

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/CustomInheritance.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/CustomInheritance.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/CustomInheritance.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/CustomInheritance.cs Wed May 18 13:47:00 2005
@@ -12,7 +12,7 @@
 
 		#region ITypeHandlerCallback members
 
-		public object GetNullValue(string nullValue)
+		public object ValueOf(string nullValue)
 		{
 			throw new NotImplementedException();
 		}

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/GuidStringTypeHandlerCallback.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/GuidStringTypeHandlerCallback.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/GuidStringTypeHandlerCallback.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/GuidStringTypeHandlerCallback.cs Wed May 18 13:47:00 2005
@@ -13,7 +13,7 @@
 
 		#region ITypeHandlerCallback members
 
-		public object GetNullValue(string nullValue)
+		public object ValueOf(string nullValue)
 		{
 			if (GUIDNULL.Equals(nullValue)) 
 			{

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/HundredsTypeHandlerCallback.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/HundredsTypeHandlerCallback.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/HundredsTypeHandlerCallback.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/HundredsTypeHandlerCallback.cs Wed May 18 13:47:00 2005
@@ -12,7 +12,7 @@
 
 		#region ITypeHandlerCallback
 
-		public object GetNullValue(string nullValue)
+		public object ValueOf(string nullValue)
 		{
 			if ("100".Equals(nullValue)) 
 			{

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OneZeroBoolTypeHandlerCallback.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OneZeroBoolTypeHandlerCallback.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OneZeroBoolTypeHandlerCallback.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OneZeroBoolTypeHandlerCallback.cs Wed May 18 13:47:00 2005
@@ -14,7 +14,7 @@
 
 		#region ITypeHandlerCallback members
 
-		public object GetNullValue(string nullValue)
+		public object ValueOf(string nullValue)
 		{
 			if (TRUE.ToString().Equals(nullValue)) 
 			{

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OuiNonBoolTypeHandlerCallback.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OuiNonBoolTypeHandlerCallback.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OuiNonBoolTypeHandlerCallback.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain/OuiNonBoolTypeHandlerCallback.cs Wed May 18 13:47:00 2005
@@ -18,7 +18,7 @@
 
 		#region ITypeHandlerCallback members
 
-		public object GetNullValue(string nullValue)
+		public object ValueOf(string nullValue)
 		{
 			if (YES.Equals(nullValue)) 
 			{

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb/ResultClass.xml Wed May 18 13:47:00 2005
@@ -11,7 +11,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select CBool('True') from Orders where Order_ID = #value#
+			select CBool('True') from Orders where Order_ID = #dummy#
 		</statement>	
 
 		<!--

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/ResultClass.xml Wed May 18 13:47:00 2005
@@ -7,7 +7,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select cast(1 as bit) from Orders where Order_ID = #value#
+			select cast(1 as bit) from Orders where Order_ID = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/ResultClass.xml Wed May 18 13:47:00 2005
@@ -7,7 +7,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select cast(1 as bit) from Orders where Order_ID = #value#
+			select cast(1 as bit) from Orders where Order_ID = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/ResultClass.xml Wed May 18 13:47:00 2005
@@ -7,7 +7,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select cast(1 as bit) from Orders where Order_ID = #value#
+			select cast(1 as bit) from Orders where Order_ID = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/ByteFx/ResultClass.xml Wed May 18 13:47:00 2005
@@ -7,7 +7,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select 1 from Orders where Order_ID = #value#
+			select 1 from Orders where Order_ID = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MySql/MySql/ResultClass.xml Wed May 18 13:47:00 2005
@@ -7,7 +7,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select 1 from Orders where Order_ID = #value#
+			select 1 from Orders where Order_ID = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/ODP/ResultClass.xml Wed May 18 13:47:00 2005
@@ -8,7 +8,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select 1 from dual where 1 = #value#
+			select 1 from dual where 1 = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Oracle/OracleClient/ResultClass.xml Wed May 18 13:47:00 2005
@@ -7,7 +7,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select 1 from dual where 1 = #value#
+			select 1 from dual where 1 = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/PostgreSQL/Npgsql/ResultClass.xml Wed May 18 13:47:00 2005
@@ -7,7 +7,7 @@
 		<statement id="GetBoolean"
 					parameterClass="Int"
 					resultClass="bool" >
-			select 1 from Orders where Order_ID = #value#
+			select 1 from Orders where Order_ID = #dummy#
 		</statement>	
 
 		<statement id="GetByte"

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/bin/Debug/IBatisNet.DataMapper.Test.dll.config Wed May 18 13:47:00 2005
@@ -13,7 +13,7 @@
 		<!-- To test Access set value="Access" -->		
 		<!-- To test MS Sql Server set value="MSSQL"  -->	
 		<!-- To test PostgreSQL set value="PostgreSQL"  -->	
-		<add key="database" value="PostgreSQL"/>
+		<add key="database" value="MSSQL"/>
 		<!-- To test MS SqlServer via SqlClient value="SqlClient"  -->
 		<!-- To test Oracle via MS Oracle provider value="OracleClient"  -->
 		<!-- To test Oracle via Oracle provider value="ODP"  -->
@@ -22,7 +22,7 @@
 		<!-- To test MySql via MySql provider value="MySql"  -->
 		<!-- To test via OleDb provider (any database) value="OleDb"  -->
 		<!-- To test via Odbc provider (any database) value="Odbc"  -->
-		<add key="providerType" value="Npgsql"/>
+		<add key="providerType" value="SqlClient"/>
 	</appSettings>
 	
 	<!-- This section contains the log4net configuration settings -->

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/DefaultPreparedCommand.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/DefaultPreparedCommand.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/DefaultPreparedCommand.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/DefaultPreparedCommand.cs Wed May 18 13:47:00 2005
@@ -100,8 +100,6 @@
 			StringBuilder paramLogList = new StringBuilder(); // Log info
 			StringBuilder typeLogList = new StringBuilder(); // Log info
 
-			object parameterValue = null;
-
 			for ( int i = 0; i < properties.Count; ++i )
 			{
 				IDataParameter sqlParameter = (IDataParameter)parameters[i];
@@ -119,40 +117,7 @@
 				}
 				#endregion
 
-				if (command.CommandType == CommandType.Text)
-				{
-
-					#region text command
-
-					if ( propertyName != "value" ) // Inline Parameters && Parameters via ParameterMap
-					{
-
-						parameterValue = request.ParameterMap.GetValueOfProperty(parameterObject,
-							property.PropertyName);
-
-						#region Logging
-						if (_logger.IsDebugEnabled)
-						{
-							paramLogList.Append( property.PropertyName );
-							paramLogList.Append( "," );
-						}
-						#endregion 
-					}
-					else // 'value' parameter
-					{
-						parameterValue = parameterObject;
-
-						#region Logging
-						if (_logger.IsDebugEnabled)
-						{
-							paramLogList.Append( "'value'" );
-							paramLogList.Append( "," );
-						}
-						#endregion 
-					}
-					#endregion 
-				}
-				else // CommandType.StoredProcedure
+				if (command.CommandType == CommandType.StoredProcedure)
 				{
 					#region store procedure command
 
@@ -164,8 +129,6 @@
 					}
 					else // Parameters via ParameterMap
 					{
-//						ParameterProperty property = request.ParameterMap.GetProperty(i);
-
 						if (property.DirectionAttribute.Length == 0)
 						{
 							property.Direction = sqlParameter.Direction;
@@ -176,23 +139,23 @@
 						// property.Scale = dataParameter.Scale;
 						// property.Size = dataParameter.Size;
 
-						sqlParameter.Direction = property.Direction;
-						parameterValue = request.ParameterMap.GetValueOfProperty( parameterObject, property.PropertyName );
-					
-						#region Logging
-						if (_logger.IsDebugEnabled)
-						{
-							paramLogList.Append( property.PropertyName );
-							paramLogList.Append( "," );
-						}
-						#endregion 					
+						sqlParameter.Direction = property.Direction;					
 					}
 					#endregion 
 				}
 
-				// Fix JIRA 20
-				//parameterCopy.Value = parameterValue;
-				property.TypeHandler.SetParameter(property, parameterCopy, parameterValue, property.DbType);
+				#region Logging
+				if (_logger.IsDebugEnabled)
+				{
+					paramLogList.Append( property.PropertyName );
+					paramLogList.Append( "," );
+				}
+				#endregion 					
+
+				request.ParameterMap.SetParameter(property, parameterCopy, parameterObject );
+
+//				// Fix JIRA 20
+//				property.TypeHandler.SetParameter(property, parameterCopy, parameterValue, property.DbType);
 
 				parameterCopy.Direction = sqlParameter.Direction;
 
@@ -220,7 +183,7 @@
 				#region Logging
 				if (_logger.IsDebugEnabled)
 				{
-					if (parameterValue == null) 
+					if (parameterCopy.Value == System.DBNull.Value) 
 					{
 						paramLogList.Append("null");
 						paramLogList.Append( "], " );
@@ -230,7 +193,7 @@
 					else 
 					{ 
 
-						paramLogList.Append( parameterValue.ToString() );
+						paramLogList.Append( parameterCopy.Value.ToString() );
 						paramLogList.Append( "], " );
 
 						// sqlParameter.DbType could be null (as with Npgsql)
@@ -241,7 +204,7 @@
 						//typeLogList.Append( sqlParameter.DbType.ToString() );
 						typeLogList.Append( parameterCopy.DbType.ToString() );
 						typeLogList.Append( ", " );
-						typeLogList.Append( parameterValue.GetType().ToString() );
+						typeLogList.Append( parameterCopy.Value.GetType().ToString() );
 						typeLogList.Append( "], " );
 					}
 				}

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/EmbedParamsPreparedCommand.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/EmbedParamsPreparedCommand.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/EmbedParamsPreparedCommand.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Commands/EmbedParamsPreparedCommand.cs Wed May 18 13:47:00 2005
@@ -75,8 +75,8 @@
 					{
 						ParameterProperty property = request.ParameterMap.GetProperty(i);
 
-						parameterValue = request.ParameterMap.GetValueOfProperty(parameterObject,
-							property.PropertyName);
+//						parameterValue = request.ParameterMap.GetValueOfProperty(parameterObject,
+//							property.PropertyName);
 					}
 					else // 'value' parameter
 					{
@@ -106,7 +106,7 @@
 						//						property.Size = dataParameter.Size;
 
 						sqlParameter.Direction = property.Direction;
-						parameterValue = request.ParameterMap.GetValueOfProperty(parameterObject, property.PropertyName);
+//						parameterValue = request.ParameterMap.GetValueOfProperty(parameterObject, property.PropertyName);
 					}
 				}
 

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/InlineParameterMapParser.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/InlineParameterMapParser.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/InlineParameterMapParser.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/InlineParameterMapParser.cs Wed May 18 13:47:00 2005
@@ -255,7 +255,7 @@
 			} 
 			else if (typeof(IDictionary).IsAssignableFrom(type))
 			{
-				if (propertyType == null) 
+				if (propertyType == null || propertyType.Length==0) 
 				{
 					handler = typeHandlerFactory.GetUnkownTypeHandler();
 				} 

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/ParameterMap.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/ParameterMap.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/ParameterMap.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ParameterMapping/ParameterMap.cs Wed May 18 13:47:00 2005
@@ -28,13 +28,16 @@
 
 using System;
 using System.Collections;
+using System.Data;
 using System.Globalization;
 using System.IO;
 using System.Reflection;
 using System.Xml;
 using System.Xml.Serialization;
 using IBatisNet.Common.Utilities.Objects;
+using IBatisNet.DataMapper.Configuration.Alias;
 using IBatisNet.DataMapper.Scope;
+using IBatisNet.DataMapper.TypeHandlers;
 
 #endregion
 
@@ -88,14 +91,14 @@
 		{
 			get
 			{
-//				if (_usePositionalParameters) //obdc/oledb
-//				{
-//					return _properties;
-//				}
-//				else 
-//				{
-//					return _propertiesList;
-//				}
+				//				if (_usePositionalParameters) //obdc/oledb
+				//				{
+				//					return _properties;
+				//				}
+				//				else 
+				//				{
+				//					return _propertiesList;
+				//				}
 				return _properties;
 			}
 		}
@@ -242,107 +245,55 @@
 
 
 		/// <summary>
-		/// Get the value of a property form an object. Replace the null value if any.
+		/// Set parameter value, replace the null value if any.
 		/// </summary>
-		/// <param name="source">The object to get the property.</param>
-		/// <param name="propertyName">The name of the property to read.</param>
-		/// <returns>An object</returns>
-		public object GetValueOfProperty(object source, string propertyName)
-		{
-			object propertyValue = null;
-
-			if ( _propertiesMap.Contains( propertyName ) )
+		/// <param name="mapping"></param>
+		/// <param name="dataParameter"></param>
+		/// <param name="parameterValue"></param>
+		public void SetParameter(ParameterProperty mapping, IDataParameter dataParameter, object parameterValue)
+		{
+			object value = parameterValue;
+			ITypeHandler typeHandler = mapping.TypeHandler;
+
+			if (parameterValue.GetType() != typeof(string) && 
+				parameterValue.GetType() != typeof(Guid) &&
+				!parameterValue.GetType().IsPrimitive)
 			{
-				ParameterProperty property = (ParameterProperty)_propertiesMap[propertyName];
+				value = ObjectProbe.GetPropertyValue(value, mapping.PropertyName);
 
-				// Get the property value
-				propertyValue = ObjectProbe.GetPropertyValue(source, propertyName);
-
-				if (propertyValue != null && propertyValue.GetType() == typeof(byte[]))
+				if (value != null && value.GetType() == typeof(byte[]))
 				{
-					MemoryStream stream = new MemoryStream((byte[])propertyValue);
+					MemoryStream stream = new MemoryStream((byte[])value);
 
-					propertyValue = stream.ToArray();
+					value = stream.ToArray();
 				}
+			}
 
-				// Check null value
-				// Case of Enum property
-				if (propertyValue != null && propertyValue.GetType().IsEnum)
-				{
-					#region Enum case
-					PropertyInfo propertyInfo =  ReflectionInfo.GetInstance(source.GetType()).GetGetter( propertyName );
-				
-					// check nullValue
-					if ( property.HasNullValue == true )
-					{
-						object nullValue = null;
-
-						nullValue = Enum.Parse(propertyInfo.PropertyType, property.NullValue);
-						//Convert.ChangeType( property.NullValue, type );
-						
-						if ( object.Equals(propertyValue, nullValue) )
-						{
-							propertyValue = null; ;
-						}
-						else
-						{
-							// Convert enum value to numeric value
-							propertyValue = Convert.ChangeType( propertyValue, Enum.GetUnderlyingType( propertyInfo.PropertyType ) );
-						}
-					}
-					else
-					{
-						// Convert enum value to numeric value
-						propertyValue = Convert.ChangeType( propertyValue, Enum.GetUnderlyingType( propertyInfo.PropertyType ) );
-					}
-					#endregion
-				}
-				else
+			// Apply Null Value
+			if (mapping.HasNullValue) 
+			{
+				if (typeHandler.Equals(value, mapping.NullValue)) 
 				{
-					// check nullValue
-					if ( property.HasNullValue == true )
-					{
-						object nullValue = null;
-
-						PropertyInfo propertyInfo =  ReflectionInfo.GetInstance(source.GetType()).GetGetter( propertyName );
-
-						if (propertyInfo.PropertyType == typeof(Decimal))
-						{
-							#region Decimal
-							CultureInfo culture = new CultureInfo( "en-US" );
-							// nullValue decimal must be  ######.##
-							nullValue = decimal.Parse( property.NullValue, culture);
-							#endregion
-						}
-						else if (propertyInfo.PropertyType == typeof(Guid)) 
-						{
-							#region Guid
-							nullValue = new Guid(property.NullValue); 
-							#endregion
-						}						
-						else
-						{
-							nullValue = Convert.ChangeType( property.NullValue, propertyInfo.PropertyType );
-						}
-
-						if ( object.Equals(propertyValue, nullValue) )
-						{
-							propertyValue = null; ;
-						}
-					}
-					else
-					{
-						if (propertyValue == null)
-						{
-							propertyValue = null; ;
-						}
-					}
+					value = null;
 				}
 			}
 
-			return propertyValue;
+			// Set Parameter
+			if (value != null) 
+			{
+				typeHandler.SetParameter(dataParameter, value, mapping.DbType);
+			}
+			else if(typeHandler is CustomTypeHandler)
+			{
+				typeHandler.SetParameter(dataParameter, value, mapping.DbType);
+			}
+			else 
+			{
+				// When sending a null parameter value to the server,
+				// the user must specify DBNull, not null. 
+				dataParameter.Value = System.DBNull.Value;
+			}
 		}
-	
 
 		#region Configuration
 		/// <summary>
@@ -378,5 +329,5 @@
 
 		#endregion
 
-}
+	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultMap.cs Wed May 18 13:47:00 2005
@@ -168,7 +168,6 @@
 		/// <summary>
 		/// Do not use direclty, only for serialization.
 		/// </summary>
-		[Obsolete("This public constructor with no parameter is not really obsolete, but is reserved for serialization.", false)]
 		public ResultMap()
 		{
 		}
@@ -331,7 +330,7 @@
 			if (_discriminator != null)
 			{	
 				ResultProperty mapping = _discriminator.ResultProperty;
-				object dataBaseValue = mapping.TypeHandler.GetDataBaseValue( mapping, dataReader);
+				object dataBaseValue = mapping.GetDataBaseValue( dataReader );
 				subMap = _discriminator.GetSubMap( dataBaseValue.ToString() );
 
 				if (subMap == null) 
@@ -345,6 +344,8 @@
 			}
 			return subMap;
 		}
+
+		
 		#endregion
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs Wed May 18 13:47:00 2005
@@ -28,6 +28,7 @@
 
 using System;
 using System.Collections;
+using System.Data;
 using System.Reflection;
 using System.Xml.Serialization;
 using IBatisNet.Common.Exceptions;
@@ -293,6 +294,40 @@
 			_propertyInfo = propertyInfo;
 
 			_typeHandler =  typeHandlerFactory.GetTypeHandler(propertyInfo.PropertyType);
+		}
+
+		/// <summary>
+		/// 
+		/// </summary>
+		/// <param name="dataReader"></param>
+		/// <returns></returns>
+		public object GetDataBaseValue(IDataReader dataReader)
+		{
+			object value = null;
+
+			if (_columnIndex == UNKNOWN_COLUMN_INDEX)  
+			{
+				value = _typeHandler.GetValueByName(this, dataReader);
+			} 
+			else 
+			{
+				value = _typeHandler.GetValueByIndex(this, dataReader);
+			}
+
+			bool wasNull = (value == DBNull.Value);
+			if (wasNull)
+			{
+				if (this.HasNullValue) 
+				{
+					value = _typeHandler.ValueOf(_propertyInfo.PropertyType, _nullValue);
+				}
+				else
+				{
+					value = null;
+				}			
+			}
+
+			return value;
 		}
 		#endregion
 	}

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/MappedStatements/MappedStatement.cs Wed May 18 13:47:00 2005
@@ -285,12 +285,17 @@
 					// Check if the ResultClass is a 'primitive' Type
 					if (_sqlMap.TypeHandlerFactory.IsSimpleType(_statement.ResultClass))
 					{
+						// Create a ResultMap
+						ResultMap resultMap = new ResultMap();
+
 						// Create a ResultProperty
 						ResultProperty property = new ResultProperty();
 						property.PropertyName = "value";
 						property.ColumnIndex = 0;
 						property.TypeHandler = _sqlMap.TypeHandlerFactory.GetTypeHandler(outObject.GetType());
 
+						resultMap.AddResultPropery(property);
+
 						SetObjectProperty(request, request.ResultMap, property, ref outObject, reader);
 					}
 					else if (outObject is Hashtable) 
@@ -951,7 +956,7 @@
 					}					
 				}
 
-				object dataBaseValue = mapping.TypeHandler.GetDataBaseValue( mapping, reader);
+				object dataBaseValue = mapping.GetDataBaseValue( reader );
 
 				if (resultMap != null) 
 				{
@@ -1161,7 +1166,8 @@
 		private class ReaderAutoMapper 
 		{
 
-			private IList mappings = new ArrayList();
+//			private IList _mappings = new ArrayList();
+			private ResultMap _resultMap = new ResultMap();
 
 			/// <summary>
 			/// 
@@ -1198,12 +1204,14 @@
 						{
 							property.PropertyName = matchedPropertyInfo.Name;
 							property.Initialize(typeHandlerFactory, matchedPropertyInfo );
-							mappings.Add(property);
+//							_mappings.Add(property);
+							_resultMap.AddResultPropery(property);
 						}
 						else if (resultObject is Hashtable) 
 						{
 							property.PropertyName = columnName;
-							mappings.Add(property);
+//							_mappings.Add(property);
+							_resultMap.AddResultPropery(property);
 						}
 
 						// Set TypeHandler
@@ -1224,11 +1232,11 @@
 			/// <param name="resultObject"></param>
 			public void AutoMapReader(IDataReader reader, ref object resultObject)
 			{
-				for (int i = 0; i < mappings.Count; i++) 
+				foreach (string key in _resultMap.ColumnsToPropertiesMap.Keys) 
 				{
-					ResultProperty property = (ResultProperty) mappings[i];
+					ResultProperty property = (ResultProperty) _resultMap.ColumnsToPropertiesMap[key];
 					MappedStatement.SetValueOfProperty( ref resultObject, property, 
-									property.TypeHandler.GetDataBaseValue(property, reader));
+						property.GetDataBaseValue( reader ));
 				}
 			}
 

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BaseTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BaseTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BaseTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BaseTypeHandler.cs Wed May 18 13:47:00 2005
@@ -41,73 +41,67 @@
 	internal abstract class BaseTypeHandler : ITypeHandler
 	{
 		/// <summary>
-		/// 
+		/// Gets a column value by the name
 		/// </summary>
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		public object GetDataBaseValue(ResultProperty mapping, IDataReader dataReader)
-		{
-			object value = null;
+		public abstract object GetValueByName(ResultProperty mapping, IDataReader dataReader);
 
-			if (mapping.ColumnIndex == ResultProperty.UNKNOWN_COLUMN_INDEX)  
-			{
-				value = GetValueByName(mapping, dataReader);
-			} 
-			else 
-			{
-				value = GetValueByIndex(mapping, dataReader);
-			}
-
-			bool wasNull = (value == DBNull.Value);
-			if (wasNull)
-			{
-				if (mapping.HasNullValue) 
-				{
-					value = GetNullValue(mapping);
-				}
-				else
-				{
-					value = null;
-				}			
-			}
-
-			return value;
-		}
-
-
-		protected abstract object GetValueByName(ResultProperty mapping, IDataReader dataReader);
+		/// <summary>
+		/// Gets a column value by the index
+		/// </summary>
+		/// <param name="mapping"></param>
+		/// <param name="dataReader"></param>
+		/// <returns></returns>
+		public abstract object GetValueByIndex(ResultProperty mapping, IDataReader dataReader);
 
-		protected abstract object GetValueByIndex(ResultProperty mapping, IDataReader dataReader);
+		/// <summary>
+		/// Retrieve ouput database value of an output parameter
+		/// </summary>
+		/// <param name="outputValue">ouput database value</param>
+		/// <param name="parameterType">type used in EnumTypeHandler</param>
+		/// <returns></returns>
+		public abstract object GetDataBaseValue(object outputValue, Type parameterType );
 
-		protected abstract object GetNullValue(ResultProperty mapping);
+		public abstract bool IsSimpleType{ get; }
 
-		public abstract object GetDataBaseValue(object outputValue, Type parameterType );
+		/// <summary>
+		/// Converts the String to the type that this handler deals with
+		/// </summary>
+		/// <param name="type">the tyepe of the property (used only for enum conversion)</param>
+		/// <param name="s">the String value</param>
+		/// <returns>the converted value</returns>
+		public abstract object ValueOf(Type type, string s);
 
-		public abstract bool IsSimpleType();
+		/// <summary>
+		///  Sets a parameter on a IDbCommand
+		/// </summary>
+		/// <param name="dataParameter">the parameter</param>
+		/// <param name="parameterValue">the parameter value</param>
+		/// <param name="dbType">the dbType of the parameter</param>
+		public virtual void SetParameter(IDataParameter dataParameter, object parameterValue, string dbType)
+		{
+			dataParameter.Value = parameterValue;
+		}
 
 		/// <summary>
-		/// Performs processing on a value before it is used to set
-		/// the parameter of a IDbCommand.
+		///  Compares two values (that this handler deals with) for equality
 		/// </summary>
-		/// <param name="mapping">The mapping between data parameter and object property.</param>
-		/// <param name="dataParameter"></param>
-		/// <param name="parameterValue">The value to be set</param>
-		/// <param name="dbType">Data base type</param>
-		public virtual void SetParameter(ParameterProperty mapping, IDataParameter dataParameter, object parameterValue, string dbType)
+		/// <param name="obj">one of the objects</param>
+		/// <param name="str">the other object as a String</param>
+		/// <returns>true if they are equal</returns>
+		public virtual bool Equals(object obj, string str) 
 		{
-			if (parameterValue!=null)
+			if (obj == null || str == null) 
 			{
-				dataParameter.Value = parameterValue;
-			}
-			else
+				return obj == str;
+			} 
+			else 
 			{
-				// When sending a null parameter value to the server,
-				// the user must specify DBNull, not null. 
-				dataParameter.Value = System.DBNull.Value;
+				object castedObject = ValueOf(obj.GetType(), str);
+				return obj.Equals(castedObject);
 			}
 		}
-
-//		public abstract object GetDataParameter(ParameterProperty mapping, object source);
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BooleanTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BooleanTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BooleanTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/BooleanTypeHandler.cs Wed May 18 13:47:00 2005
@@ -48,7 +48,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -62,7 +62,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -74,10 +74,6 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
-		{
-			return Convert.ToBoolean(mapping.NullValue);
-		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
@@ -85,9 +81,17 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
+		{
+			get
+			{
+				return true;
+			}
+		}
+
+		public override object ValueOf(Type type, string s)
 		{
-			return true;
+			return Convert.ToBoolean(s);
 		}
 
 	}

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteArrayTypeHandler.cs Wed May 18 13:47:00 2005
@@ -43,13 +43,14 @@
 	internal class ByteArrayTypeHandler : BaseTypeHandler
 	{
 
+
 		/// <summary>
 		/// 
 		/// </summary>
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -63,7 +64,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -111,20 +112,23 @@
 			return stream.ToArray();
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		
+		public override object ValueOf(Type type, string s)
 		{
-			return null;
+			return System.Text.Encoding.Default.GetBytes(s);
 		}
 
-
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
 			throw new DataMapperException("NotSupportedException");
 		}
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ByteTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -63,7 +63,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -75,21 +75,23 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToByte(mapping.NullValue);
+			return Convert.ToByte(s);
 		}
 
-
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
 			return Convert.ToByte(outputValue);
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CharTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CharTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CharTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CharTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -63,7 +63,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -76,9 +76,9 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToChar(mapping.NullValue);
+			return Convert.ToChar(s);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -87,9 +87,12 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CustomTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CustomTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CustomTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/CustomTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,31 +49,30 @@
 		/// Performs processing on a value before it is used to set
 		/// the parameter of a IDbCommand.
 		/// </summary>
-		/// <param name="mapping">The mapping between data parameter and object property.</param>
 		/// <param name="dataParameter"></param>
 		/// <param name="parameterValue">The value to be set</param>
 		/// <param name="dbType">Data base type</param>
-		public override void SetParameter(ParameterProperty mapping, IDataParameter dataParameter, object parameterValue, string dbType)
+		public override void SetParameter(IDataParameter dataParameter, object parameterValue, string dbType)
 		{
 			IParameterSetter setter = new ParameterSetterImpl(dataParameter);
 			_callback.SetParameter(setter, parameterValue);
 		}
 
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			IResultGetter getter = new ResultGetterImpl(dataReader, mapping.ColumnName);
 			return _callback.GetResult(getter);
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
 		{
 			IResultGetter getter = new ResultGetterImpl(dataReader, mapping.ColumnIndex);
 			return _callback.GetResult(getter);		
 		}
 
-		protected override object GetNullValue(ResultProperty mapping)
+		public override object ValueOf(Type type, string s)
 		{
-			return _callback.GetNullValue(mapping.NullValue);
+			return _callback.ValueOf(s);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType)
@@ -82,9 +81,12 @@
 			return _callback.GetResult(getter);	
 		}
 
-		public override bool IsSimpleType()
+		public override bool IsSimpleType
 		{
-			return false;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DateTimeTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DateTimeTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DateTimeTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DateTimeTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -63,7 +63,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -75,9 +75,9 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToDateTime(mapping.NullValue);
+			return Convert.ToDateTime(s);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -86,9 +86,12 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DecimalTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DecimalTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DecimalTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DecimalTypeHandler.cs Wed May 18 13:47:00 2005
@@ -43,13 +43,14 @@
 	internal class DecimalTypeHandler : BaseTypeHandler
 	{
 
+
 		/// <summary>
 		/// 
 		/// </summary>
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -63,7 +64,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -75,12 +76,12 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
 			CultureInfo culture = new CultureInfo( "en-US" );
 			// nullValue decimal must be  in format ######.##
 			// where . is separator for decimal
-			return decimal.Parse( mapping.NullValue, culture);
+			return decimal.Parse(s, culture);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -89,9 +90,12 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DoubleTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DoubleTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DoubleTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/DoubleTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -63,7 +63,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -75,9 +75,9 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToDouble(mapping.NullValue);
+			return Convert.ToDouble(s);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -86,9 +86,12 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/EnumTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/EnumTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/EnumTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/EnumTypeHandler.cs Wed May 18 13:47:00 2005
@@ -29,8 +29,9 @@
 using System;
 using System.Data;
 using System.Globalization;
-
+using System.Reflection;
 using IBatisNet.Common.Utilities.Objects;
+using IBatisNet.DataMapper.Configuration.ParameterMapping;
 using IBatisNet.DataMapper.Configuration.ResultMapping;
 using IBatisNet.DataMapper.Exceptions;
 #endregion 
@@ -46,12 +47,23 @@
 	{
 
 		/// <summary>
+		///  Sets a parameter on a IDbCommand
+		/// </summary>
+		/// <param name="dataParameter">the parameter</param>
+		/// <param name="parameterValue">the parameter value</param>
+		/// <param name="dbType">the dbType of the parameter</param>
+		public override void SetParameter(IDataParameter dataParameter, object parameterValue, string dbType)
+		{
+			dataParameter.Value =  Convert.ChangeType( parameterValue, Enum.GetUnderlyingType( parameterValue.GetType() ) );;
+		}
+
+		/// <summary>
 		/// 
 		/// </summary>
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -65,7 +77,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -77,9 +89,10 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+
+		public override object ValueOf(Type type, string s)
 		{
-			return Enum.Parse(mapping.PropertyInfo.PropertyType, mapping.NullValue);
+			return Enum.Parse(type, s);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -88,9 +101,12 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/GuidTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/GuidTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/GuidTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/GuidTypeHandler.cs Wed May 18 13:47:00 2005
@@ -48,7 +48,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -62,7 +62,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -74,10 +74,9 @@
 			}
 		}
 
-
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
-			return new Guid(mapping.NullValue);
+			return new Guid(s);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -86,9 +85,12 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandler.cs Wed May 18 13:47:00 2005
@@ -39,19 +39,28 @@
 	/// </summary>
 	public interface ITypeHandler
 	{
+
 		/// <summary>
 		/// 
 		/// </summary>
+		/// <returns></returns>
+		bool IsSimpleType{get;}
+
+		/// <summary>
+		/// Gets a column value by the name
+		/// </summary>
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		object GetDataBaseValue(ResultProperty mapping, IDataReader dataReader);
+		object GetValueByName(ResultProperty mapping, IDataReader dataReader);
 
 		/// <summary>
-		/// 
+		/// Gets a column value by the index
 		/// </summary>
+		/// <param name="mapping"></param>
+		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		bool IsSimpleType();
+		object GetValueByIndex(ResultProperty mapping, IDataReader dataReader);
 
 		/// <summary>
 		/// Retrieve ouput database value of an output parameter
@@ -62,14 +71,27 @@
 		object GetDataBaseValue(object outputValue, Type parameterType);
 
 		/// <summary>
-		/// Performs processing on a value before it is used to set
-		/// the parameter of a IDbCommand.
+		///  Sets a parameter on a IDbCommand
+		/// </summary>
+		/// <param name="dataParameter">the parameter</param>
+		/// <param name="parameterValue">the parameter value</param>
+		/// <param name="dbType">the dbType of the parameter</param>
+		void SetParameter(IDataParameter dataParameter, object parameterValue, string dbType);
+
+		/// <summary>
+		/// Converts the String to the type that this handler deals with
 		/// </summary>
-		/// <param name="mapping">The mapping between data parameter and object property.</param>
-		/// <param name="dataParameter"></param>
-		/// <param name="parameterValue">The value to be set</param>
-		/// <param name="dbType">Data base type</param>
-		void SetParameter(ParameterProperty mapping, IDataParameter dataParameter, object parameterValue, string dbType);
+		/// <param name="type">the tyepe of the property (used only for enum conversion)</param>
+		/// <param name="s">the String value</param>
+		/// <returns>the converted value</returns>
+		object ValueOf(Type type, string s);
 
+		/// <summary>
+		///  Compares two values (that this handler deals with) for equality
+		/// </summary>
+		/// <param name="obj">one of the objects</param>
+		/// <param name="str">the other object as a String</param>
+		/// <returns>true if they are equal</returns>
+		 bool Equals(object obj, string str);
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandlerCallback.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandlerCallback.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandlerCallback.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ITypeHandlerCallback.cs Wed May 18 13:47:00 2005
@@ -65,11 +65,18 @@
 		/// <returns>The processed value.</returns>
 		object GetResult(IResultGetter getter);
 
+
 		/// <summary>
-		///  Converts the string to the type that this handler deals with
+		/// Casts the string representation of a value into a type recognized by
+		/// this type handler.  This method is used to translate nullValue values
+		/// into types that can be appropriately compared.  If your custom type handler
+		/// cannot support nullValues, or if there is no reasonable string representation
+		/// for this type (e.g. File type), you can simply return the String representation
+		/// as it was passed in.  It is not recommended to return null, unless null was passed
+		/// in.
 		/// </summary>
-		/// <param name="nullValue">the String value</param>
-		/// <returns>the converted value</returns>
-		object GetNullValue(string nullValue);
+		/// <param name="s"></param>
+		/// <returns></returns>
+		object ValueOf(string s);
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int16TypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int16TypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int16TypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int16TypeHandler.cs Wed May 18 13:47:00 2005
@@ -28,9 +28,8 @@
 
 using System;
 using System.Data;
-using System.Globalization;
-
 using IBatisNet.DataMapper.Configuration.ResultMapping;
+
 #endregion 
 
 
@@ -49,13 +48,13 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
 			if (dataReader.IsDBNull(index) == true)
 			{
-				return System.DBNull.Value;
+				return DBNull.Value;
 			}
 			else
 			{
@@ -64,11 +63,11 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
-				return System.DBNull.Value;
+				return DBNull.Value;
 			}
 			else
 			{
@@ -77,21 +76,22 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
-		{
-			return Convert.ToInt16(mapping.NullValue);
-		}
-
-
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
 			return Convert.ToInt16(outputValue);
 		}
 
+		public override object ValueOf(Type type, string s)
+		{
+			return Convert.ToInt16(s);
+		}
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int32TypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int32TypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int32TypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int32TypeHandler.cs Wed May 18 13:47:00 2005
@@ -47,7 +47,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -62,7 +62,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -75,20 +75,23 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
-			return Convert.ToInt32(mapping.NullValue);
+			return Convert.ToInt32(outputValue);
 		}
 
-		public override object GetDataBaseValue(object outputValue, Type parameterType )
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToInt32(outputValue);
+			return Convert.ToInt32(s);
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 
 	}

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int64TypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int64TypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int64TypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/Int64TypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -64,7 +64,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -77,20 +77,23 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
-			return Convert.ToInt64(mapping.NullValue);
+			return Convert.ToInt64(outputValue);
 		}
 
-		public override object GetDataBaseValue(object outputValue, Type parameterType )
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToInt64(outputValue);
+			return Convert.ToInt64(s);
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ObjectTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ObjectTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ObjectTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/ObjectTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -63,7 +63,7 @@
 			}
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -75,9 +75,9 @@
 			}
 		}
 
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
-			return null;
+			return s;
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -86,9 +86,12 @@
 		}
 
 
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return false;
+			get
+			{
+				return false;
+			}
 		}
 
 	}

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/SingleTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/SingleTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/SingleTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/SingleTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -69,7 +69,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -81,14 +81,9 @@
 			}
 		}
 
-		/// <summary>
-		/// 
-		/// </summary>
-		/// <param name="mapping"></param>
-		/// <returns></returns>
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToSingle(mapping.NullValue);
+			return Convert.ToSingle(s);
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
@@ -101,9 +96,12 @@
 		/// 
 		/// </summary>
 		/// <returns></returns>
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/StringTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/StringTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/StringTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/StringTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -69,7 +69,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{	
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -81,19 +81,14 @@
 			}
 		}
 
-		/// <summary>
-		/// 
-		/// </summary>
-		/// <param name="mapping"></param>
-		/// <returns></returns>
-		protected override object GetNullValue(ResultProperty mapping) 
+		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
-			return Convert.ToString(mapping.NullValue);
+			return outputValue;
 		}
 
-		public override object GetDataBaseValue(object outputValue, Type parameterType )
+		public override object ValueOf(Type type, string s)
 		{
-			return Convert.ToString(outputValue);;
+			return s;
 		}
 
 
@@ -101,9 +96,12 @@
 		/// 
 		/// </summary>
 		/// <returns></returns>
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TimeSpanTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TimeSpanTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TimeSpanTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TimeSpanTypeHandler.cs Wed May 18 13:47:00 2005
@@ -49,7 +49,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			//return GetValueByIndex(dataReader.GetOrdinal(columnName), dataReader);
 			return "ToDo";
@@ -61,7 +61,7 @@
 		/// <param name="mapping"></param>
 		/// <param name="dataReader"></param>
 		/// <returns></returns>
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader) 
 		{
 			// dépendra du dbType spécifié ds le ResultProperty (idem pour le StringTypeHandler
 			// des fois en DateTime, d'autre fois en TimeSpan
@@ -69,29 +69,26 @@
 				//dataReader.GetTimeSpan(columnIndex);
 		}
 
-		/// <summary>
-		/// 
-		/// </summary>
-		/// <param name="mapping"></param>
-		/// <returns></returns>
-		protected override object GetNullValue(ResultProperty mapping) 
-		{
-			return new TimeSpan(Convert.ToInt64(mapping.NullValue));
-		}
-
 		public override object GetDataBaseValue(object outputValue, Type parameterType )
 		{
 			return  new TimeSpan(Convert.ToInt64(outputValue));
 		}
 
+		public override object ValueOf(Type type, string s)
+		{
+			return new TimeSpan(Convert.ToInt64(s));
+		}
 
 		/// <summary>
 		/// 
 		/// </summary>
 		/// <returns></returns>
-		public override bool IsSimpleType() 
+		public override bool IsSimpleType
 		{
-			return true;
+			get
+			{
+				return true;
+			}
 		}
 	}
 }

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs Wed May 18 13:47:00 2005
@@ -227,7 +227,7 @@
 				ITypeHandler handler = this.GetTypeHandler(type, null);
 				if (handler != null) 
 				{
-					result = handler.IsSimpleType();
+					result = handler.IsSimpleType;
 				}
 			}
 			return result;

Modified: incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/UnknownTypeHandler.cs
URL: http://svn.apache.org/viewcvs/incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/UnknownTypeHandler.cs?rev=170826&r1=170825&r2=170826&view=diff
==============================================================================
--- incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/UnknownTypeHandler.cs (original)
+++ incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/UnknownTypeHandler.cs Wed May 18 13:47:00 2005
@@ -54,16 +54,15 @@
 		/// Performs processing on a value before it is used to set
 		/// the parameter of a IDbCommand.
 		/// </summary>
-		/// <param name="mapping">The mapping between data parameter and object property.</param>
 		/// <param name="dataParameter"></param>
 		/// <param name="parameterValue">The value to be set</param>
 		/// <param name="dbType">Data base type</param>
-		public override void SetParameter(ParameterProperty mapping, IDataParameter dataParameter, object parameterValue, string dbType)
+		public override void SetParameter(IDataParameter dataParameter, object parameterValue, string dbType)
 		{
 			if (parameterValue!=null)
 			{
 				ITypeHandler handler = _factory.GetTypeHandler( parameterValue.GetType(), dbType );
-				handler.SetParameter(mapping, dataParameter, parameterValue, dbType);
+				handler.SetParameter(dataParameter, parameterValue, dbType);
 			}
 			else
 			{
@@ -73,7 +72,7 @@
 			}
 		}
 
-		protected override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByName(ResultProperty mapping, IDataReader dataReader)
 		{
 			int index = dataReader.GetOrdinal(mapping.ColumnName);
 
@@ -87,7 +86,7 @@
 			}		
 		}
 
-		protected override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
+		public override object GetValueByIndex(ResultProperty mapping, IDataReader dataReader)
 		{
 			if (dataReader.IsDBNull(mapping.ColumnIndex) == true)
 			{
@@ -99,9 +98,9 @@
 			}		
 		}
 
-		protected override object GetNullValue(ResultProperty mapping)
+		public override object ValueOf(Type type, string s)
 		{
-			throw new NotImplementedException();
+			return s;
 		}
 
 		public override object GetDataBaseValue(object outputValue, Type parameterType)
@@ -110,9 +109,32 @@
 		}
 
 
-		public override bool IsSimpleType()
+		public override bool IsSimpleType
 		{
-			throw new NotImplementedException();
+			get
+			{
+				return true;
+			}
+		}
+
+		/// <summary>
+		///  Compares two values (that this handler deals with) for equality
+		/// </summary>
+		/// <param name="obj">one of the objects</param>
+		/// <param name="str">the other object as a String</param>
+		/// <returns>true if they are equal</returns>
+		public override bool Equals(object obj, string str) 
+		{
+			if (obj == null || str == null) 
+			{
+				return obj == str;
+			} 
+			else 
+			{
+				ITypeHandler handler = _factory.GetTypeHandler(obj.GetType());
+				object castedObject = handler.ValueOf(obj.GetType(), str);
+				return obj.Equals(castedObject);
+			}
 		}
 	}
 }



Re: svn commit: r170826 - /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc /in

Posted by Roberto R <ro...@gmail.com>.
It's not being found as a Primitive Type:

http://msdn.microsoft.com/library/en-us/cpref/html/frlrfSystemTypeClassIsPrimitiveImplTopic.asp?frame=true

:-(



On 5/19/05, Gilles Bayon <ib...@gmail.com> wrote:
> 
> If I understant it is in the result property there'is a problem with 
> oracle,
> 
> <resultMap id="order-with-lines-array" class="Order"
> extends="lite-order-result-by-name">
> <result property="LineItemsArray" column="Order_ID"
> select="GetLineItemsForOrder"/>
> </resultMap>
> 
> the value of the column Order_ID is decimal, but how could the test
> parameterValue.GetType().IsPrimitive in ParameterMap.SetParameter
> could be false ?
> For me, the lines that you have added are
> parameterValue.GetType() != typeof(Guid) &&
> parameterValue.GetType() != typeof(Decimal) && doubled usage with
> parameterValue.GetType().IsPrimitive .
> 
> 
> On 5/19/05, Roberto R <ro...@gmail.com> wrote:
> > Ack, forgot the exception:
> >
> > 
> IBatisNet.DataMapper.Test.NUnit.SqlMapTests.ResultMapTest.TestArrayMapping
> > : IBatisNet.Common.Exceptions.ProbeException : There is no
> > Get property named 'value' in class 'Decimal'
> >
> >
> >
> > On 5/18/05, Roberto R <ro...@gmail.com> wrote:
> > > Gilles,
> > >
> > > I'm getting some errors with the MS OracleClient and ODP providers 
> with
> > the TypeHandler changes.
> > >
> > > In any of the NUnit tests that use a <result select="Getzzzz"> (mostly
> > resultMap tests) such as TestArrayMapping, I get the following:
> > >
> > > <statement id="GetOrderWithLineItemArray"
> > > parameterClass="int"
> > > resultMap="order-with-lines-array">
> > > select * from Orders where Order_ID = #value#
> > > </statement>
> > >
> > > at
> > IBatisNet.Common.Utilities.Objects.ObjectProbe.GetProperty(Object
> > obj, String propertyName) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line
> > 349
> > > at
> > IBatisNet.Common.Utilities.Objects.ObjectProbe.GetPropertyValue(Object
> > obj, String propertyName) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line
> > 491
> > > at
> > 
> IBatisNet.DataMapper.Configuration.ParameterMapping.ParameterMap.SetParameter
> (ParameterProperty
> > mapping, IDataParameter dataParameter, Object parameterValue) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\ParameterMapping\ParameterMap.cs:line
> > 262
> > > at
> > IBatisNet.DataMapper.Commands.DefaultPreparedCommand.ApplyParameterMap
> (IDalSession
> > session, IDbCommand command, RequestScope request, IStatement statement,
> > Object parameterObject) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line
> > 155
> > > at
> > IBatisNet.DataMapper.Commands.DefaultPreparedCommand.Create(RequestScope
> > request, IDalSession session, IStatement statement, Object 
> parameterObject)
> > in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line
> > 80
> > > at
> > IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForList
> (RequestScope
> > request, IDalSession session, Object parameterObject, Int32 skipResults,
> > Int32 maxResults, RowDelegate rowDelegate) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> > 581
> > > at
> > 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList
> (IDalSession
> > session, Object parameterObject, Int32 skipResults, Int32 maxResults) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> > 528
> > > at
> > 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList
> (IDalSession
> > session, Object parameterObject) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> > 509
> > > at
> > IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecutePostSelect
> (IDalSession
> > session, RequestScope request) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> > 897
> > > at
> > IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject
> (RequestScope
> > request, IDalSession session, Object parameterObject, Object 
> resultObject)
> > in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> > 463
> > > at
> > 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject
> (IDalSession
> > session, Object parameterObject, Object resultObject) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> > 401
> > > at
> > 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject
> (IDalSession
> > session, Object parameterObject) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> > 382
> > > at
> > IBatisNet.DataMapper.SqlMapper.QueryForObject(String
> > statementName, Object parameterObject) in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\SqlMapper.cs:line
> > 519
> > > at
> > 
> IBatisNet.DataMapper.Test.NUnit.SqlMapTests.ResultMapTest.TestArrayMapping
> ()
> > in
> > 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper.Test\NUnit\SqlMapTests\ResultMapTest.cs:line
> > 192
> > >
> > > The value (Order_Id in this case) is being returned as a Decimal by 
> Oracle
> > (as are all numbers). It's the same exception for both MS OracleClient 
> and
> > ODP (surprising since OracleClient has been doing better at the tests 
> than
> > ODP). I'm going to try to keep debugging to see why the TypeHandler 
> changes
> > are causing this error.
> > >
> > > Roberto
> > >
> > >
> >
> >
>

Re: svn commit: r170826 - /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc /in

Posted by Gilles Bayon <ib...@gmail.com>.
If I understant it is in the result property there'is a problem with oracle,

<resultMap id="order-with-lines-array" class="Order"
extends="lite-order-result-by-name">
<result property="LineItemsArray" column="Order_ID"
select="GetLineItemsForOrder"/>
</resultMap>

the value of the column Order_ID is decimal, but how could the test
parameterValue.GetType().IsPrimitive in ParameterMap.SetParameter
could be false ?
For me, the lines that you have added are 
parameterValue.GetType() != typeof(Guid) &&
parameterValue.GetType() != typeof(Decimal) && doubled usage with
parameterValue.GetType().IsPrimitive .


On 5/19/05, Roberto R <ro...@gmail.com> wrote:
> Ack, forgot the exception:
> 
> IBatisNet.DataMapper.Test.NUnit.SqlMapTests.ResultMapTest.TestArrayMapping
> : IBatisNet.Common.Exceptions.ProbeException : There is no
> Get property named 'value' in class 'Decimal'
> 
> 
> 
> On 5/18/05, Roberto R <ro...@gmail.com> wrote:
> > Gilles,
> > 
> > I'm getting some errors with the MS OracleClient and ODP providers with
> the TypeHandler changes.
> > 
> > In any of the NUnit tests that use a <result select="Getzzzz"> (mostly
> resultMap tests) such as TestArrayMapping, I get the following:
> > 
> >         <statement id="GetOrderWithLineItemArray"
> >                 parameterClass="int"
> >                 resultMap="order-with-lines-array">
> >                 select * from Orders where Order_ID = #value#
> >         </statement>
> > 
> >    at
> IBatisNet.Common.Utilities.Objects.ObjectProbe.GetProperty(Object
> obj, String propertyName) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line
> 349
> >    at
> IBatisNet.Common.Utilities.Objects.ObjectProbe.GetPropertyValue(Object
> obj, String propertyName) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line
> 491
> >    at
> IBatisNet.DataMapper.Configuration.ParameterMapping.ParameterMap.SetParameter(ParameterProperty
> mapping, IDataParameter dataParameter, Object parameterValue) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\ParameterMapping\ParameterMap.cs:line
> 262
> >    at
> IBatisNet.DataMapper.Commands.DefaultPreparedCommand.ApplyParameterMap(IDalSession
> session, IDbCommand command, RequestScope request, IStatement statement,
> Object parameterObject) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line
> 155
> >    at
> IBatisNet.DataMapper.Commands.DefaultPreparedCommand.Create(RequestScope
> request, IDalSession session, IStatement statement, Object parameterObject)
> in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line
> 80
> >    at
> IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForList(RequestScope
> request, IDalSession session, Object parameterObject, Int32 skipResults,
> Int32 maxResults, RowDelegate rowDelegate) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> 581
> >    at
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList(IDalSession
> session, Object parameterObject, Int32 skipResults, Int32 maxResults) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> 528
> >    at
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList(IDalSession
> session, Object parameterObject) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> 509
> >    at
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecutePostSelect(IDalSession
> session, RequestScope request) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> 897
> >    at
> IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(RequestScope
> request, IDalSession session, Object parameterObject, Object resultObject)
> in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> 463
> >    at
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(IDalSession
> session, Object parameterObject, Object resultObject) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> 401
> >    at
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(IDalSession
> session, Object parameterObject) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
> 382
> >    at
> IBatisNet.DataMapper.SqlMapper.QueryForObject(String
> statementName, Object parameterObject) in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\SqlMapper.cs:line
> 519
> >    at
> IBatisNet.DataMapper.Test.NUnit.SqlMapTests.ResultMapTest.TestArrayMapping()
> in
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper.Test\NUnit\SqlMapTests\ResultMapTest.cs:line
> 192
> > 
> > The value (Order_Id in this case) is being returned as a Decimal by Oracle
> (as are all numbers).  It's the same exception for both MS OracleClient and
> ODP (surprising since OracleClient has been doing better at the tests than
> ODP).  I'm going to try to keep debugging to see why the TypeHandler changes
> are causing this error.
> > 
> > Roberto
> > 
> > 
> 
>

Re: svn commit: r170826 - /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc /in

Posted by Roberto R <ro...@gmail.com>.
Ack, forgot the exception:

IBatisNet.DataMapper.Test.NUnit.SqlMapTests.ResultMapTest.TestArrayMapping : 
IBatisNet.Common.Exceptions.ProbeException : There is no Get property named 
'value' in class 'Decimal'


On 5/18/05, Roberto R <ro...@gmail.com> wrote:
> 
> Gilles,
> 
> I'm getting some errors with the MS OracleClient and ODP providers with 
> the TypeHandler changes.
> 
> In any of the NUnit tests that use a <result select="Getzzzz"> (mostly 
> resultMap tests) such as TestArrayMapping, I get the following:
> 
> <statement id="GetOrderWithLineItemArray"
> parameterClass="int"
> resultMap="order-with-lines-array">
> select * from Orders where Order_ID = #value#
> </statement>
> 
> at IBatisNet.Common.Utilities.Objects.ObjectProbe.GetProperty(Object obj, 
> String propertyName) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line 
> 349
> at IBatisNet.Common.Utilities.Objects.ObjectProbe.GetPropertyValue(Object 
> obj, String propertyName) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line 
> 491
> at 
> IBatisNet.DataMapper.Configuration.ParameterMapping.ParameterMap.SetParameter(ParameterProperty 
> mapping, IDataParameter dataParameter, Object parameterValue) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\ParameterMapping\ParameterMap.cs:line 
> 262
> at IBatisNet.DataMapper.Commands.DefaultPreparedCommand.ApplyParameterMap(IDalSession 
> session, IDbCommand command, RequestScope request, IStatement statement, 
> Object parameterObject) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line 
> 155
> at IBatisNet.DataMapper.Commands.DefaultPreparedCommand.Create(RequestScope 
> request, IDalSession session, IStatement statement, Object parameterObject) 
> in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line 
> 80
> at IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForList(RequestScope 
> request, IDalSession session, Object parameterObject, Int32 skipResults, 
> Int32 maxResults, RowDelegate rowDelegate) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line 
> 581
> at 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList(IDalSession 
> session, Object parameterObject, Int32 skipResults, Int32 maxResults) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line 
> 528
> at 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList(IDalSession 
> session, Object parameterObject) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line 
> 509
> at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecutePostSelect(IDalSession 
> session, RequestScope request) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line 
> 897
> at IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(RequestScope 
> request, IDalSession session, Object parameterObject, Object resultObject) 
> in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line 
> 463
> at 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(IDalSession 
> session, Object parameterObject, Object resultObject) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line 
> 401
> at 
> IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(IDalSession 
> session, Object parameterObject) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line 
> 382
> at IBatisNet.DataMapper.SqlMapper.QueryForObject(String statementName, 
> Object parameterObject) in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\SqlMapper.cs:line 
> 519
> at 
> IBatisNet.DataMapper.Test.NUnit.SqlMapTests.ResultMapTest.TestArrayMapping() 
> in 
> C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper.Test\NUnit\SqlMapTests\ResultMapTest.cs:line 
> 192
> 
> The value (Order_Id in this case) is being returned as a Decimal by Oracle 
> (as are all numbers). It's the same exception for both MS OracleClient and 
> ODP (surprising since OracleClient has been doing better at the tests than 
> ODP). I'm going to try to keep debugging to see why the TypeHandler changes 
> are causing this error.
> 
> Roberto
> 
>

Re: svn commit: r170826 - /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Domain /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/Access/OleDb /incubator/ibatis/trunk/cs/mapper/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc /in

Posted by Roberto R <ro...@gmail.com>.
Gilles,

I'm getting some errors with the MS OracleClient and ODP providers with the 
TypeHandler changes.

In any of the NUnit tests that use a <result select="Getzzzz"> (mostly 
resultMap tests) such as TestArrayMapping, I get the following:

<statement id="GetOrderWithLineItemArray"
parameterClass="int"
resultMap="order-with-lines-array">
select * from Orders where Order_ID = #value#
</statement>

at IBatisNet.Common.Utilities.Objects.ObjectProbe.GetProperty(Object obj, 
String propertyName) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line
349
at IBatisNet.Common.Utilities.Objects.ObjectProbe.GetPropertyValue(Object 
obj, String propertyName) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.Common\Utilities\Objects\ObjectProbe.cs:line
491
at 
IBatisNet.DataMapper.Configuration.ParameterMapping.ParameterMap.SetParameter(ParameterProperty
mapping, IDataParameter dataParameter, Object parameterValue) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Configuration\ParameterMapping\ParameterMap.cs:line
262
at IBatisNet.DataMapper.Commands.DefaultPreparedCommand.ApplyParameterMap(IDalSession
session, IDbCommand command, RequestScope request, IStatement statement, 
Object parameterObject) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line
155
at IBatisNet.DataMapper.Commands.DefaultPreparedCommand.Create(RequestScope 
request, IDalSession session, IStatement statement, Object parameterObject) 
in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\Commands\DefaultPreparedCommand.cs:line
80
at IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForList(RequestScope
request, IDalSession session, Object parameterObject, Int32 skipResults, 
Int32 maxResults, RowDelegate rowDelegate) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
581
at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList(IDalSession
session, Object parameterObject, Int32 skipResults, Int32 maxResults) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
528
at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForList(IDalSession
session, Object parameterObject) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
509
at IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecutePostSelect(IDalSession
session, RequestScope request) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
897
at IBatisNet.DataMapper.MappedStatements.MappedStatement.RunQueryForObject(RequestScope
request, IDalSession session, Object parameterObject, Object resultObject) 
in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
463
at 
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(IDalSession
session, Object parameterObject, Object resultObject) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
401
at 
IBatisNet.DataMapper.MappedStatements.MappedStatement.ExecuteQueryForObject(IDalSession
session, Object parameterObject) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\MappedStatements\MappedStatement.cs:line
382
at IBatisNet.DataMapper.SqlMapper.QueryForObject(String statementName, 
Object parameterObject) in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper\SqlMapper.cs:line 
519
at 
IBatisNet.DataMapper.Test.NUnit.SqlMapTests.ResultMapTest.TestArrayMapping() 
in 
C:\projects\ibatis\asf\trunk\cs\mapper\IBatisNet.DataMapper.Test\NUnit\SqlMapTests\ResultMapTest.cs:line
192

The value (Order_Id in this case) is being returned as a Decimal by Oracle 
(as are all numbers). It's the same exception for both MS OracleClient and 
ODP (surprising since OracleClient has been doing better at the tests than 
ODP). I'm going to try to keep debugging to see why the TypeHandler changes 
are causing this error.

Roberto