[ 
http://issues.apache.org/jira/browse/IBATIS-331?page=comments#action_12426666 ] 
            
Jeff Butler commented on IBATIS-331:
------------------------------------

I propose to fix this by adding code to the SqlMapParser when processing an  
/sqlMap/resultMap node in the addResultMapNodelets() method.

Currently there is code in this method to propogate result mappings and group 
by attributes to extended resultMaps, but no code to propogate nested result 
mappings.  Was this just an oversight, or is there some reason these are not 
propogated?

I've made a change to propogate the nested result mappings (similar to the way 
groupBy attributes are propogated) and all the tests run successfully, but I 
thought I would ask for opinions before a commit.


> Nested Result Mappings are Not Propogated to Extended Result Maps
> -----------------------------------------------------------------
>
>                 Key: IBATIS-331
>                 URL: http://issues.apache.org/jira/browse/IBATIS-331
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: SQL Maps
>    Affects Versions: 2.1.7
>         Environment: All
>            Reporter: Jeff Butler
>         Assigned To: Jeff Butler
>
> Consider this result mapping:
>   <resultMap id="animalWithAttributes" class="test.Animal" groupBy="id">
>     <result property="id" column="animalId" />
>     <result property="attributes" resultMap="animalAttributesMap"/>
>   </resultMap>
>   <resultMap id="extendedAnimalWithAttributes" class="test.AnimalWithType"
>              extends="animalWithAttributes">
>     <result property="type" column="animalType" />
>   </resultMap>
>   <resultMap id="animalAttributesMap" class="test.AnimalAttribute">
>     <result property="attribute" column="attribute"/>
>   </resultMap>
> In this scenario, the nested result map (animalAttributesMap) is not 
> propogated to the extended resultMap (extendedAnimalWithAttributes).  No 
> errors are thrown at run time, but the property related to the nested result 
> map will always be null.

-- 
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

        

Reply via email to