ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Daniel Pitts" <Daniel.Pi...@cnet.com>
Subject RE: Problem addressing list index in a parameter declaration
Date Mon, 30 Oct 2006 21:25:11 GMT
Looks like a problem with the way ibatis handles collections. Is it
possible to iterate over the addresses, rather than manually select [0]
and [1]?
Also, might it be better design (if there is always going to be exactly
two) to have them be individual properties?  streetAddress,
apartmentAddress? I don't know your requirements, obviously, but that
might be a good work-around. 

-----Original Message-----
From: Reuben Firmin [mailto:Reuben.Firmin@Copart.Com] 
Sent: Thursday, October 26, 2006 3:59 PM
To: user-java@ibatis.apache.org
Subject: Problem addressing list index in a parameter declaration

I have the following code:

public class Buyer
    private Address mailingAddress;

public class Address
    private List<String> addressLine;
    public List<String> getAddressLine()

In my insert statement, I'm addressing this as:

#mailingAddress.addressLine[0]#, #mailingAddress.addressLine[1]#,

When I start the webapp, I'm getting this exception:

[15:36:42.468] Caused by: com.ibatis.common.beans.ProbeException: There
is no READABLE property named 'addressLine[0]' in class
[15:36:42.468] at
[15:36:42.468] at
[15:36:42.468] at
[15:36:42.468] at
[15:36:42.468] at

What's wrong with my code?


View raw message