Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 23183 invoked from network); 15 Nov 2009 11:20:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Nov 2009 11:20:57 -0000 Received: (qmail 89276 invoked by uid 500); 15 Nov 2009 11:20:56 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 89210 invoked by uid 500); 15 Nov 2009 11:20:56 -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 89202 invoked by uid 99); 15 Nov 2009 11:20:56 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 15 Nov 2009 11:20:56 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.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, 15 Nov 2009 11:20:42 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1N9d9Y-0005R8-KB for user-java@ibatis.apache.org; Sun, 15 Nov 2009 03:20:20 -0800 Message-ID: <26358246.post@talk.nabble.com> Date: Sun, 15 Nov 2009 03:20:20 -0800 (PST) From: Ron H To: user-java@ibatis.apache.org Subject: Re: what contain int return value for insert? In-Reply-To: <4AFFE198.7050104@sysedata.no> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Nabble-From: be.special@gmail.com References: <1258224516.986751.23264.nullmailer@mail1010.cent> <4AFFE198.7050104@sysedata.no> X-Virus-Checked: Checked by ClamAV on apache.org well, the question is how to retrieve this Group.id? Edvin Syse wrote: >=20 > You also know that Group.id will contain the result from the selectKey=20 > statement :) >=20 > Jeff Butler skrev: >> The return value from the insert method is the number of rows inserted >> (in iBATIS3). >> >> Ibator will generated the proper code for generated keys - see the >> configuration element in the documentation. >> >> Jeff Butler >> >> >> 2009/11/14 Tom=C3=A1=C5=A1 Proch=C3=A1zka : >> =20 >>> What contain return int value for this mapper method: >>> >>> int insert(Group record); >>> >>> with this mapping delcaration: >>> >>> >>> insert into `group` (id, name, type, >>> locked, lockedby_user) >>> values (#{id,jdbcType=3DINTEGER}, #{name,jdbcType=3DVARCHAR}, >>> #{type,jdbcType=3DCHAR}, >>> #{locked,jdbcType=3DBIT}, #{lockedbyUser,jdbcType=3DINTEGER}) >>> >>> >>> ? >>> >>> A prefer automatically return last insert id, it's possible? >>> >>> I tried this: >>> >>> >>> SELECT LAST_INSERT_ID(); >>> >>> >>> It update field in Group instance which was used to call insert method, >>> But has no result to insert method return value. >>> >>> >>> SE= LECT >>> LAST_INSERT_ID(); >>> >>> This should be automatically generated by Ibator. It's very important >>> for easy way to build related DB data. >>> >>> --------------------------------------------------------------------- >>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org >>> For additional commands, e-mail: user-java-help@ibatis.apache.org >>> >>> >>> =20 >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org >> For additional commands, e-mail: user-java-help@ibatis.apache.org >> >> =20 >=20 > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org > For additional commands, e-mail: user-java-help@ibatis.apache.org >=20 >=20 >=20 --=20 View this message in context: http://old.nabble.com/what-contain-int-return= -value-for-insert--tp26352739p26358246.html Sent from the iBATIS - User - Java mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org For additional commands, e-mail: user-java-help@ibatis.apache.org