Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 73742 invoked from network); 21 Sep 2008 16:19:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Sep 2008 16:19:45 -0000 Received: (qmail 86849 invoked by uid 500); 21 Sep 2008 16:19:40 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 86829 invoked by uid 500); 21 Sep 2008 16:19:40 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 86818 invoked by uid 99); 21 Sep 2008 16:19:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Sep 2008 09:19:39 -0700 X-ASF-Spam-Status: No, hits=3.7 required=10.0 tests=DNS_FROM_OPENWHOIS,FORGED_HOTMAIL_RCVD2,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 21 Sep 2008 16:18:40 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1KhReT-0006kV-A0 for user-java@ibatis.apache.org; Sun, 21 Sep 2008 09:19:13 -0700 Message-ID: <19595857.post@talk.nabble.com> Date: Sun, 21 Sep 2008 09:19:13 -0700 (PDT) From: Tokajac To: user-java@ibatis.apache.org Subject: Primary key value, generated by iBatis (or database), in code MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: imre_tokai@hotmail.com X-Virus-Checked: Checked by ClamAV on apache.org Hello! in User.xml i have: INSERT INTO USR ( username, passwordfirstname, lastname, role ) in UserDao.java i have sqlMapper.insert("addUser", user); Primary key is generated by iBatis (or database). How can i get this value? For now, i'm using SELECT MAX(pKey) but it's not the happiest way for solving this problem. I found this example. http://ibatis.apache.org/docs/java/user/com/ibatis/sqlmap/client/SqlMapClient.html How should i write the for making this work? Regards -- View this message in context: http://www.nabble.com/Primary-key-value%2C-generated-by-iBatis-%28or-database%29%2C-in-code-tp19595857p19595857.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com.