Thanks guys, maybe i wasn't clear enough. What i'd like to have is sql returning two tables. In table one up to hundreds of companies and in the second table the classifications for each (M:M). I've done it before so that i load the companies into a dictionary with id as a key and then add the classifications to each item in the dictionary. If i've understood correctly, this is not possible with ibatis? Lazy loading won't help me as i need to display everything at once, and the join method would lead to whole lot of data loading as there will be several similar collections within company. This is quite a central piece me the app, so i'd like to get it perform well.
On 5/25/07, Nguyen, Tom <[EMAIL PROTECTED]> wrote:
Some documentation here: http://ibatisnet.sourceforge.net/DevGuide.html#d0e997 Regards, Tom Nguyen Sr. Developer [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> ________________________________ From: chook rib [mailto:[EMAIL PROTECTED] Sent: Friday, May 25, 2007 9:41 AM To: [email protected] Subject: Re: Multiple resultsets in data mapper 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> ************************************************************************************ This e-mail message and any files transmitted herewith, are intended solely for the use of the individual(s) addressed and may contain confidential, proprietary or privileged information. If you are not the addressee indicated in this message (or responsible for delivery of this message to such person) you may not review, use, disclose or distribute this message or any files transmitted herewith. If you receive this message in error, please contact the sender by reply e-mail and delete this message and all copies of it from your system. ************************************************************************************

