ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Perry Nguyen <pfngu...@hanhuy.com>
Subject Re: ResultMap, N+1
Date Mon, 16 Jan 2006 21:10:00 GMT
Gareth Moorst wrote:
> I think this is because of a different issue - when dealing with List 
> properties, I believe iBatis creates the list, sets it into the parent 
> class, then adds objects to the lists, so if you are doing any copying 
> of lists in the setAcc(List accs) method, then you will be copying an 
> empty list.
> Hope this helps,
> Gareth Moorst

I'm curious, why doesn't iBATIS do it the other way around?  Why not 
populate the list and then set the property of the bean?

For me, it's a pain because most of my N+1-type objects use arrays and 
not collections, thus I convert the input List into an array on my 
getArrayProperty getter as opposed to converting the list in 
setListProperty.  (Maybe a better answer would be for me to switch to 
Java 5 and use generics?)

View raw message