[ http://issues.apache.org/jira/browse/IBATIS-133?page=all ]
Clinton Begin updated IBATIS-133:
---------------------------------
Fix Version: (was: 2.1.5)
Description:
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.
was:
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">
<parameter propertyA" column="PROPERTY_A" />
<parameter propertyB" column="PROPERTY_B" />
<parameter propertyC" column="PROPERTY_C" select="anotherResultMap" />
</method>
</resultMap>
Not sure if we would want to support both or just one type. But, those are the
ideas.
Environment:
> ResultMap Method Mapping
> ------------------------
>
> Key: IBATIS-133
> URL: http://issues.apache.org/jira/browse/IBATIS-133
> Project: iBatis for Java
> Type: New Feature
> Components: SQL Maps
> 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.
-
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