You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Andreas Prudzilko <ap...@digitalchocolate.com> on 2006/09/08 11:32:50 UTC

Id after insert

Hey,

 

I’m using a regular method to insert stuff as in:

 

Object id = client.insert("ProductionTrack.insert", track);

 

I’m using mysql with an autoincrement column. But my id is always null. Any ideas?

 

- Andreas

 

Andreas Prudzilko

Tools Developer

 

 


Re: Id after insert

Posted by Guido García Bernardo <gg...@tid.es>.
In order to help you, please send us some extra info like your sql map 
file with your sql sentence.
regards

Andreas Prudzilko escribió:
>
> Hey,
>
>  
>
> I’m using a regular method to insert stuff as in:
>
>  
>
> Object id = client.insert("ProductionTrack.insert", track);
>
>  
>
> I’m using mysql with an autoincrement column. But my id is always 
> null. Any ideas?
>
>  
>
> - Andreas
>
>  
>
> **Andreas Prudzilko**
>
> Tools Developer
>
>  
>
>  
>


-- 
Guido García Bernardo

Tfn. +34 983 54 89 08
ITDEUSTO - Valladolid


Re: Id after insert

Posted by Leandro Saad <le...@gmail.com>.
Have you tried this?
http://opensource.atlassian.com/confluence/oss/pages/viewpage.action?pageId=407

-- 
Leandro Rodrigo Saad Cruz
software developer - certified scrum master
:: scrum.com.br
:: db.apache.org/ojb
:: guara-framework.sf.net
:: xingu.sf.net

On 9/8/06, Andreas Prudzilko <ap...@digitalchocolate.com> wrote:
>
>  Hey,
>
>
>
> I'm using a regular method to insert stuff as in:
>
>
>
> Object id = client.insert("ProductionTrack.insert", track);
>
>
>
> I'm using mysql with an autoincrement column. But my id is always null.
> Any ideas?
>
>
>
> - Andreas
>
>
>
> *Andreas Prudzilko*
>
> Tools Developer
>
>
>
>
>

Re: Id after insert

Posted by Brandon Goodin <br...@gmail.com>.
Are you using the <selectKey> functionality in your <insert> to populate the
auto generated primary key?

Brandon

On 9/8/06, Andreas Prudzilko <ap...@digitalchocolate.com> wrote:
>
>  Hey,
>
>
>
> I'm using a regular method to insert stuff as in:
>
>
>
> Object id = client.insert("ProductionTrack.insert", track);
>
>
>
> I'm using mysql with an autoincrement column. But my id is always null.
> Any ideas?
>
>
>
> - Andreas
>
>
>
> *Andreas Prudzilko*
>
> Tools Developer
>
>
>
>
>