ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aladin <iba...@aladin.ca>
Subject Re: queryForList not returning null
Date Wed, 13 Jul 2005 12:16:04 GMT
Hi Kinjal,

Whatever happens, you'll have to check what the method returned.  May it 
be a boolean, String, NULL, or empty list.

I personally don't see much difference between

if( (list = queryForList("..")) == null)
if( list.size > 0)

As a matter of fact, the second option is more intuitive.

Good Luck.


Kinjal Sonpal wrote:
> 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
> .

View raw message