iBATIS: Extending Your ResultMap
By admin on Jul 28, 2008 in Java, Programming
Here is an useful feature of the ResultMap.
In your iBATIS ResultMap, the optional extends attribute can be set to the name of another parameterMap upon which to base this parameterMap. All properties of the super parameterMap will be included as part of this parameterMap, and values from the super parameterMap are set before any values specified by this parameterMap. The effect is similar to extending a class
<resultMap id=”resultMapName”
class=”some.domain.Class”
[extends=”parent-resultMap”]
[groupBy=“some property list”]>
<result property=”propertyName” column=”COLUMN_NAME”
[columnIndex=”1”] [javaType=”int”] [jdbcType=”NUMERIC”]
[nullValue=”-999999”] [select=”someOtherStatement”]
[resultMap=“someOtherResultMap”]
[typeHandler=“com.mydomain.MyTypehandler”]
/>
Sorry, comments for this entry are closed at this time.