ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brice Ruth <bdr...@gmail.com>
Subject Re: selectKey for MySql
Date Wed, 02 Feb 2005 14:32:56 GMT
Should your resultClass be java.lang.Long instead of just "long" ?


On Wed, 2 Feb 2005 14:17:02 +0800, Gustavo Kuerten <rubycoder@gmail.com> wrote:
> The solution offered by Larry
> http://www.mail-archive.com/ibatis-user-java@incubator.apache.org/msg00673.html
> does not work in my case. Anyone can offer any other insights on the
> problem ? In my case, my id is mapped to a BIGINT in the mysql
> database and is represented as a Long in the Java object. Is this
> mapping correct ?
> 
>   <insert id="insertCurrency" parameterClass="currency">
>     insert into CURRENCY (VERSION, CURRENCY_CODE, COUNTRY)
>     values(NOW(), #currencyCode#, #country#)
>       <selectKey resultClass="long" keyProperty="id">
>         SELECT LAST_INSERT_ID()
>       </selectKey>
>   </insert>
> 
> Thanks
> 
> R
>

Mime
View raw message