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:41:12 GMT
sorry, have a slip, this is right

 <resultMaps>
>   <resultMap id="CompanyResult" 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