]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.db/src/org/simantics/db/exception/NoSingleResultException.java
Ignore NoSingleResultException in DependenciesRelation
[simantics/platform.git] / bundles / org.simantics.db / src / org / simantics / db / exception / NoSingleResultException.java
index 8c3e9dbe3ff0e0dfc6d5e537d06a4d4ffc44fdd5..500964242d1a9db2724a6f567777ff2d9debd02b 100644 (file)
@@ -17,32 +17,29 @@ public class NoSingleResultException extends AssumptionException {
 
     private static final long serialVersionUID = 1647209154838034514L;
 
-    public NoSingleResultException(NoSingleResultException cause) {
-        super(cause.getMessage());
-    }
-    
-    public NoSingleResultException(DatabaseException cause) {
-        super(cause.getMessage());
-    }
+    private final int resultCount;
 
-    public NoSingleResultException(String message, Throwable cause) {
-        super(message, cause);
+    public NoSingleResultException(String message, int resultCount, Throwable cause) {
+        super(message + " [resultCount=" + resultCount + "]", cause);
+        this.resultCount = resultCount;
     }
 
-    public NoSingleResultException(String message, int ... rs) {
-        super(message, rs);
-    }
-    
-    public NoSingleResultException(String message) {
-        super(message);
+    public NoSingleResultException(String message, int resultCount, int ... rs) {
+        super(message + " [resultCount=" + resultCount + "]", rs);
+        this.resultCount = resultCount;
     }
 
-    public NoSingleResultException(String message, DatabaseException cause) {
-        super(message, cause);
+    public NoSingleResultException(String message, int resultCount) {
+        super(message + " [resultCount=" + resultCount + "]");
+        this.resultCount = resultCount;
     }
 
-    public NoSingleResultException(String message, Resource ... resources) {
-        super(message, resources);
+    public NoSingleResultException(String message, int resultCount, Resource ... resources) {
+        super(message + " [resultCount=" + resultCount + "]", resources);
+        this.resultCount = resultCount;
     }
 
+    public int getResultCount() {
+        return resultCount;
+    }
 }