How get return object from insert statement when I am not using Auto generated Primary Key

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How get return object from insert statement when I am not using Auto generated Primary Key

ibuser
This post has NOT been accepted by the mailing list yet.
Hi

I am using follow statement to insert records in to db .. but its not using any auto generated primary key. I am using my own primary key  user id column.

Its inserting record but returning NULL value. But I need User Id values for further processing.

<insert  id="save"  parameterClass="com.test.User">
   INSERT INTO USERS  VALUES( #uid#, #name#,sysdate, #place#)
</insert>

Table has only 4 fields

Can you please suggest me the solution
Loading...