[ 
https://issues.apache.org/jira/browse/IBATIS-133?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12629882#action_12629882
 ] 

Dan Nathanson commented on IBATIS-133:
--------------------------------------

This has been available in iBatis for .NET for a couple of years.  It was added 
under IBATISNET-155.  I would expect that the Java and .NET are very similar in 
this area of the framework so the changes should be easily ported.  But I 
haven't looked at either code line, so that assumption could be totally off 
base.

> ResultMap Method Mapping
> ------------------------
>
>                 Key: IBATIS-133
>                 URL: https://issues.apache.org/jira/browse/IBATIS-133
>             Project: iBatis for Java
>          Issue Type: New Feature
>          Components: SQL Maps
>    Affects Versions: 2.1.0
>            Reporter: Brandon Goodin
>
> Method mapping should be supported in ibatis to map to non-javaBean methods.
> Following are some whiteboard ideas for this:
> A standard verbose mapping -
> <resultMap>
>   <method 
>     name="methodName" 
>     signature="propertyA,propertyB" 
>     javaTypes="integer,string"
>     jdbcTypes="INTEGER,VARCHAR"
>     columns="PROPERTY_A,PROPERTY_B" />
> </resultMap>
> If types map cleanly between columns and java types some configuration can be 
> avoided -
> <resultMap>
>   <method 
>     name="methodName" 
>     signature="propertyA,propertyB" 
>     columns="PROPERTY_A,PROPERTY_B" />
> </resultMap>
> column Indexes should also be supported -
> <resultMap>
>   <method 
>     name="methodName" 
>     signature="propertyA,propertyB" 
>     columnIndexes="3,8" />
> </resultMap>
> we could also use the method mapping for constructors as well. Only one 
> constructor method type can exist per resultMap. type="method" would be the 
> default unspecified method type.
> <resultMap>
>   <method
>     type="constructor" 
>     name="methodName" 
>     signature="propertyA,propertyB" 
>     columnIndexes="3,8" />
> </resultMap>
> Something else to consider is how a method signature can be mapped to both 
> complex objects and simple objects. Perhaps we need to go with a more verbose 
> mapping.
> <resultMap>
>   <method type="standard" name="methodName"> 
>     
>     
>     
>   </method>
> </resultMap>
> Not sure if we would want to support both or just one type. But, those are 
> the ideas.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to