{"action":"created","issue":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/5411","repository_url":"https://api.github.com/repos/jOOQ/jOOQ","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/5411/labels{/name}","comments_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/5411/comments","events_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/5411/events","html_url":"https://github.com/jOOQ/jOOQ/issues/5411","id":165243462,"number":5411,"title":"Add support for ResultQuery.fetchSingle(), which returns exactly one record","user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars2.githubusercontent.com/u/734593?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"labels":[{"id":9935131,"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/C:%20Functionality","name":"C: Functionality","color":"0000aa","default":false},{"id":9935166,"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/P:%20Medium","name":"P: Medium","color":"ffaaaa","default":false},{"id":9935170,"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/R:%20Fixed","name":"R: Fixed","color":"55ff55","default":false},{"id":9935128,"url":"https://api.github.com/repos/jOOQ/jOOQ/labels/T:%20Enhancement","name":"T: Enhancement","color":"cccccc","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/132","html_url":"https://github.com/jOOQ/jOOQ/milestone/132","labels_url":"https://api.github.com/repos/jOOQ/jOOQ/milestones/132/labels","id":1767107,"number":132,"title":"Version 3.10.0","description":"","creator":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars2.githubusercontent.com/u/734593?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"open_issues":49,"closed_issues":467,"state":"open","created_at":"2016-05-15T17:12:51Z","updated_at":"2017-07-28T12:49:36Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2016-07-13T05:58:32Z","updated_at":"2017-07-28T13:33:49Z","closed_at":"2017-07-28T10:07:43Z","body":"A new method should be added to throw an exception both when there are 0 or > 1 resulting records (as opposed to `fetchOne()`, which throws only on > 1 records)\r\n\r\nThe exception that would be thrown on error is a `NoDataFoundException`\r\n\r\n---\r\n\r\nAs suggested by Mark Derricutt in this discussion here:\r\nhttps://groups.google.com/d/msg/jooq-user/7hfDlmEwfQI/TXhyJDHpDAAJ\r\n\r\nOr on Stack Overflow here:\r\nhttps://stackoverflow.com/q/45342644/521799"},"comment":{"url":"https://api.github.com/repos/jOOQ/jOOQ/issues/comments/318653057","html_url":"https://github.com/jOOQ/jOOQ/issues/5411#issuecomment-318653057","issue_url":"https://api.github.com/repos/jOOQ/jOOQ/issues/5411","id":318653057,"user":{"login":"lukaseder","id":734593,"avatar_url":"https://avatars2.githubusercontent.com/u/734593?v=4","gravatar_id":"","url":"https://api.github.com/users/lukaseder","html_url":"https://github.com/lukaseder","followers_url":"https://api.github.com/users/lukaseder/followers","following_url":"https://api.github.com/users/lukaseder/following{/other_user}","gists_url":"https://api.github.com/users/lukaseder/gists{/gist_id}","starred_url":"https://api.github.com/users/lukaseder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukaseder/subscriptions","organizations_url":"https://api.github.com/users/lukaseder/orgs","repos_url":"https://api.github.com/users/lukaseder/repos","events_url":"https://api.github.com/users/lukaseder/events{/privacy}","received_events_url":"https://api.github.com/users/lukaseder/received_events","type":"User","site_admin":false},"created_at":"2017-07-28T13:33:49Z","updated_at":"2017-07-28T13:33:49Z","body":"> Yes, I was exaggerating, which was uncalled for. Sorry about that.\r\n\r\nNo worries at all, and no offense taken! :)\r\n\r\n> Instead, this particular difference between ‘one’ and ‘single’ would be jOOQ-specific jargon.\r\n\r\nOh yes, I absolutely agree. Unfortunately, there's some 9 year history here, which cannot be gotten rid of easily, given that `fetchOne` and `fetch` are probably among the most used methods in the API. \r\n\r\nBtw, there's `fetchMany()` whose name might have been picked a bit prematurely. It doesn't mean what you might think right now in the context of this ticket. It actually means `fetch` several times (several `0..N` results). Luckily it's used so rarely, so it won't confuse many people. But the problem is, it's occupying another term that could be used in a better, more consistent way.\r\n\r\nAnother example that was recently fixed was the misleading re-use of `fetchOne` on a `Cursor`, where it really meant `fetchNext`. Also not used very often, thus easy to deprecate/rename.\r\n\r\nI still think that `single` is a very precise term with no ambiguity, and I'm happy to re-think `one` as a term in the future. Or drop it, in favour of the already existing `fetchOptional` once we drop Java 6 / 7 support, but the new alternative needs to be compelling.\r\n\r\n> Alternative approach: name them fetchOne and fetchOneOrThrow, for which there’s some precedent in the JDK these days.\r\n\r\nThat's an interesting idea. However, you know, `fetchOne` already throws `TooManyRowsException` when there would have been more than 1 row, so maybe that would be confusing on an entirely new level :)\r\n\r\nIn any case, what definitely needs to be done soon is an introduction page somewhere at the beginning of the manual, which explains all the jargon, because across the API, it's mostly very consistent and terms are reused all the time, even if they're jOOQ-specific."}}
{"actor":{"display_login":"lukaseder"}}