On Mon, Aug 08, 2005 at 07:46:51PM +0200, Niels Beekman wrote:
> Read carefully, my second sample uses the list directly:
> 
> > When passing the list directly as argument use:
> > 
> > <iterate open="(" close=")">
> >   #[]#
> > </iterate>

what's wrong here:


  <select id="getRules" parameterClass="list"
  resultClass="com.greenvalley.TMS.MML.Entity.Rule">SELECT rule_id,
  name, description FROM rule 
  <dynamic prepend=" WHERE ">
      <iterate property="something" prepend=" rule_id in " open="(" close=")" 
conjunction=",">
          #something[]#
      </iterate>
  </dynamic>
  </select>

?

the error is

--- The error occurred in iBATIS/Rule.xml.  
--- The error occurred while preparing the mapped statement for execution.  
--- Check the getRules.  
--- Check the parameter map.  
--- Cause: java.lang.StringIndexOutOfBoundsException: String index out of 
range: -2
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
range: -2
com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in iBATIS/Rule.xml.  
--- The error occurred while preparing the mapped statement for execution.  
--- Check the getRules.  
--- Check the parameter map.  
--- Cause: java.lang.StringIndexOutOfBoundsException: String index out of 
range: -2
Caused by: java.lang.StringIndexOutOfBoundsException: String index out of 
range: -2
        at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
        at 
com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
        at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
        at 
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
        at 
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
        at 
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)

-- 
Eugene N Dzhurinsky

Reply via email to