ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brandon Goodin <brandon.goo...@gmail.com>
Subject Re: Strange Parameter index out of range error
Date Thu, 17 Feb 2005 17:45:44 GMT
"com.mafoi.bats.Image" is not a javaType.

Please read the developers guide. You may consider using a
CustomTypeHandler for what you are trying to do.

Brandon


On Thu, 17 Feb 2005 21:14:31 +0530, Vamsee Kanakala <vamlists@gmail.com> wrote:
> Hello,
> 
>        I'm encountering a persistent error. I'm trying to use a
> parameter map inside my application. Here goes:
> 
> <parameterMap id="studentMap" class="com.mafoi.bats.Student">
>         <parameter property="id"/>
>         <parameter property="name"/>
>         <parameter property="dob"/>
>         <parameter property="doe"/>
>         <parameter property="streamId"/>
>         <parameter property="batchId"/>
>         <parameter property="photo" javaType="com.mafoi.bats.Image"
> jdbcType="bytea"/>
>     </parameterMap>
> 
>     <insert id="insertStudent" parameterMap="studentMap">
>         insert into students (id, name, dob, doe, stream_id, batch_id,
> photo)
>         values (#id#, #name#, to_date(#dob#, 'DD/MM/YYYY'),
>         to_date(#doe#, 'DD/MM/YYYY'), #streamId#, #batchId#, #photo#)
>     </insert>
> 
> This seems perfectly alright to me, but I'm getting this exception:
> 
> javax.servlet.ServletException:
> --- The error occurred in com/mafoi/bats/Student.xml.
> --- The error occurred while applying a parameter map.
> --- Check the studentMap.
> --- Check the parameter mapping for the 'id' property.
> --- Cause: org.postgresql.util.PSQLException: Parameter index out of range.
>         org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:516)
> [...]
> 
> As you can see, I don't think there is anything wrong with the mapping.
> the "Student" class getter/setter or the "id" variable, and it is an
> int. I'm using a custom type handler for "photo" property. Can it be the
> problem? I'm lost. Please help.
> 
> TIA,
> Vamsee.
> 
>

Mime
View raw message