ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poitras Christian" <Christian.Poit...@ircm.qc.ca>
Subject RE: iBATIS in Action -- Lazy loading only works with Lists??
Date Wed, 10 Jan 2007 22:34:33 GMT
I'm sure you need a List interface.
Set is very unlikely to work since iBATIS does not produce Sets.


From: Todorovich, Milo [mailto:Milo_Todorovich@pamperedchef.com] 
Sent: Wednesday, 10 January 2007 12:24
To: user-java@ibatis.apache.org
Subject: iBATIS in Action -- Lazy loading only works with Lists??

I want to have a bean that I load from the database using iBATIS. The
bean has a collection that I would like to lazy load. Does the
collection have to be an implementation of java.util.List? Or can I use
any collection?

The iBATIS in Action book does not specify that it must be a List. In
addition, on page 11, the books says "iBATIS will work with any
combination of data model and object model. There are nearly no
restrictions or rules to how either is designed." 

However, on page 63 (3.3.1), the discussion mentions only Lists, not
Sets or any other java collection interface. And on pages 128-132 (6.2),
the mapping shown uses names ending in List, implying that the
collections retrieved are Lists.

So, do the lazy loaded collections need to be Lists?? 

Tests that I've ran using version indicate that things work
fine when the collection is a List, and I get exceptions when the
collection is a Set.

Milo Todorovich 

View raw message