ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todorovich, Milo" <Milo_Todorov...@pamperedchef.com>
Subject iBATIS in Action -- Lazy loading only works with Lists??
Date Wed, 10 Jan 2007 17:23:34 GMT
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