ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chook rib" <chook...@gmail.com>
Subject Re: Multiple resultsets in data mapper
Date Fri, 25 May 2007 14:37:34 GMT
Is this you want?

<resultMaps>
  <resultMap id="CompanyCurveResult" class="Company">
   <result property="Id" column="CompanyId" />
   <result property="Name" column="CompanyName" />
   <result property="Classifications" column="CompanyId"
select="SelectClassifications" lazyLoad="true" />
  </resultMap>
  <resultMap id="ClassificationResult" class="Classification">
   <result property="Id" column="ClassificationId" />
   <result property="Name" column="ClassificationName" />
  </resultMap>
 </resultMaps>
 <statements>
  <select id="SelectCompanies" resultMap="CompanyResult">
   SELECT CompanyId, CompanyName FROM Company
  </select>
  <select id="SelectClassifications" parameterClass="int"
resultMap="ClassificationResult">
   SELECT CompanyId, ClassificationId, ClassificationName FROM
CompanyClassification INNER JOIN Classification ON
CompanyClassification.ClassificationId=Classification.ClassificationId;
  </select>
</statements>

Mime
View raw message