In the C# implementation, we are experimenting with using extends with a parameterMap, since the difference between an Insert and an Update is often whether an additional field is specified (for the WHERE clause).
-Ted.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
is there a way to do this.
e.g rather than do
<resultMap id="sql1" class="aClass">
<result property="one" column="one"/>
</resultMap>
<resultMap id="sql2" class="aClass">
<result property="one" column="one"/>
<result property="two" column="two"/>
</resultMap>
instead do
<resultMap id="sql2" extendId ="sql1" class="aClass">
<result property="two" column="two"/>
</resultMap>
in order to avoid duplication.
The attribute you are looking for is "extends":
<resultMap id=resultMapName class=some.domain.Class [extends=parent-resultMap]>
<result property=propertyName column=COLUMN_NAME
[columnIndex=1] [javaType=int] [jdbcType=NUMERIC]
[nullValue=-999999] [select=someOtherStatement]
/>
<result />
<result />
<result />
</resultMap>
(from page 22 of DevGuide 2)
In the C# implementation, we are experimenting with using extends with a parameterMap, since the difference between an Insert and an Update is often whether an additional field is specified (for the WHERE clause).
-Ted.
Thanks Ted, BTW, i found your struts book excellent