ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Aaron Craven" <hibern...@vickerscraven.net>
Subject Avoiding N+1 selects with more complex graphs
Date Wed, 22 Jun 2005 17:09:12 GMT

I cannot decide if I’ve missed something in the documentation, or if I’m just plain old
confused, but either way I need some help.  With iBATIS 2, I realize the N+1 selects problem
has been solved by the addition of the groupBy property.  However, I’m a bit confused as
to how this would be done with a deeper object graph.  For example, suppose I have:

- A Mapping that retrieves a number (M) of customers.  Each customer has, in turn 
- A number (N) of contacts.  Each contact, then has
- A number (P) of addresses.

Which would represent a… M:N:P relationship :)

If I want this all in one mapping (something like CUSTOMER INNER JOIN CONTACTS ON (…) INNER
JOIN ADDRESSES ON (…)), would it be possible, or is the depth of the join limited to one
level of nesting?


Sent via the WebMail system at vickerscraven.net


View raw message