ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Koka Kiknadze" <226...@gmail.com>
Subject Re: how to deal with one-to-many relationship?
Date Fri, 27 Oct 2006 19:07:16 GMT
Nathan,

I think the problem here is not the N+1 one. The Order object has a
list of OrderLineItem
objects. But one may want each instance of OrderLineItem to hold reference
to the parent Order object...

IMHO there's no way to achieve it using only XML file. I recall I've used
workaround like this:

immediatly after calling get findOrderById(String oredrID) i
programmatically looped through resultOrder.getOrderLineItems() and set
order to resultOrder.

Although usually I do not need the child list objects to hold reference to
the parent object, I believe it will be handy feature to make it possible
without such extra loops (or custom rowhandlers...)

Koka

Mime
View raw message