ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: [ibatis 3] insert return generated id?
Date Tue, 13 Oct 2009 15:23:48 GMT
I deprecated that behaviour, because the API was inconsistent.  And then the
question would arise, how do I get the row count for the number of rows
inserted? (it's possible).
So now the only way is to set the id on the objects themselves.  If you have
a weird case where the ID is not on the parameter object, just wrap it in a


On Tue, Oct 13, 2009 at 6:38 AM, Josh Joy <joshjdevl@gmail.com> wrote:

> Hi,
> I'm using MS Sql Server 2005, previously with iBatis v2.x, I was able
> to get the generated id from an insert as the return value for a
> method.
> With iBatis v3, the return value is always "1", which I'm assuming
> means 1 row was inserted.
> How can I configure the api to return the generated id from an insert?
> For the insert, I am using keyProperty="id" useGeneratedKeys="true",
> and that seems to work... my object property id has the generated id.
> Though I would like it as the return value for the insert method as
> well...
> Thanks,
> Josh
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message