ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Javier Leyba" <xle...@gmail.com>
Subject Re: selectKey problem
Date Tue, 24 Oct 2006 07:06:22 GMT
On 10/23/06, Larry Meadors <lmeadors@apache.org> wrote:
> That message looks iffy at best - I'd try w/o the resultClass on the
> the <insert> element. It should not needed in any case...same with the
> type attribute, but you should probably set the keyProperty attribute
> on the <selectKey> element.
>
> So..something like this:
>
> <insert id="insertNotification" parameterMap="insertNotificationParam">
>   insert into blah...
>   <selectKey resultClass="long" keyProperty="yourIdPropName">
>     SELECT LAST_INSERT_ID() AS value;
>   </selectKey>
> </insert>
>


Thanks for your reply.

I´ll not use generated id in the whole insert, I need to use it in my
code in other inserts that dependes of this.

Then:

1 - Could I avoid to keep keyProperty property ?

2 - Should the insert return my generated id ?

Thanks in advance

J

Mime
View raw message