ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject iBATIS 3 selectOne() -- no more exception on ZERO results
Date Sat, 29 Aug 2009 15:21:38 GMT
Just a quick warning for those who are already working with iBATIS 3...

selectOne() used to throw an exception when no results were returned (by
design), but through popular vote of the community, we've decided that the
new behavior should be:

- If ZERO results were found, return null
- If MULTIPLE results were found, throw a TooManyResultsException
- If ONE result was found, return it.

The reason this warning is necessary is that if you were using the exception
for flow control (try/catch), you'll need to change it to a conditional (if
not null/else).

http://issues.apache.org/jira/browse/IBATIS-630

Cheers,
Clinton

Mime
View raw message