[ http://issues.apache.org/jira/browse/IBATIS-361?page=comments#action_12445958 ] Reuben Firmin commented on IBATIS-361: --------------------------------------
Thanks for looking at this Christian. The GenericProbe snippet that I looked at *might* be OK, although if the array checking logic was moved to the first clause (and the instanceof Class to the last) of the if statement, my sqlmap would parse correctly. However, going backwards up the stack, I don't see how any object coming in would NOT be an instanceof Class, so that might be the actual bug. See the following code InlineParameterMap: 201 private TypeHandler resolveTypeHandler(TypeHandlerFactory typeHandlerFactory, Class clazz, String propertyName, String javaType, String jdbcType) { ... 229 Class type = PROBE.getPropertyTypeForGetter(clazz, propertyName); --> GenericProbe: 151 public Class getPropertyTypeForGetter(Object object, String name) { if (object instanceof Class) { return getClassPropertyTypeForGetter((Class) object, name); } else [never reached from above flow, breakage ensues w/ list] Working still further back up the chain, the class is passed down from SqlStatementParser # 428, which looks to be fairly early on in the process. Does anybody have any code where addressing a list from an inline parameter map works? > Problem addressing list index in a parameter declaration > --------------------------------------------------------- > > Key: IBATIS-361 > URL: http://issues.apache.org/jira/browse/IBATIS-361 > Project: iBatis for Java > Issue Type: Bug > Components: SQL Maps > Affects Versions: 2.2.0 > Reporter: Reuben Firmin > > 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: > ... > [11:08:02.736] Caused by: com.ibatis.common.beans.ProbeException: There is no > READABLE property named 'addressLine[0]' in class > 'com.copart.c2.buyer.bo.Address' > [11:08:02.736] at > com.ibatis.common.beans.ClassInfo.getGetterType(ClassInfo.java:240) > [11:08:02.736] at > com.ibatis.common.beans.GenericProbe.getClassPropertyTypeForGetter(GenericProbe.java:221) > [11:08:02.736] at > com.ibatis.common.beans.GenericProbe.getPropertyTypeForGetter(GenericProbe.java:153) > [11:08:02.736] at > com.ibatis.sqlmap.engine.mapping.parameter.InlineParameterMapParser.resolveTypeHandler(InlineParameterMapParser.java:229) > [11:08:02.736] at > com.ibatis.sqlmap.engine.mapping.parameter.InlineParameterMapParser.newParseMapping(InlineParameterMapParser.java:138) > [11:08:02.736] at > com.ibatis.sqlmap.engine.mapping.parameter.InlineParameterMapParser.parseInlineParameterMap(InlineParameterMapParser.java:50) > [11:08:02.736] at > com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.applyInlineParameterMap(SqlStatementParser.java:428) > [11:08:02.736] at > com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.processSqlStatement(SqlStatementParser.java:216) > [11:08:02.736] at > com.ibatis.sqlmap.engine.builder.xml.SqlStatementParser.parseGeneralStatement(SqlStatementParser.java:121) > [11:08:02.736] at > com.ibatis.sqlmap.engine.builder.xml.SqlMapParser$19.process(SqlMapParser.java:553) > [11:08:02.736] at > com.ibatis.common.xml.NodeletParser.processNodelet(NodeletParser.java:111) > I will debug further and will append to this bug. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira