We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 40591ad commit c66b27dCopy full SHA for c66b27d
hibernate-core/src/main/java/org/hibernate/NonUniqueResultException.java
@@ -15,13 +15,25 @@
15
* @author Gavin King
16
*/
17
public class NonUniqueResultException extends HibernateException {
18
+
19
+ private final int resultCount;
20
21
/**
22
* Constructs a {@code NonUniqueResultException}.
23
*
24
* @param resultCount The number of actual results.
25
26
public NonUniqueResultException(int resultCount) {
27
super( "Query did not return a unique result: " + resultCount + " results were returned" );
28
+ this.resultCount = resultCount;
29
+ }
30
31
+ /**
32
+ * Get the number of actual results.
33
+ * @return number of actual results
34
+ */
35
+ public int getResultCount() {
36
+ return this.resultCount;
37
}
38
39
0 commit comments