ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Seth Helstrip <seth_helst...@yahoo.com>
Subject Re: The error occurred while applying a parameter map.
Date Wed, 20 Aug 2008 16:21:15 GMT
You're not the Jeff Butler who I worked with at Oracle
in 2000 are you?

--- Jeff Butler <jeffgbutler@gmail.com> wrote:

> deptNum and year must be properties of a single
> parameter object (or a
> Map).  The method you are calling passes NO
> parameter objects to iBATIS -
> arg1 and arg2 in this case are skip and max
> parameters for paging support.
> 
> Also, you don't need to specify both column and
> columnIndex in your result
> mappings.  If you specify both the columnIndex will
> be,
> essentially, ignored.
> 
> Jeff Butler
> 
> On Wed, Aug 20, 2008 at 10:29 AM, macdoug1
> <macdoug1@swbell.net> wrote:
> 
> >
> > I'm using Spring framework with iBatis and I'm
> having an issue with using
> > the
> > sqlMapClient.queryForList(String arg, int arg1,
> int arg2). Anyway the
> > Transfer Object is deptNum and year are defined as
> String's. Also the table
> > defines dept_num and year as varchars.  Here's the
> resultMap:
> > <resultMap id="result"
> class="com.talisen.domain.DeptBsDetail">
> >    <result property="deptNum" column="dept_num"
> columnIndex="1"/>
> >    <result property="year" column="year"
> columnIndex="2"/>
> >    <result property="monthDate"
> column="month_date" columnIndex="3"/>
> >    <result property="wopm1" column="wopm1"
> columnIndex="4"/>
> >    <result property="wonum" column="wonum"
> columnIndex="5"/>
> >    <result property="usageCost"
> column="usage_cost" columnIndex="6"/>
> >    <result property="materialCost"
> column="material_cost" columnIndex="7"/>
> >    <result property="laborCost"
> column="labor_cost" columnIndex="8"/>
> >    <result property="serviceCost"
> column="serv_cost" columnIndex="9"/>
> >    <result property="totalCost"
> column="total_cost" columnIndex="10"/>
> >    <result property="wopm4" column="wopm4"
> columnIndex="11"/>
> >    <result property="description"
> column="description" columnIndex="12"/>
> >    <result property="ledgerCode"
> column="ledger_code" columnIndex="13"/>
> >    <result property="yearmonth" column="yearmonth"
> columnIndex="14"/>
> >  </resultMap>
> >
> >  <select id="getDeptBudgetDetailbyDeptNumAndYear"
> resultMap="result">
> >    select
> >          dept_bs_detail_yymm.dept_num,
> >          dept_bs_detail_yymm.year,
> >          dept_bs_detail_yymm.month_date,
> >          dept_bs_detail_yymm.wopm1,
> >          dept_bs_detail_yymm.wonum,
> >          dept_bs_detail_yymm.usage_cost,
> >          dept_bs_detail_yymm.material_cost,
> >          dept_bs_detail_yymm.labor_cost,
> >          dept_bs_detail_yymm.serv_cost,
> >          dept_bs_detail_yymm.total_cost,
> >          dept_bs_detail_yymm.wopm4,
> >          dept_bs_detail_yymm.description,
> >          dept_bs_detail_yymm.ledger_code,
> >          dept_bs_detail_yymm.yearmonth
> >    from dept_bs_detail_yymm
> >    where dept_bs_detail_yymm.dept_num = #deptNum#
> >    and dept_bs_detail_yymm.year = #year#
> >  </select>
> >
> > Here's the full error I'm getting:
> >
> com.ibatis.common.jdbc.exception.NestedSQLException:
> > --- The error occurred in
> com/talisen/dao/ibatis/maps/DeptBsDetail.xml.
> > --- The error occurred while applying a parameter
> map.
> > --- Check the
>
getDeptBudgetDetailbyDeptNumAndYear-InlineParameterMap.
> > --- Check the parameter mapping for the 'year'
> property.
> > --- Cause:
> java.lang.ArrayIndexOutOfBoundsException: 1
> >        at
> >
> >
>
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryWithCallback(MappedStatement.java:204)
> >        at
> >
> >
>
com.ibatis.sqlmap.engine.mapping.statement.MappedStatement.executeQueryForList(MappedStatement.java:139)
> >        at
> >
> >
>
com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:567)
> >        at
> >
> >
>
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:126)
> >        at
> >
> >
>
com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:130)
> >        at
> >
> >
>
com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:106)
> >        at
> >
> >
>
com.talisen.dao.ibatis.SqlMapDeptBsDetailDao.getDeptBudgetDetail(SqlMapDeptBsDetailDao.java:37)
> >        at
> >
> >
>
com.talisen.domain.logic.NestleDataFetcherImpl.getDeptBudgetDetail(NestleDataFetcherImpl.java:58)
> >        at
> sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> >        at
> >
> >
>
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >        at
> >
> >
>
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >        at
> java.lang.reflect.Method.invoke(Method.java:585)
> >        at
> >
> >
>
org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
> >        at
> >
> >
>
org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
> >        at
> >
> >
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
> >        at
> >
> >
>
org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)
> >        at
> >
> >
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >        at
> >
> >
>
org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
> >        at
> >
> >
>
org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
> >        at
> >
> >
>
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
> >        at $Proxy16.getDeptBudgetDetail(Unknown
> Source)
> >        at
> >
>
com.talisen.domain.util.XMLBuilder.createDepartmentXML(XMLBuilder.java:254)
> >        at
>
com.talisen.domain.util.XMLBuilder.createXML(XMLBuilder.java:223)
> >        at
> >
> >
>
com.talisen.service.NestleService.handleRequestInternal(NestleService.java:143)
> >        at
> >
> >
>
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
> >        at
> >
> >
>
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
> >        at
> >
> >
>
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
> >        at
> >
> >
>
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
> >        at
> >
> 
=== message truncated ===



      

Mime
View raw message