Comment 2 for bug 717563

Revision history for this message
cowwoc (gili) wrote : Re: Projectable.uniqueResult() Javadoc does not discuss what happens if multiple matches are found

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.