ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman (JIRA)" <ibatis-...@incubator.apache.org>
Subject [jira] Commented: (IBATIS-131) Fix use of list[]-notation in propertyattributes of dynamic tags
Date Mon, 12 Sep 2005 07:17:33 GMT
    [ http://issues.apache.org/jira/browse/IBATIS-131?page=comments#action_12323208 ] 

Niels Beekman commented on IBATIS-131:

I have built iBATIS from the source and tested my code. All works fine, except when dealing
with a 'deeper' iteration, example:

<iterate property="myHashMap.myList"> 
  <isEqual property="myHashMap.myList[].someProperty" compareValue="true"> 

I get the following exception:

Caused by: com.ibatis.common.beans.ProbeException: The 'myHashMap.myList' property of the
java.util.HashMap class is not a List or Array.
	at com.ibatis.common.beans.BaseProbe.getIndexedType(BaseProbe.java:127)
	at com.ibatis.common.beans.GenericProbe.getPropertyTypeForGetter(GenericProbe.java:159)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.ConditionalTagHandler.compare(ConditionalTagHandler.java:98)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.IsEqualTagHandler.isCondition(IsEqualTagHandler.java:21)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.elements.ConditionalTagHandler.doStartFragment(ConditionalTagHandler.java:48)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:157)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:160)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:160)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:160)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.processBodyChildren(DynamicSql.java:99)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.process(DynamicSql.java:79)
	at com.ibatis.sqlmap.engine.mapping.sql.dynamic.DynamicSql.getParameterMap(DynamicSql.java:61)
	at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:156)
	... 17 more

I have debugged this some more and it seems that iBATIS does not respect the dot-notation,
it tries to directly get 'myHashMap.myList' from the map instead of breaking it up (ComplexBeanProbe,
line 75).

Hope this helps,


PS When building from the source using build.xml I get java.lang.NoClassDefFoundErrors about
a couple of Oracle-classes, these are referenced when accessing the ToplinkDaoTransactionManager-class
in the XmlDaoManagerBuilder-constructor, I had to include these Oracle-classes in the build.

> Fix use of list[]-notation in propertyattributes of dynamic tags
> ----------------------------------------------------------------
>          Key: IBATIS-131
>          URL: http://issues.apache.org/jira/browse/IBATIS-131
>      Project: iBatis for Java
>         Type: Bug
>   Components: SQL Maps
>  Environment: All are affected.
>     Reporter: Niels Beekman
>     Assignee: Brandon Goodin
>      Fix For: 2.2.0

> When using an iterate-tag to loop a list, one cannot point to the current element in
attributes of inner tags, for example, the following fails:
> <iterate property="myList">
>   <isEqual property="myList[].someProperty" compareValue="true">
>     $myList[].anotherProperty$
>   </isEqual>
> </iterate>
> iBATIS tries to index the property myList with an empty string, but it should use the
current element (the []-notation works fine within inner tags), when an index is supplied
it works just fine...

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:

View raw message