Java MyBatis—迭代列表,该列表是嵌套foreach循环中HashMap的值

Java MyBatis—迭代列表,该列表是嵌套foreach循环中HashMap的值,java,list,foreach,hashmap,mybatis,Java,List,Foreach,Hashmap,Mybatis,其中5800是列表的整数值 感谢您的帮助 table.attribute1=#{element.key} Exception: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression '#{item.value}'. Return value ({[5800]=null}) w

其中5800是列表的整数值

感谢您的帮助

table.attribute1=#{element.key}
Exception:
   org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression '#{item.value}'.  Return value ({[5800]=null}) was not iterable.
#{item}

这个给我修好了

您尝试过没有#{}的item.getValue()吗?当我使用上述方法时,我得到的是NoSuchPropertyException java.lang.String.value
Map<Integer, List<Integer>> myhashmap = new HashMap<Integer, List<Integer>>();
Exception:
   org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderException: Error evaluating expression '#{item.value}'.  Return value ({[5800]=null}) was not iterable.
<foreach item="element" index="index" collection="mySet.entrySet()" open=" WHERE ((" separator=" OR ("> table.attribute1= #{element.key} 
    <foreach item="item" index="index" collection="element.value" separator=" ," open=" AND table.attribute2 IN (" close="))">
       #{item} 
         </foreach> 
 </foreach>