You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Glenn Gilbert <Gl...@asx.com.au> on 2005/01/14 01:23:03 UTC

Polymorphism vs SqlMaps

Hi all,
 
I've got two objects: 'Accreditation' and a sub class
'AffiliateAccreditation'. 
In the database, both have records in the ACCREDITATION table, but only the
AffiliateAccreditation has a record in the AFFILIATE_ACCREDITATION table.
 
A 'Contact' has a List of Accreditation's which may be instancesof
AffiliateAccreditation (but all are instances of Accreditation)
 
I implemented a method "getAccreditationsForContactID" which uses a
JdbcTemplate to get this an instantiate the relevant object, but now I would
like to be able to use the "getAccreditationsForContactID" within the
Contact sqlMap 
ie: <result property="accreditations" column="contact_id"
select="Accreditation.getAccreditationsForContactID"/> 
 
Any ideas?
We're using iBatis 2.0.9 via Spring, Oracle 9i