Clinton wrote:  N+1 selects the other way around is a 1:1 or an M:1 relationship
(child has ref to parent), which iBATIS has always supported through
nested property mappings in the resultMap...for example:

<result property "product.id" column"PRODUCT_ID" />
<result property "product.name" column"PRODUCT_NAME" />

Doing the mapping in code is fine, it's just more work for you.  It
gets a lot harder when you have 2 or 3 relationships....which iBATIS
supports out of the box.



Yes! :) Can I ask another question regarding simple joins: do you have any knowledge
of JDBC drivers doing some sort of optimisations to avoid duplicating the parent
table's records. (In an earlier post we spoke about the increase in payload size and was
wondering if JDBC itself handled the "normalised" (if-u-will) resultset in transit?)


Overall, each application will have different needs.  Some will work
best with immediate load (multiple queries, same connection), otherw
will work best with lazy load (multiple queries, different
connection), and others still will require the N+1 selects solution
(single query, single connection).

I just wanted to make sure nobody was painting all solutions with the
same brush.... ;-)


For sure!



Reply via email to