I'm having some difficulty with a custom TypeHandlerCallback. Working from the example in the user docs I implemented the YesNoBoolTypeHandlerCallback. I declared it in my SqlMapConfig.xml file as follows:

<typeAlias alias="Customer" type="com.sybase.cosmos.domain.Customer"></typeAlias>
<typeHandler javaType="boolean" jdbcType="VARCHAR" callback="com.sybase.cosmos.dao.impl.ibatis.extentions.YesNoBoolTypeHandlerCallback" />

I then in the SqlMap that I want to use it in I declare it as follows:
<typeAlias alias="YesNoTypeHandler" type="com.sybase.cosmos.dao.impl.ibatis.extentions.YesNoBoolTypeHandlerCallback"/>
  <resultMap id="CustomerResult" class="Customer">
     <result column="customer_no" property="id" />
     <result column="activeind" property="active" typeHandler="YesNoTypeHandler" />
....

And I also defined a ParamterMap as follows:
  <parameterMap id="CustomerParam" class="Customer" >
        <parameter   property="active"   typeHandler="YesNoTypeHandler" javaType="boolean" jdbcType="VARCHAR" nullValue="N" />
</parameterMap>


The problem that I am having is when pasing a Customer object into the query I am getting an SQLException being thrown stating:
Implicit conversion from datatype 'CHAR' to 'BIT' is not allowed.  Use the CONVERT function to run this query.


It appears that the ParameterMap is not using the YesNoTypeHandler when binding the parameters to the PreparedStatement.  So what am I missing?

Thanks much...

Chris Mathrusse
[EMAIL PROTECTED]
Sybase, Inc
One Sybase Drive
Dublin, CA 94568
(925) 236-5553

Reply via email to