ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Multiple Joins
Date Fri, 20 Oct 2006 12:20:49 GMT
This really isn't that difficult.  Join your three tables in the query, then
do a groupBy on the nested result maps.  Have you tried it?

<resultMap id="t1" class="T1Class" groupBy="t1key">
  ...
  <result column="t2Objects" resultMap="t2"/>
</resultMap>

<resultMap id="t2" class="T2Class" groupBy="t2key">
  ...
  <result column="t3Objects" resultMap="t3"/>
</resultMap>

<resultMap id="t3" class="T3Class">
  ...
</resultMap>

You can carry this on for as many tables as you need.

Jeff Butler



On 10/20/06, soussou97 <dboussebha@yahoo.fr> wrote:
>
>
> Hi Larry;
>
> I see already this example it shows a simple example with  only one join
> but
> a multiple Joins (with for example 3 tables : T1 => 1..* T2 => 1..*T3).
>
>
> Larry Meadors-2 wrote:
> >
> > Try:
> >
> >
> http://opensource.atlassian.com/confluence/oss/display/IBATIS/How+do+I+get+around+the+N+Plus+1+selects+problem
> >
> >  - or (same page, shorter link) -
> >
> > http://tinyurl.com/ydbn4c
> >
> > Also, please spend some time looking at the WIKI, almost every new
> > user question is covered there.
> >
> > Larry
> >
> >
> > On 10/19/06, soussou97 <dboussebha@yahoo.fr> wrote:
> >>
> >> Hi;
> >>
> >> I Search an example of code source with mutltiple joins implying lists
> :
> >>
> >> T1 => 1..*T2 => 1..*T3 => 1..1 T4 or any exemple with several tables
> and
> >> java beans and list of objects.
> >>
> >> Regards;
> >> --
> >> View this message in context:
> >> http://www.nabble.com/Multiple-Joins-tf2472615.html#a6894554
> >> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
> >>
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Multiple-Joins-tf2472615.html#a6911430
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message