ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "roberto" <robe...@theaegis.org>
Subject RE: N+1 with a twist?
Date Fri, 11 Feb 2005 21:12:29 GMT
If you can, post a sample of the query.  If the query is based on that
example you showed with tables three levels deep it should work (the child
tables are the ones that can be null right?).

Roberto 
 

> -----Original Message-----
> From: Nathan Maves [mailto:Nathan.Maves@Sun.COM]
> Sent: Friday, February 11, 2005 3:55 PM
> To: ibatis-user-java@incubator.apache.org
> Subject: Re: N+1 with a twist?
> 
> This was all looking great but I hit a show stopper.
> 
> I have one parent table with 3 child tables.  The problem is that the
> child rows might or might not be there.  This means that I have to use
> an outer join to these tables.  Oracle only allows a table to have one
> outer join.  Suck!
> 
> Nathan
> 
> On Feb 11, 2005, at 1:37 PM, Clinton Begin wrote:
> 
> > Doesn't matter.  In series, or in parallel, any number of levels, any
> > time any place.  It will work.
> >
> > Each resultMap="" mapping is treated separately.
> >
> > The coolest thing is that to do all of this it still only iterates
> > over the result set a single time...  ;-)
> >
> > Cheers,
> > Clinton
> >
> >
> > On Fri, 11 Feb 2005 12:50:05 -0700, Nathan Maves
> > <Nathan.Maves@sun.com> wrote:
> >> How about 3 levels deep?
> >>
> >> A from request
> >>         List of B from products
> >>         List of C from approvals
> >>                 User object from users (where user's id maps to a
> >> column in the
> >> approvals table)
> >>
> >>
> >> Nathan
> >>
> >> On Feb 9, 2005, at 10:30 AM, Clinton Begin wrote:
> >>
> >>> If you can join the data into a single resultset with repeating
> >>> groups, the N+1 solution will work, no matter how the collections are
> >>> arranged.
> >>>
> >>> As long as you group by some column in table_a, you can separately
> >>> map
> >>> 2 collections on the same class.
> >>>
> >>> This will work.
> >>>
> >>> Try it out!
> >>>
> >>> Clinton
> >>>
> >>> On Wed, 09 Feb 2005 10:21:54 -0700, Nathan Maves
> >>> <Nathan.Maves@sun.com> wrote:
> >>>> I dont think that the current implementation will work for this but
> >>>> I
> >>>> was looking for some best practices on how to do it.
> >>>>
> >>>> Parent Class A has n number of List properties that all come for
> >>>> their
> >>>> own tables.
> >>>>
> >>>> A from table_a
> >>>>         List of B from table_b
> >>>>         List of C from table_c
> >>>>         .
> >>>>         .
> >>>>         .
> >>>>
> >>>>
> >>>> Nathan
> >>>>
> >>>>
> >>
> >>
> 



Mime
View raw message