Author: gbayon
Date: Sun Jun 25 12:17:13 2006
New Revision: 417043

URL: http://svn.apache.org/viewvc?rev=417043&view=rev
Log:
- Fixed IBATISNET-163

Modified:
    
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
    
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs?rev=417043&r1=417042&r2=417043&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataAccess/Configuration/DomDaoManagerBuilder.cs
 Sun Jun 25 12:17:13 2006
@@ -674,7 +674,6 @@
                /// <returns>A provider</returns>
                private IDbProvider ParseProvider(ConfigurationScope 
configurationScope)
                {
-                       XmlAttribute attribute = null;
                        XmlNode node = 
configurationScope.NodeContext.SelectSingleNode( 
ApplyNamespacePrefix(XML_DATABASE_PROVIDER), 
configurationScope.XmlNamespaceManager);
 
                        configurationScope.ErrorContext.Activity = "configure 
provider";

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs?rev=417043&r1=417042&r2=417043&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
 (original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/Configuration/ResultMapping/ResultProperty.cs
 Sun Jun 25 12:17:13 2006
@@ -34,6 +34,7 @@
 using IBatisNet.Common.Exceptions;
 using IBatisNet.Common.Utilities.Objects;
 using IBatisNet.Common.Utilities.Objects.Members;
+using IBatisNet.DataMapper.Exceptions;
 using IBatisNet.DataMapper.MappedStatements.ArgumentStrategy;
 using IBatisNet.DataMapper.MappedStatements.PropertyStrategy;
 using IBatisNet.DataMapper.Scope;
@@ -153,7 +154,15 @@
                [XmlIgnore]
                public ITypeHandler TypeHandler
                {
-                       get { return _typeHandler; }
+                       get
+                       {
+                if (_typeHandler == null)
+                {
+                    throw new DataMapperException(
+                        String.Format("Error on Result property {0}, type 
handler for {1} is not registered.", this.PropertyName , this.MemberType.Name));
+                }
+                           return _typeHandler;
+                       }
                        set { _typeHandler = value; }
                }
 
@@ -391,11 +400,11 @@
 
                        if (_columnIndex == UNKNOWN_COLUMN_INDEX)  
                        {
-                               value = _typeHandler.GetValueByName(this, 
dataReader);
+                value = this.TypeHandler.GetValueByName(this, dataReader);
                        } 
                        else 
                        {
-                               value = _typeHandler.GetValueByIndex(this, 
dataReader);
+                value = this.TypeHandler.GetValueByIndex(this, dataReader);
                        }
 
                        bool wasNull = (value == DBNull.Value);
@@ -405,16 +414,16 @@
                                {
                     if (_setAccessor != null)
                                        {
-                        value = _typeHandler.ValueOf(_setAccessor.MemberType, 
_nullValue);
+                        value = 
this.TypeHandler.ValueOf(_setAccessor.MemberType, _nullValue);
                                        }
                                        else
                                        {
-                                               value = 
_typeHandler.ValueOf(null, _nullValue);
+                        value = this.TypeHandler.ValueOf(null, _nullValue);
                                        }
                                }
                                else
                                {
-                                       value = _typeHandler.NullValue;
+                    value = this.TypeHandler.NullValue;
                                }                       
                        }
 
@@ -430,7 +439,7 @@
                {
                        if (value == null)
                        {
-                               return _typeHandler.NullValue;
+                return this.TypeHandler.NullValue;
                        }
                        else
                        {

Modified: 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs
URL: 
http://svn.apache.org/viewvc/ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs?rev=417043&r1=417042&r2=417043&view=diff
==============================================================================
--- 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs 
(original)
+++ 
ibatis/trunk/cs/mapper/IBatisNet.DataMapper/TypeHandlers/TypeHandlerFactory.cs 
Sun Jun 25 12:17:13 2006
@@ -213,7 +213,10 @@
                                                handler = (ITypeHandler) 
dbTypeHandlerMap[ NULL ];
                                        }                                       
                                }
-
+                               if (handler==null)
+                               {
+                                       throw new 
DataMapperException(String.Format("Type handler for {0} not 
registered.",type.Name));
+                               }
                        }
 
                        return handler;


Reply via email to