Under de assumption that you just use the select property in the <result property> for University.CollegeList, you have something like this:
List<Univ> universities = ibatis.FindUniversities(); foreach (Univ item in universities) item.CollegeList = ibatis.FindCollegeListByUnivId(item.Id); * one query for all the univs, one query for the collegeList foreach univ = 101 queries If it's much, you can use lazyload. With this, the college queries are executed just when needed (see 3.5.4.9 from the manual) On Tue, May 26, 2009 at 12:46 AM, vinay.a <[email protected]> wrote: > > I need some clarification on how iBatis.net executes the queries in the > 'University-College' scenario. > Assuming that there are 100 Universities and each University may have about > 2-3 Colleges registered under it. > So, in this case how many hits will be there to the database. > And can i find any documentation or articles to understand this. > > thanks and regards, > vinay > > > > > > vinay.a wrote: > > > > Hello all, > > > > I need some help on the below scenario: > > > > I have 2 business objects. Lets say 'University' and 'College'. > > The 'University' object has the following property. > > > > public IList<College> collegelist > > { > > get; > > set; > > } > > > > Now I want to execute a query that groups all the Colleges which come > > under an University, and store the result in the University Object. > > This way I will have one 'University' object (with university details), > > within which i will have an IList<College> with all the details of all > the > > colleges under that university. > > > > Is it possible to achieve this using a query and object mapping in > > ibatis.net > > If not possible, please let me know. > > > > Thanks and regards, > > Vinay A > > > > -- > View this message in context: > http://www.nabble.com/Achieving-Group-By-feature.-tp23706884p23716770.html > Sent from the iBATIS - User - Cs mailing list archive at Nabble.com. > >

