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

David Sledge commented on IBATIS-133:
-------------------------------------

@M.H. Avegaart

1. It's not needed.  Essentially, the proposed "signature" and "javaTypes" 
attributes represent the same thing.  Personally, I'd get rid of the "name" 
attribute in addition to removing the "javaTypes" attribute, and just use JVM's 
type signatures 
(http://java.sun.com/javase/6/docs/technotes/guides/jni/spec/types.html#wp9502) 
for the "signature" attribute, which would change

    name="methodName"
    signature="propertyA,propertyB"
    javaTypes="integer,string"

to:

    signature="methodName(ILjava/lang/String;)"

2. Agreed, in which case the "signature" attribute would lack a method name and 
the parenthesis (maybe even change the attribute name to "paramSignature" to 
show the distinction):

Also,

3. Let's not forget about static factory method instantiators:

    <factoryMethod
      paramSignature="ILjava/lang/String;"
      jdbcTypes="INTEGER,VARCHAR"
      columns="PROPERTY_A,PROPERTY_B" />

(I'm not sure how instance factory method instantiators would work.)  Only one 
factoryMethod tag would be allowed and it would be mutually exclusive with the 
constructor tag.

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ibatis.apache.org
For additional commands, e-mail: dev-h...@ibatis.apache.org

Reply via email to