The text you mentioned is okay but I am somewhat concerned about the method name. Coming from JPA I am somewhat unused to the method throwing an exception if multiple matches are found. I guess I could push this integrity-checking into the database using the UNIQUE keyword, but then I'm strongly in favor of renaming the method to something along the lines of firstResult(). The current method name implies that the result is unique, which is not necessarily true.
Timo,
The text you mentioned is okay but I am somewhat concerned about the method name. Coming from JPA I am somewhat unused to the method throwing an exception if multiple matches are found. I guess I could push this integrity-checking into the database using the UNIQUE keyword, but then I'm strongly in favor of renaming the method to something along the lines of firstResult(). The current method name implies that the result is unique, which is not necessarily true.