You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org> on 2005/05/25 20:57:52 UTC
[jira] Created: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
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
Assigned to: Gilles Bayon
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
[jira] Commented: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
Posted by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-73?page=comments#action_66371 ]
Ron Grabowski commented on IBATISNET-73:
----------------------------------------
Now that I think about it, this would be more even more helpful:
_logger.Debug("The statement [" + statement + "] was not able to auto map column [" + columnName + "] to a property on [" + resultObject.ToString() + "]");
That would require changing how some other things are done. I don't know if this is an easy/difficult fix.
Just a wish...
> 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
[jira] Commented: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
Posted by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org>.
[ 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
[jira] Closed: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
Posted by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-73?page=all ]
Roberto Rabe closed IBATISNET-73:
---------------------------------
Resolution: Fixed
Fix Version: DataMapper 1.2
In SVN. Thanks Ron!
> 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
[jira] Commented: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
Posted by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org>.
[ 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
[jira] Assigned: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
Posted by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-73?page=all ]
Roberto Rabe reassigned IBATISNET-73:
-------------------------------------
Assign To: Roberto Rabe (was: Gilles Bayon)
> 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
>
> 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
[jira] Commented: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
Posted by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-73?page=comments#action_66378 ]
Roberto Rabe commented on IBATISNET-73:
---------------------------------------
I'll take a look at it.
> 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
[jira] Commented: (IBATISNET-73) Error automapping columns. Cause: IBatisNet.Common.Exceptions.ProbeException: There is no Set property named '' in class...
Posted by "Roberto Rabe (JIRA)" <ib...@incubator.apache.org>.
[ http://issues.apache.org/jira/browse/IBATISNET-73?page=comments#action_66415 ]
Roberto Rabe commented on IBATISNET-73:
---------------------------------------
Luckily, statement happens to be passed into the constructor for MappedStatement and is a field that's available to be passed to the ReaderAutoMapper() constructor.
Unluckily, the MappedStatement constructor is also used in DomSqlMapBuilder for insert.selectKey (public class SelectKey : Statement), and <selectKey> doesn't have a proper Id to show in the exception log right now! :-(
Finding the <insert> Id for the <selectKey> is going to be difficult I think.
> 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