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>

Reply via email to