Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
DataMapper 1.6.1
-
None
Description
If class for result map is dictionary (or inherits dictionary) it is not
possible to use nested result maps to put complex objects into dictionary.
The problem is in ResultProperty.MemberType property. Currently it is
implemented like this:
public virtual Type MemberType
{
get
}
But if the class for result map is dictionary, _setAccessor is null then
this getter is called from Get method of PropertyStrategyFactory class (line
88). We propose to change it to:
public virtual Type MemberType
{
get
{
if (_setAccessor != null)
if (_nestedResultMap != null)
{ return _nestedResultMap.Class; } throw new IBatisNetException(
String.Format(CultureInfo.InvariantCulture,
"Could not resolve member type for result property '
'. Neither
nested result map nor typed setter was provided.",
_propertyName));
}
}
In this case if set accessor is not initialized yet but nested result map is
set, class from nested result map is used. Maybe this getter can also
consider CLRType if nothing else is provided.
Currently we are using 'patched' version of iBATIS but we would like to get
back to mainline when these issues are fixed.