IBatis: Iterate over multiple lists at the same time

Problem: 
I needed to verify if each record passed several rules, where each rule consisted of several flags and their values. The problem was complexity: I had 7 flags(which had 3 possible values) to check, and 1 to 5 rules per status. This could lead to some ugly and hard to test SQL. 

Another problem was that you cant iterate over multiple lists at the same time (using the same index) in ibatis. 

Solution: 
The solution was to use Ibatis's Iterate directive. I would iterate over lists of maps, where each map represented a rule, and each bucket of the map represented a flag and its expected value. 

Those iBastis code ended up looking something like this: 

<iterate property="statusRules" open="(" close=")" conjunction="or">
(
<isnotequal property="statusRules[].rule1" comparevalue="NA">
t.some_rule_flag = #statusRules[].rule1#
</isnotequal>
<isnotequal property="statusRules[].rule2" comparevalue="NA">
and nvl(t.some_other_flag, t.another_flag) = #statusRules[].rule2#
</isnotequal>
<isnotequal property="statusRules[].lastRule" comparevalue="NA">
and t.last_flag = #statusRules[].lastRule#
</isnotequal>
)
</iterate>

and the parameter class had the following code: 

private List<HashMap> statusList = new ArrayList<HashMap>();

private void makeRuleList(){
  //these could be created conditionally etc
  statusList.add(makeRuleMap("NA,NA,Y"));
  statusList.add(makeRuleMap("Y,Y,Y"));
  statusList.add(makeRuleMap("N,N,Y"));
}

private static HashMap makeRuleMap(String st){
  HashMap map = new HashMap();
  String[] split = st.split(",");
  String[] rules = "rule1,rule2,lastRule".split(",");
  for(int i = 0; i < split.length; i++){
    map.put(rules[i], split[i]);
  }
  return map;
}

public List<HashMap<String, Object>> getStatusRules(){
  return statusList;
}

This worked pretty well to abstract the flags and rules away from the iBatis sql and keep them all in the rules class. 

AND