[ http://issues.apache.org/jira/browse/IBATISNET-73?page=comments#action_66406 ] Ron Grabowski commented on IBATISNET-73: ----------------------------------------
I just meant that ReaderAutoMapper didn't already access to the statement object and that it would need to be passed in. I didn't follow the call-graph(?) all the way the chain to see where statement needed to be passed in. It looks like RunQueryForObject in MappedStatement.cs needs to be changed from: result = ApplyResultMap(request, reader, resultObject); to: result = ApplyResultMap(request, this.Statement, reader, resultObject); then have statement be passed around accordingly. There's also some unused comments in RunQueryForObject: //using ( IDbCommand command = CreatePreparedCommand(request, session, parameterObject )) #region remark // If you are using the OleDb data provider (as you are), you need to close the // DataReader before output parameters are visible. #endregion That could be cleaned up. They've been in there for a while :) > 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