If you are asking simply for the resultmap, I think you want the
"extends" keyword...
<resultMaps>
<resultMap id="PersonResultMap" class="Person" >
<result column="PersonID" property="PersonID" />
<result column="Name" property="Name" />
<result column="Address" property="Address" />
</resultMap>
<resultMap id="StudentResultMap" class="Student"
extends="PersonResultMap">
<result column="StudentID" property="StudentID" />
<result column="Grade" property="Grade" />
</resultMap>
</resultMaps>
On 12/5/06, Dorin Manoli <[EMAIL PROTECTED]> wrote:
Can anyone give response? I can't find reply emails through Archive search.
I'm facing the same problem.
________________________________
From: Anderson Forteleza [mailto:[EMAIL PROTECTED]
Sent: Thursday, September 28, 2006 2:05 PM
To: [email protected]
Subject: Question about Inheritance Support
Hello ! I'm new to iBatis and I'm trying to setup resultMaps with
inheritance support. I've read the Data Mapper Guide v1.5.1 section 3.5.6
but the case studied there is not the same as the case I have here, my case
is really simple, I have 2 tables and 2 classes:
Person
=====
PersonID
Name
Address
Student
======
StudentID
PersonID
Grade
public class Person { ... }
public class Student : Person { ... }
My idea was that I could setup 2 resultMaps, Person and Student, and relate
them with inheritance, meaning that when I called the resultMap for the
Student it would also call the resultMap for Person, but I don't know if
that is possible. Can somebody give me a hand on how to deal with that
problem ? I just didn't want to have one select for Person and a JOIN select
for Student.
thank you
Anderson Fortaleza