Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 62893 invoked from network); 13 Jul 2005 13:52:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Jul 2005 13:52:31 -0000 Received: (qmail 53578 invoked by uid 500); 13 Jul 2005 13:52:27 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 53541 invoked by uid 500); 13 Jul 2005 13:52:27 -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 53510 invoked by uid 99); 13 Jul 2005 13:52:27 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2005 06:52:26 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [128.100.132.42] (HELO bureau14.utcc.utoronto.ca) (128.100.132.42) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Jul 2005 06:52:25 -0700 Received: from zarar.sis.utoronto.ca ([128.100.105.83] HELO zarar ident: IDENT-NOT-QUERIED [port 1194]) by bureau14.utcc.utoronto.ca with SMTP id <890115-25736>; Wed, 13 Jul 2005 09:52:23 -0400 Message-ID: <006901c587b2$11aa5070$53696480@sis.utoronto.ca> From: "Zarar Siddiqi" To: , "Kinjal Sonpal" References: <370768f605071303326d5d0307@mail.gmail.com> Subject: Re: queryForList not returning null Date: Wed, 13 Jul 2005 09:52:11 -0400 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2527 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2527 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N What I do is that I have a base class (BaseDAOSqlMap) which encapsulates all my data access. In it are methods like getList(String,Object) which calls queryForList which allows me to define custom behavior of what getList() returns. That way if the implementation for queryForList() changes (I know its unlikely), I have to change my code in one place. Just a thought. Zarar ----- Original Message ----- From: "Kinjal Sonpal" To: "iBatis mailing list" Sent: Wednesday, July 13, 2005 6:32 AM Subject: queryForList not returning null > Dear All, > > Today while using queryForList method, I realised that if there are no > records in the resultset, it returns an empty list unlike > queryForObject (which returns null). Is it an undocumented feature or > that's how it should have been? > > After each call, I have to manually check for the size of the list. > Are there any known workarounds? Could not find much information over > the internet or ibatis website/lists. > > Please advise. > > Thanks and regards, > Kinjal >