Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 56423 invoked from network); 8 Feb 2009 22:38:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Feb 2009 22:38:18 -0000 Received: (qmail 46434 invoked by uid 500); 8 Feb 2009 22:38:11 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 46418 invoked by uid 500); 8 Feb 2009 22:38:11 -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 46409 invoked by uid 99); 8 Feb 2009 22:38:11 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 14:38:11 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.236.232.74] (HELO mail.asci-systemhaus.de) (83.236.232.74) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 08 Feb 2009 22:38:02 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.asci-systemhaus.de (Postfix) with ESMTP id B6D4138B61 for ; Sun, 8 Feb 2009 23:37:40 +0100 (CET) Received: from mail.asci-systemhaus.de ([127.0.0.1]) by localhost (mail.asci-systemhaus.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08196-03 for ; Sun, 8 Feb 2009 23:37:34 +0100 (CET) Received: from [192.168.1.100] (dslb-088-073-163-144.pools.arcor-ip.net [88.73.163.144]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.asci-systemhaus.de (Postfix) with ESMTP id 9F114420C2 for ; Sun, 8 Feb 2009 23:37:33 +0100 (CET) Message-ID: <498F5F01.3040001@asci-systemhaus.de> Date: Sun, 08 Feb 2009 23:38:57 +0100 From: =?UTF-8?B?SW5nbWFyIEzDtnR6c2No?= User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) MIME-Version: 1.0 To: user-java@ibatis.apache.org Subject: Re: Need help on Inserting child Object . References: <50660FB7D5A72645933E13611D51D54A34961E90AC@mailserver.vnl.in> In-Reply-To: <50660FB7D5A72645933E13611D51D54A34961E90AC@mailserver.vnl.in> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: amavisd-new at asci-systemhaus.de X-Virus-Checked: Checked by ClamAV on apache.org Hello, Rahul > if (null == order.getOrderId()) { > sqlMapClient.insert("Order.insert", order); > } else { > sqlMapClient.update("Order.update", order); > } > As I was going through above code I have few question why are checking > it against null for insert , shouldn’t that be checking for not null > > Though I can understand that It needs to be done at application level > only using sql batch update but an explicit example of the same with > corresponding entries in sqlmap would help . If somebody can put some > light on this would help me in great manner. what DBMS you are using? What is your application's/DB's way to create new IDs? Ingmar