ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gustavo Kuerten <rubyco...@gmail.com>
Subject Re: selectKey for MySql
Date Wed, 02 Feb 2005 06:17:02 GMT
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