In the 1.x Java version, we did not have a built-in n+1 solution - i have used a row handler (row delegate in c#) to do it, and it works pretty easy.
Larry On 8/16/05, Shawn Smiley <[EMAIL PROTECTED]> wrote: > > Unfortunately using lazyLoad doesn't help since I need > the data at all three levels for display on the page. > > Are there any recommended workarounds for solving the > N+1 Select List problem until it's properly > implemented in the C# version of iBatis? > > > Thanks, > Shawn > > --- Roberto R <[EMAIL PROTECTED]> wrote: > > > You can try lazyLoad="true" for the select > > attribute. > > > > On the Java-side, there's the "group by" attribute > > (feature request for > > C#?): > > > > > http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+get+around+the+N+Plus+1+selects+problem%3F > > > > Roberto > > > > > > > > On 8/16/05, Shawn Smiley <[EMAIL PROTECTED]> > > wrote: > > > > > > Is it possible to populate an object tree from a > > > single query? Here is an example of what I'm > > trying > > > to do: > > > > > > I have an Orders table which is a parent to an > > > OrderDetails table which references a Products > > table. > > > I also have C# classes that mirror the fields in > > each > > > table. > > > > > > I want to run a single query like: > > > SELECT O.*, OD.*, P.* > > > FROM Orders O > > > INNER JOIN OrderDetails OD ON O.OrderID=OD.OrderID > > > INNER JOIN Products P ON OD.ProductID=P.ProductID > > > WHERE O.OrderID=#value# > > > > > > And have iBatis generate 1 Order object that > > contains > > > an IList of OrderDetail objects with each > > OrderDetail > > > Object having a Product object. > > > > > > Currently I'm doing this using the select > > attribute on > > > the result field in the data map. Unfortunately > > I'm > > > already seeing performance problems in my > > development > > > environment with just a handful of records in the > > dev > > > database. > > > > > > So what is the best way to accomplish my goal? Do > > I > > > need to write a custom data handler and have that > > > parse the result set into the individual objects? > > > > > > Thanks, > > > Shawn. > > > > > > __________________________________________________ > > > Do You Yahoo!? > > > Tired of spam? Yahoo! Mail has the best spam > > protection around > > > http://mail.yahoo.com > > > > > > > > > > ____________________________________________________ > Start your day with Yahoo! - make it your home page > http://www.yahoo.com/r/hs > >

