[
http://issues.apache.org/jira/browse/IBATISNET-73?page=comments#action_66404 ]
Roberto Rabe commented on IBATISNET-73:
---------------------------------------
Well, I didn't see any other calls to the ReaderAutoMapper constructor aside
from the one in MappedStatement.AutoMapReader, so we could change the
ReaderAutoMapper constructor and pass the statement in to have:
_logger.Debug("The statement [" + statement.Id + "] was not able to auto map
column [" + columnName + "] to a property on [" + resultObject.ToString() +
"]");
You mentioned that this would change other things. What are the other changes
that you found (exception handling changes in other classes?)?
> Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException:
> There is no Set property named '' in class...
> ---------------------------------------------------------------------------------------------------------------------------
>
> Key: IBATISNET-73
> URL: http://issues.apache.org/jira/browse/IBATISNET-73
> Project: iBatis for .NET
> Type: Bug
> Reporter: Ron Grabowski
> Assignee: Roberto Rabe
> Fix For: DataMapper 1.2
>
> If a resultClass is specified and a column is returned from the database that
> does not match a property of the resultClass, an exception is thrown but the
> name of the non-mapped column does not appear in the error message. This code
> in IBatisNet.DataMapper.MappedStatements+ReaderAutoMapper:
> // Set TypeHandler
> Type propertyType = reflectionInfo.GetSetterType(property.PropertyName);
> property.TypeHandler = typeHandlerFactory.GetTypeHandler( propertyType );
> could be changed to this:
> if (property.PropertyName != null && property.PropertyName.Length > 0)
> {
> // Set TypeHandler
> Type propertyType = reflectionInfo.GetSetterType(property.PropertyName);
> property.TypeHandler = typeHandlerFactory.GetTypeHandler( propertyType );
> }
> else
> {
> if (_logger.IsDebugEnabled)
> {
> _logger.Debug("The column [" + columnName + "] could not be auto mapped to
> a property on [" + resultObject.ToString() + "]");
> }
> }
> We all know how much I would enjoy seeing that log message :) I think it
> would be a big help in tracking down typos. I think the Java version silently
> ignores the case and does not print anything to the logs.
> Thanks to Larry for encountering this bug again so it could be fixed.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira