title: Iterating list of user defined objects using mybatis/ibatis in java
body: <p>I have an existing query in mybatis as below.</p>
  
  <pre><code>    &lt;select id="getVessslScore" parameterType = "com.dpworld.mpc.camel.cxfrs.model.FilterCriteria" resultMap="vesselDetailResultMap"&gt;
  
      select SUM(msm.MSM_SCORE) Score 
      FROM mpc_score_master msm 
      WHERE msm.MSM_SCORE_TYPE='MPCSCR' AND
       (
       msm.IS_VALID='1' 
       )
      AND 
      (
      msm.MSM_CRIT_TYPE='VSLTYP' AND msm.MSM_CRIT_VAL= #{scoreAttrVslType} 
              OR 
       msm.MSM_CRIT_TYPE='SRVTYP' AND msm.MSM_CRIT_VAL = #{scoreAttrSrvType}
              OR 
       msm.MSM_CRIT_TYPE='SLATYP' AND msm.MSM_CRIT_VAL = #{scoreAttrSlaType}
              OR 
       msm.MSM_CRIT_TYPE='PRFTYP' AND msm.MSM_CRIT_VAL = #{scoreAttrPrfmType}
      )       
  &lt;/select&gt;
  </code></pre>
  
  <p>The model class(FilterCriteria) used in the query as below :</p>
  
  <pre><code>public class FilterCriteria implements Serializable {
  
    private static final long serialVersionUID = 5466202311142514198L;
  
    private String rotationNumbers;
    private String terminalId;
    private String vesselName;
    private String imoCode;
    private String pNam;
    private List&lt;String&gt; listRotations;
    private List&lt;String&gt; listTerminals;
    private List&lt;String&gt; vesselList ;
    private String vsrc; 
    private String veta; 
    private String scoreAttrVslType;
    private String scoreAttrSrvType;
    private String scoreAttrSlaType;
    private String scoreAttrPrfmType;
    private String scoreAttrCurrStatus;
    private String proforma;
  
  
    public String getTerminalId() {
      return terminalId;
    }
  
    public void setTerminalId(String terminalId) {
      this.terminalId = terminalId;
    }
  
    public String getRotationNumbers() {
      return rotationNumbers;
    }
  
    public void setRotationNumbers(String rotationNumbers) {
      this.rotationNumbers = rotationNumbers;
    }
  
    public String getVesselName() {
      return vesselName;
    }
  
    public void setVesselName(String vesselName) {
      this.vesselName = vesselName;
    }
  
    public String getImoCode() {
      return imoCode;
    }
  
    public void setImoCode(String imoCode) {
      this.imoCode = imoCode;
    }
  
    public String getpNam() {
      return pNam;
    }
  
    public void setpNam(String pNam) {
      this.pNam = pNam;
    }
  
    public List&lt;String&gt; getListRotations() {
      return listRotations;
    }
  
    public void setListRotations(List&lt;String&gt; listRotations) {
      this.listRotations = listRotations;
    }
  
    public List&lt;String&gt; getListTerminals() {
      return listTerminals;
    }
  
    public void setListTerminals(List&lt;String&gt; listTerminals) {
      this.listTerminals = listTerminals;
    }
  
    public List&lt;String&gt; getVesselList() {
      return vesselList;
    }
  
    public void setVesselList(List&lt;String&gt; vesselList) {
      this.vesselList = vesselList;
    }
  
    public String getVsrc() {
      return vsrc;
    }
  
    public void setVsrc(String vsrc) {
      this.vsrc = vsrc;
    }
  
    public String getVeta() {
      return veta;
    }
  
    public void setVeta(String veta) {
      this.veta = veta;
    }
  
  
    public String getScoreAttrVslType() {
      return scoreAttrVslType;
    }
  
    public void setScoreAttrVslType(String scoreAttrVslType) {
      this.scoreAttrVslType = scoreAttrVslType;
    }
  
    public String getScoreAttrSrvType() {
      return scoreAttrSrvType;
    }
  
    public void setScoreAttrSrvType(String scoreAttrSrvType) {
      this.scoreAttrSrvType = scoreAttrSrvType;
    }
  
    public String getScoreAttrSlaType() {
      return scoreAttrSlaType;
    }
  
    public void setScoreAttrSlaType(String scoreAttrSlaType) {
      this.scoreAttrSlaType = scoreAttrSlaType;
    }
  
    public String getScoreAttrPrfmType() {
      return scoreAttrPrfmType;
    }
  
    public void setScoreAttrPrfmType(String scoreAttrPrfmType) {
      this.scoreAttrPrfmType = scoreAttrPrfmType;
    }
  
  
    public String getScoreAttrCurrStatus() {
      return scoreAttrCurrStatus;
    }
  
    public void setScoreAttrCurrStatus(String scoreAttrCurrStatus) {
      this.scoreAttrCurrStatus = scoreAttrCurrStatus;
    }
  
    public String getProforma() {
      return proforma;
    }
  
    public void setProforma(String proforma) {
      this.proforma = proforma;
    }
  
  }
  </code></pre>
  
  <p>Currently its working single filter criteria object. Now i need to change the query to accept list of filter criteria objects.</p>
  
  <p>I am trying with the below query but its not working .Please provide some pointers to resolve the issue.</p>
  
  <pre><code>          &lt;select id="getVessslScoreQuery" parameterClass = "java.util.List" &gt;
  
            select SUM(msm.MSM_SCORE) Score 
            FROM mpc_score_master msm 
            WHERE msm.MSM_SCORE_TYPE='MPCSCR' AND
            (
            msm.IS_VALID='1' 
             )
            AND 
            ( msm.MSM_CRIT_TYPE, msm.MSM_CRIT_VAL ) in 
      &lt;iterate open="(" close=")" conjunction="," &gt;
              ( 'VSLTYP' , #[].scoreAttrVslType# )
               ,
                ( 'SRVTYP' , #[].scoreAttrSrvType# )
                ,
                 ( 'SLATYP' , #[].scoreAttrSlaType# )
                 ,
                  ( 'PRFTYP' , #[].scoreAttrPrfmType# )
      &lt;/iterate&gt;         
     &lt;/select&gt;
  </code></pre>