<p>Is there a way of reusing the same resultMap multiple times in a single query.</p>

<p>For example, suppose I have a "foo" resultMap:</p>

<pre><code>&lt;resultMap id="foo" class="Foo"&gt;
  &lt;result property="Bar" column="bar" /&gt;
&lt;/resultMap&gt;
</code></pre>

<p>Is there a way to define another resultMap that reuses the above for different columns? Something like...</p>

<pre><code>&lt;resultMap id="fizz"class="Fizz"&gt;
  &lt;result property="Foo1" column="bar=bar1" resultMapping="foo" /&gt;
  &lt;result property="Foo2" column="bar=bar2" resultMapping="foo" /&gt;
  &lt;result property="Foo3" column="bar=bar3" resultMapping="foo" /&gt;
&lt;/resultMap&gt;
</code></pre>

Almost.  If you select the ID of the Foo in your query, you can have the Fizz result map execute a SELECT for that ID, which will use the Foo result map.
```
<result property="Foo1" column="bar1Id" select="selectFoo"/>
```
(Assuming you have a
```
selectFoo
```
query defined.)  But that's extremely slow with large result sets, since it does an additional SELECT for every row.
iBATIS has a solution to this problem for the typical case, where you have a composite object that contains various other objects.  First, you define a query that joins your tables, then you can use
```
fooMap
```
to populate a
```
Foo
```
:
```
<result property="Foo1" resultMap="fooMap"/>
```
But you can't use that result map twice for two different
```
Foos
```
because the result map specifies certain column names.  You can use another technique, though:
```
<result property="foo1.bar" column="foo1bar"/>
```
```
<result property="foo2.bar" column="foo2bar"/>
```
More detail in page 35 of the iBatis Datamapper manual.