ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cowwoc <cow...@bbs.darktech.org>
Subject DefaultSqlSession.selectOne()
Date Wed, 14 Apr 2010 00:05:20 GMT

     I hope I'm not reopening a hornet's nest but I just noticed the 
following comment in the code:

// Popular vote was to return null on 0 results and throw exception on 
too many.

     How do you differentiate between selectOne() returning null because 
it found no rows versus it finding a single row containing a null value? 
I remember Sun's Engineers had the same debate for auto-boxing (should a 
null Integer get unboxed as "0" or throw an exception?) and they settled 
on exceptions precisely because of this ambiguity. Was there a huge vote 
in favor of returning null for zero results or are you still open to 
some hand twisting? :)


To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message