Your problem has been discussed previously on this list
(http://www.mail-archive.com/[email protected]/msg01752.html)
Use the <selectKey ...> tag.
<insert id="insertFolder" parameterClass="folder">
INSERT INTO folder (parent_id, owner, foldername)
VALUES (#parentId#, #owner#, #foldername#)
<selectKey resultClass="int" keyProperty="folderId">
SELECT LAST_INSERT_ID() AS folderId
</selectKey>
</insert>
Good luck,
Scott Purcell wrote:
Hello,
I am trying to get the hang of using IBATIS. In order to get my hands wet I am
running the reumann struts lesson. It is working, and I am trying to add some
tables to the example, to get a feel for the framework.
But one of the tables has an "auto_increment" (mysql) on it. So when I do an
insert, I am unsure how to handle this. Could someone lead me to where I find information
on handling that?
Thanks,
Scott
-
Guido García Bernardo - [EMAIL PROTECTED]
Tfn. +34 983 54 89 08
ITDEUSTO - Valladolid (Spain)