airavata-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From scnakand...@apache.org
Subject [9/9] airavata git commit: ProcessId, TaskId, ErrorId, StatusId are unique. So can be retrieved directly without the parent Id
Date Mon, 22 Jun 2015 12:01:47 GMT
ProcessId, TaskId, ErrorId, StatusId are unique. So can be retrieved directly without the parent
Id


Project: http://git-wip-us.apache.org/repos/asf/airavata/repo
Commit: http://git-wip-us.apache.org/repos/asf/airavata/commit/f9032d4d
Tree: http://git-wip-us.apache.org/repos/asf/airavata/tree/f9032d4d
Diff: http://git-wip-us.apache.org/repos/asf/airavata/diff/f9032d4d

Branch: refs/heads/master
Commit: f9032d4dd4ee32f9676e0474283ebce730a6e37c
Parents: 99808c5
Author: Supun Nakandala <scnakandala@apache.org>
Authored: Mon Jun 22 13:52:33 2015 +0530
Committer: Supun Nakandala <scnakandala@apache.org>
Committed: Mon Jun 22 13:52:33 2015 +0530

----------------------------------------------------------------------
 .../core/experiment/catalog/resources/ExperimentResource.java  | 5 -----
 .../core/experiment/catalog/resources/ProcessResource.java     | 6 ------
 .../core/experiment/catalog/resources/TaskResource.java        | 6 +-----
 3 files changed, 1 insertion(+), 16 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/airavata/blob/f9032d4d/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
index 166ef01..b81049f 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ExperimentResource.java
@@ -182,7 +182,6 @@ public class ExperimentResource extends AbstractExpCatResource {
             switch (type) {
                 case EXPERIMENT_ERROR:
                     generator = new QueryGenerator(EXPERIMENT_ERROR);
-                    generator.setParameter(ExperimentErrorConstants.EXPERIMENT_ID, experimentId);
                     generator.setParameter(ExperimentErrorConstants.ERROR_ID, name);
                     q = generator.deleteQuery(em);
                     q.executeUpdate();
@@ -216,7 +215,6 @@ public class ExperimentResource extends AbstractExpCatResource {
                     break;
                 case PROCESS:
                     generator = new QueryGenerator(PROCESS);
-                    generator.setParameter(ProcessConstants.EXPERIMENT_ID, experimentId);
                     generator.setParameter(ProcessConstants.PROCESS_ID, name);
                     q = generator.deleteQuery(em);
                     q.executeUpdate();
@@ -252,7 +250,6 @@ public class ExperimentResource extends AbstractExpCatResource {
                 case EXPERIMENT_STATUS:
                     generator = new QueryGenerator(EXPERIMENT_STATUS);
                     generator.setParameter(ExperimentStatusConstants.STATUS_ID, name);
-                    generator.setParameter(ExperimentStatusConstants.EXPERIMENT_ID, experimentId);
                     q = generator.selectQuery(em);
                     ExperimentStatus status = (ExperimentStatus) q.getSingleResult();
                     ExperimentStatusResource statusResource = (ExperimentStatusResource)
Utils.getResource(ResourceType.EXPERIMENT_STATUS, status);
@@ -262,7 +259,6 @@ public class ExperimentResource extends AbstractExpCatResource {
                 case EXPERIMENT_ERROR:
                     generator = new QueryGenerator(EXPERIMENT_ERROR);
                     generator.setParameter(ExperimentErrorConstants.ERROR_ID, name);
-                    generator.setParameter(ExperimentErrorConstants.EXPERIMENT_ID, experimentId);
                     q = generator.selectQuery(em);
                     ExperimentError experimentError = (ExperimentError) q.getSingleResult();
                     ExperimentErrorResource processErrorResource = (ExperimentErrorResource)
Utils.getResource(ResourceType.EXPERIMENT_ERROR, experimentError);
@@ -302,7 +298,6 @@ public class ExperimentResource extends AbstractExpCatResource {
                 case PROCESS:
                     generator = new QueryGenerator(PROCESS);
                     generator.setParameter(ProcessConstants.PROCESS_ID, name);
-                    generator.setParameter(ProcessConstants.EXPERIMENT_ID, experimentId);
                     q = generator.selectQuery(em);
                     Process process = (Process) q.getSingleResult();
                     ProcessResource processResource = (ProcessResource) Utils.getResource(ResourceType.PROCESS,
process);

http://git-wip-us.apache.org/repos/asf/airavata/blob/f9032d4d/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
index a8919ff..2572129 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/ProcessResource.java
@@ -147,14 +147,12 @@ public class ProcessResource extends AbstractExpCatResource {
                 case PROCESS_ERROR:
                     generator = new QueryGenerator(PROCESS_ERROR);
                     generator.setParameter(ProcessErrorConstants.ERROR_ID, name);
-                    generator.setParameter(ProcessErrorConstants.PROCESS_ID, processId);
                     q = generator.deleteQuery(em);
                     q.executeUpdate();
                     break;
                 case PROCESS_STATUS:
                     generator = new QueryGenerator(PROCESS_STATUS);
                     generator.setParameter(ProcessStatusConstants.STATUS_ID, name);
-                    generator.setParameter(ProcessStatusConstants.PROCESS_ID, processId);
                     q = generator.deleteQuery(em);
                     q.executeUpdate();
                     break;
@@ -180,7 +178,6 @@ public class ProcessResource extends AbstractExpCatResource {
                     break;
                 case TASK:
                     generator = new QueryGenerator(TASK);
-                    generator.setParameter(TaskConstants.PROCESS_ID, processId);
                     generator.setParameter(TaskConstants.TASK_ID, name);
                     q = generator.deleteQuery(em);
                     q.executeUpdate();
@@ -216,7 +213,6 @@ public class ProcessResource extends AbstractExpCatResource {
                 case PROCESS_STATUS:
                     generator = new QueryGenerator(PROCESS_STATUS);
                     generator.setParameter(ProcessStatusConstants.STATUS_ID, name);
-                    generator.setParameter(ProcessStatusConstants.PROCESS_ID, processId);
                     q = generator.selectQuery(em);
                     ProcessStatus status = (ProcessStatus) q.getSingleResult();
                     ProcessStatusResource statusResource = (ProcessStatusResource) Utils.getResource(ResourceType.PROCESS_STATUS,
status);
@@ -226,7 +222,6 @@ public class ProcessResource extends AbstractExpCatResource {
                 case PROCESS_ERROR:
                     generator = new QueryGenerator(PROCESS_ERROR);
                     generator.setParameter(ProcessErrorConstants.ERROR_ID, name);
-                    generator.setParameter(ProcessErrorConstants.PROCESS_ID, processId);
                     q = generator.selectQuery(em);
                     ProcessError processError = (ProcessError) q.getSingleResult();
                     ProcessErrorResource processErrorResource = (ProcessErrorResource) Utils.getResource(ResourceType.PROCESS_ERROR,
processError);
@@ -266,7 +261,6 @@ public class ProcessResource extends AbstractExpCatResource {
                 case TASK:
                     generator = new QueryGenerator(TASK);
                     generator.setParameter(TaskConstants.TASK_ID, name);
-                    generator.setParameter(TaskConstants.PROCESS_ID, processId);
                     q = generator.selectQuery(em);
                     Task task = (Task) q.getSingleResult();
                     TaskResource taskResource = (TaskResource) Utils.getResource(ResourceType.TASK,
task);

http://git-wip-us.apache.org/repos/asf/airavata/blob/f9032d4d/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
----------------------------------------------------------------------
diff --git a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
index 862c2a4..5193943 100644
--- a/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
+++ b/modules/registry/registry-core/src/main/java/org/apache/airavata/registry/core/experiment/catalog/resources/TaskResource.java
@@ -132,14 +132,12 @@ public class TaskResource extends AbstractExpCatResource {
                 case TASK_STATUS:
                     generator = new QueryGenerator(TASK_STATUS);
                     generator.setParameter(TaskStatusConstants.STATUS_ID, name);
-                    generator.setParameter(TaskStatusConstants.TASK_ID, taskId);
                     q = generator.deleteQuery(em);
                     q.executeUpdate();
                     break;
                 case TASK_ERROR:
                     generator = new QueryGenerator(TASK_ERROR);
                     generator.setParameter(TaskErrorConstants.ERROR_ID, name);
-                    generator.setParameter(TaskErrorConstants.TASK_ID, taskId);
                     q = generator.deleteQuery(em);
                     q.executeUpdate();
                     break;
@@ -174,7 +172,6 @@ public class TaskResource extends AbstractExpCatResource {
                 case TASK_STATUS:
                     generator = new QueryGenerator(TASK_STATUS);
                     generator.setParameter(TaskStatusConstants.STATUS_ID, name);
-                    generator.setParameter(TaskStatusConstants.TASK_ID, taskId);
                     q = generator.selectQuery(em);
                     TaskStatus status = (TaskStatus) q.getSingleResult();
                     TaskStatusResource statusResource = (TaskStatusResource) Utils.getResource(ResourceType.TASK_STATUS,
status);
@@ -184,7 +181,6 @@ public class TaskResource extends AbstractExpCatResource {
                 case TASK_ERROR:
                     generator = new QueryGenerator(TASK_ERROR);
                     generator.setParameter(TaskErrorConstants.ERROR_ID, name);
-                    generator.setParameter(TaskErrorConstants.TASK_ID, taskId);
                     q = generator.selectQuery(em);
                     TaskError error = (TaskError) q.getSingleResult();
                     TaskErrorResource errorResource = (TaskErrorResource) Utils.getResource(
@@ -358,4 +354,4 @@ public class TaskResource extends AbstractExpCatResource {
             return max;
         }
     }
-}
+}
\ No newline at end of file


Mime
View raw message