ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karen Koch <kmk...@sbcglobal.net>
Subject Modeling 1:N where N=0
Date Fri, 25 Feb 2005 20:23:03 GMT

Sorry if this winds up being a duplicate submission, but I sent this this morning and it doesn't
appear to have posted to the list yet...

In a situation where one domain object has a complex property (java.util.List
of objects of another type), and you've modeled that 1:N relationship using the
new 2.0.9 groupBy feature to nest ResultMaps... Say the number of child records
is zero, but you still want to populate the parent object. Do you write your
select statement with an outer join? Will executing that statement result in a
populated parent object with an empty List?

This is what I've tried, and it doesn't seem to be working for me. It appears
as if iBATIS is still trying to create one child object based on the child
ResultMap and is looking for me to provide specify nullValues for each field. 
This isn't really the behavior I want. Any suggestions?

Karen Koch
Programmer/Analyst
Information Development Consultants
Chicago, 

Mime
View raw message