I see examples for getting collections like this:
class Family {
int id;
List children;
}
<resultMap id="familyMap" class="Family" groupBy="id">
<result property="id" column="id" />
<result property="children" resultMap="childMap"/>
</resultMap>
But what about reusing result maps to retrieve nested
objects? I would like to be able to do something like
the following but I haven't been able to succeed:
class Parent {
int id;
Child child;
}
<resultMap id="parentMap" class="Parent">
<result property="id" column="id" />
<result property="child" resultMap="childMap"/>
</resultMap>
See? I am trying to reuse the map, but I keep getting
this error instead: "Error instantiating collection
property for mapping 'child'. Cause:
java.lang.ClassCastException"
Come on iBATIS gurus - show me the answer! :)
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com