empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Harald Kirsch (JIRA)" <empire-db-...@incubator.apache.org>
Subject [jira] [Created] (EMPIREDB-189) DBDatabase.getSingleInt with default does not return the default but throws an exception.
Date Thu, 15 Aug 2013 13:37:47 GMT
Harald Kirsch created EMPIREDB-189:
--------------------------------------

             Summary: DBDatabase.getSingleInt with default does not return the default but
throws an exception.
                 Key: EMPIREDB-189
                 URL: https://issues.apache.org/jira/browse/EMPIREDB-189
             Project: Empire-DB
          Issue Type: Bug
    Affects Versions: empire-db-2.4.1
            Reporter: Harald Kirsch


The method getSingleInt with default value should return the default value if there is no
record found in the database.

Instead it throws QueryNoResultException, which correctly comes right out of querySingleValue.

getSingleInt should catch the exception and return the default provided.

Alternatively, I would rather add the default value also to getSingleValue to prevent the
expensive generation of an exception in this case. This, however, would make it difficult
to have null as the default value. But I think this is rather not a meaningful default in
a db context anyway.


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message