This enhancement can be tracked from JIRA
Key: IBATIS-348
URL: http://issues.apache.org/jira/browse/IBATIS-348
Thx
-Hari
From: Hariharan, Vadivelu (IE10) [mailto: [EMAIL PROTECTED]]
Sent: Friday, September 22, 2006 10:07 AM
To: [email protected]
Subject: RE: Special char in column field (Abator)
I guess Abator generated classes should take note of special chars in columns and should not generate the Java source with the special character
For instance for the given situation abator generate AS400InvoiceTriggerResult class with the field named PVPO#
This is a compilation error in Java, although it doesn't take much to change the generated source, still it is a good to have feature
Thx
-Hari
From: Hariharan, Vadivelu (IE10) [mailto: [EMAIL PROTECTED]]
Sent: Friday, September 22, 2006 10:01 AM
To: [email protected]
Subject: RE: Special char in column field
Wow that really helped, thanks a ton Clinton, appreciate your help
I was cursing ibatis for this J
Here is the correct SqlMap for other folks, notice that I have changed PVPO# to PVPO##
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN" " http://ibatis.apache.org/dtd/sql-map-2.dtd" >
<sqlMap namespace="APIYLIBR_APIPPVRS" >
<resultMap id="abatorgenerated_AS400InvoiceTriggerResultResult" class="com.honeywell.aes.beta1.apiylibr.AS400InvoiceTriggerResult " >
<!--
WARNING - This element is automatically generated by Abator for iBATIS, do not modify.
This element was generated on Thu Sep 14 09:42:05 GMT+05:30 2006.
-->
<result column="PVTRNK" property="pvtrnk" jdbcType="NUMERIC" />
<result column="PVCNUM" property="pvcnum" jdbcType="CHAR" />
<result column="PVPFND" property="pvpfnd" jdbcType="CHAR" />
<result column="PVPERR" property="pvperr" jdbcType="CHAR" />
<result column="PVINVD" property="pvinvd" jdbcType="NUMERIC" />
<result column="PVPO#" property="pvpo" jdbcType="CHAR" />
</resultMap>
<resultMap class="com.honeywell.aes.beta1.apiylibr.AS400InvoiceTriggerResult" id="AS400InvoiceTriggerResultResult">
<result property="pvtrnk"/>
<result property="pvcnum"/>
<result property="pvpfnd"/>
<result property="pvperr"/>
<result property="pvinvd"/>
<result property="pvpo"/>
</resultMap>
<select id="getAS400InvoiceTriggerResultResult" resultMap="AS400InvoiceTriggerResultResult" parameterClass=" java.lang.Long" >
select DISTINCT PVTRNK, PVCNUM, PVPFND, PVPERR, PVINVD, PVPO##
from APIYLIBR.APIPPVRS
WHERE PVTRNK = #triggerId#
</select>
</sqlMap>
From: Clinton Begin [mailto: [EMAIL PROTECTED]]
Sent: Friday, September 22, 2006 9:50 AM
To: [email protected]
Subject: Re: Special char in column field
Double it up to escape it.
PVPO##
Cheers,
ClintonOn 9/21/06, Hariharan, Vadivelu (IE10) < [EMAIL PROTECTED]> wrote:
Hi,
I have a situation where is the column has a special character, "PVPO#"
I'm getting an exception when Spring loads my Ibatis files, is there any workaround for this issue
Error "Incorrect inline parameter map format"
<sqlMap namespace="APIYLIBR_APIPPVRS" >
<resultMap id="abatorgenerated_AS400InvoiceTriggerResultResult" class="com.honeywell.aes.beta1.apiylibr.AS400InvoiceTriggerResult " >
<!--
WARNING - This element is automatically generated by Abator for iBATIS, do not modify.
This element was generated on Thu Sep 14 09:42:05 GMT+05:30 2006.
-->
<result column="PVTRNK" property="pvtrnk" jdbcType="NUMERIC" />
<result column="PVCNUM" property="pvcnum" jdbcType="CHAR" />
<result column="PVPFND" property="pvpfnd" jdbcType="CHAR" />
<result column="PVPERR" property="pvperr" jdbcType="CHAR" />
<result column="PVINVD" property="pvinvd" jdbcType="NUMERIC" />
<result column="PVPO#" property="pvpo" jdbcType="CHAR" />
</resultMap>
<resultMap class="com.honeywell.aes.beta1.apiylibr.AS400InvoiceTriggerResult" id="AS400InvoiceTriggerResultResult">
<result property="pvtrnk"/>
<result property="pvcnum"/>
<result property="pvpfnd"/>
<result property="pvperr"/>
<result property="pvinvd"/>
<result property="pvpo"/>
</resultMap>
<select id="getAS400InvoiceTriggerResultResult" resultMap="AS400InvoiceTriggerResultResult" parameterClass=" java.lang.Long" >
select DISTINCT PVTRNK, PVCNUM, PVPFND, PVPERR, PVINVD, PVPO#
from APIYLIBR.APIPPVRS
WHERE PVTRNK = #triggerId#
</select>
</sqlMap>
Thx.
-Hari
For now you can deal with this situation by adding a <columnOverride> to your Abator configuration for this table - you can rename the generated property.
I'll also make a change in Abator to deal with this situation as you've requested in the JIRA ticket.
Jeff Butler
On 9/21/06, Hariharan, Vadivelu (IE10) <[EMAIL PROTECTED]> wrote:
