Details
-
New Feature
-
Status: Open
-
Minor
-
Resolution: Unresolved
-
2.3.0
-
None
-
None
-
Java SUN version 1.5.0_08-b03 / MySQL 5.0
Description
When the object to be mapped redefined #toString() method we can have the following exception message:
java.lang.RuntimeException: Error setting property 'setPrice' of '32 (name)'. Cause: java.lang.IllegalArgumentException
at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:52)
Furthermore, the value to set is not describe in this message.
A message like the following will ease finding the reason :
java.lang.RuntimeException: Error setting property 'setPrice' for object of type 'com....MyBean' with value of type 'null'. Cause: java.lang.IllegalArgumentException
at com.ibatis.sqlmap.engine.accessplan.PropertyAccessPlan.setProperties(PropertyAccessPlan.java:52)
In my case this was because the database column was null and i was expecting a float which can not be set to null.
This might also come in handy when the type of the setter is not compatible with the type of the value.
Attachments
Attachments
Issue Links
- is related to
-
IBATIS-511 result to bean mapping: value should be included in exception message [patch included]
- Closed