empire-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele (JIRA) <empire-db-...@incubator.apache.org>
Subject [jira] [Assigned] (EMPIREDB-189) DBDatabase.getSingleInt with default does not return the default but throws an exception.
Date Tue, 27 Aug 2013 09:36:52 GMT

     [ https://issues.apache.org/jira/browse/EMPIREDB-189?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Rainer Döbele reassigned EMPIREDB-189:
--------------------------------------

    Assignee: Rainer Döbele
    
> 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
>            Assignee: Rainer Döbele
>
> 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