{"action":"opened","issue":{"url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/709","repository_url":"https://api.github.com/repos/Raizlabs/DBFlow","labels_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/709/labels{/name}","comments_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/709/comments","events_url":"https://api.github.com/repos/Raizlabs/DBFlow/issues/709/events","html_url":"https://github.com/Raizlabs/DBFlow/issues/709","id":142107232,"number":709,"title":"[beta5] count() throw SQLiteDoneException when equal to 0","user":{"login":"FredJul","id":3428124,"avatar_url":"https://avatars.githubusercontent.com/u/3428124?v=3","gravatar_id":"","url":"https://api.github.com/users/FredJul","html_url":"https://github.com/FredJul","followers_url":"https://api.github.com/users/FredJul/followers","following_url":"https://api.github.com/users/FredJul/following{/other_user}","gists_url":"https://api.github.com/users/FredJul/gists{/gist_id}","starred_url":"https://api.github.com/users/FredJul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FredJul/subscriptions","organizations_url":"https://api.github.com/users/FredJul/orgs","repos_url":"https://api.github.com/users/FredJul/repos","events_url":"https://api.github.com/users/FredJul/events{/privacy}","received_events_url":"https://api.github.com/users/FredJul/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-03-19T22:29:49Z","updated_at":"2016-03-19T22:29:49Z","closed_at":null,"body":"Hi,\r\n\r\nI saw a small bug in beta5: instead of returning 0, the count() methods just throw a SQLiteDoneException. Howerever it works perfectly when there is more than 0 entries.\r\n\r\nHere is a typical workaround code:\r\n```\r\ntry {\r\n      return new Select().from(Task.class).where(Task_Table.isFinished.eq(true)).count();\r\n} catch (SQLiteDoneException e) {\r\n      // I do not know why this happen when count=0\r\n      return 0;\r\n}\r\n```\r\nBut the real solution would be to directly return 0 I think."}}