ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: insert with id as return value
Date Tue, 04 Jul 2006 22:42:11 GMT
The iBATIS function you are looking for is <selectKey> - this is
specifically designed for this situation.

Abator will generate <selectKey> statements for you if you use the
<generatedKey> Abator configuration element.

Jeff Butler




On 7/4/06, Thomas Karl Schwaerzler <Thomas.Schwaerzler@student.uibk.ac.at>
wrote:
>
>
> hi,
>
> doesn't really look like:
>
> OdmLinkDAOImpl.java:
>
> <snip>
>
>    /**
>      * This method was generated by Abator for iBATIS.
>      * This method corresponds to the database table c108272dev.ODM_LINK
>      *
>      * @abatorgenerated Tue Jul 04 18:48:58 CEST 2006
>      */
>     public void insert(OdmLink record) {
>         insert("c108272dev_ODM_LINK.abatorgenerated_insert", record);
>     }
>
>
> </snip>
>
> greets
> tom.
>
> On Tue, 4 Jul 2006, Graeme J Sweeney wrote:
>
> > On Tue, 4 Jul 2006, Thomas Karl Schwaerzler wrote:
> >
> > You don't have to do this
> >
> >>              link.setId(id);
> >
> > as this call
> >
> >>              linkDao.insert(link);
> >
> > will return you the id. Check the javadoc of your DAO (or
> LinkDAOImpl.java).
> >
> > --
> > Graeme -
> >
>

Mime
View raw message