airavata-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (AIRAVATA-2730) Refactoring Workflow Catalog Implementation
Date Wed, 04 Apr 2018 14:05:01 GMT

    [ https://issues.apache.org/jira/browse/AIRAVATA-2730?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16425560#comment-16425560 ] 

ASF GitHub Bot commented on AIRAVATA-2730:
------------------------------------------

machristie closed pull request #188: [AIRAVATA-2730] Refactoring Workflow Catalog Implementation
URL: https://github.com/apache/airavata/pull/188
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/AppModuleMappingPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/AppModuleMappingPK.java
index 7d1a930add..c03b0da005 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/AppModuleMappingPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/AppModuleMappingPK.java
@@ -20,9 +20,7 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
 import java.io.Serializable;
-import javax.persistence.Id;
 
 /**
  * The primary key class for the app_module_mapping database table.
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInputPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInputPK.java
index c62794843c..a9e850d9ea 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInputPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationInputPK.java
@@ -20,9 +20,7 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
 import java.io.Serializable;
-import javax.persistence.Id;
 
 /**
  * The primary key class for the application_input database table.
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationOutputPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationOutputPK.java
index e4721ab784..d10c291029 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationOutputPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ApplicationOutputPK.java
@@ -20,9 +20,7 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
 import java.io.Serializable;
-import javax.persistence.Id;
 
 /**
  * The primary key class for the application_output database table.
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueuePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueuePK.java
index 574aa15b0e..5d638f26c6 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueuePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueuePK.java
@@ -20,9 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -33,12 +30,7 @@
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="COMPUTE_RESOURCE_ID", insertable=false, updatable=false)
-	@Id
 	private String computeResourceId;
-
-	@Column(name="QUEUE_NAME")
-	@Id
 	private String queueName;
 
 	public BatchQueuePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueueResourcePolicyPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueueResourcePolicyPK.java
index 3693ef4649..296bdb121c 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueueResourcePolicyPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/BatchQueueResourcePolicyPK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -32,8 +30,6 @@
 
     private static final long serialVersionUID = 1L;
 
-    @Id
-    @Column(name = "RESOURCE_POLICY_ID")
     private String resourcePolicyId;
 
     public BatchQueueResourcePolicyPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourceFileSystemPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourceFileSystemPK.java
index 878ce353ae..17ef8fe459 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourceFileSystemPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourceFileSystemPK.java
@@ -20,9 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -33,12 +30,7 @@
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="COMPUTE_RESOURCE_ID", insertable=false, updatable=false)
-	@Id
 	private String computeResourceId;
-
-	@Column(name="FILE_SYSTEM")
-	@Id
 	private String fileSystem;
 
 	public ComputeResourceFileSystemPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePolicyPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePolicyPK.java
index e44b64b53a..c627fa1917 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePolicyPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePolicyPK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -32,8 +30,6 @@
 
     private static final long serialVersionUID = 1L;
 
-    @Id
-    @Column(name = "RESOURCE_POLICY_ID")
     private String resourcePolicyId;
 
     public ComputeResourcePolicyPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java
index 6ce8b4fd3a..d49acc602f 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ComputeResourcePreferencePK.java
@@ -20,9 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -32,12 +29,7 @@
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Id
-    @Column(name = "GATEWAY_ID", insertable = false, updatable = false)
     private String gatewayId;
-
-    @Id
-    @Column(name = "RESOURCE_ID", insertable = false, updatable = false)
     private String computeResourceId;
 
     public ComputeResourcePreferencePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/DataMovementInterfacePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/DataMovementInterfacePK.java
index e319d05f51..d490efea3d 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/DataMovementInterfacePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/DataMovementInterfacePK.java
@@ -20,10 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
-import javax.persistence.IdClass;
 import java.io.Serializable;
 
 /**
@@ -33,12 +29,7 @@
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "COMPUTE_RESOURCE_ID", insertable = false, updatable = false)
-    @Id
     private String computeResourceId;
-
-    @Column(name = "DATA_MOVEMENT_INTERFACE_ID")
-    @Id
     private String dataMovementInterfaceId;
 
     public DataMovementInterfacePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointEntity.java
index cfcb7f487c..14102b1e68 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointEntity.java
@@ -20,34 +20,44 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 
-
 /**
  * The persistent class for the globus_gk_endpoint database table.
  * 
  */
 @Entity
 @Table(name="GLOBUS_GK_ENDPOINT")
+@IdClass(GlobusGkEndpointPK.class)
 public class GlobusGkEndpointEntity implements Serializable {
 	private static final long serialVersionUID = 1L;
 
-	@EmbeddedId
-	private GlobusGkEndpointPK id;
+	@Id
+	@Column(name = "SUBMISSION_ID")
+	private String submissionId;
 
-	
+	@Id
+	@Column(name = "ENDPOINT")
+	private String endpoint;
 
 	public GlobusGkEndpointEntity() {
 	}
 
-	public GlobusGkEndpointPK getId() {
-		return id;
+	public String getSubmissionId() {
+		return submissionId;
+	}
+
+	public void setSubmissionId(String submissionId) {
+		this.submissionId = submissionId;
 	}
 
-	public void setId(GlobusGkEndpointPK id) {
-		this.id = id;
+	public String getEndpoint() {
+		return endpoint;
 	}
+
+	public void setEndpoint(String endpoint) {
+		this.endpoint = endpoint;
+	}
+
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointPK.java
index aacf868e27..126559eec7 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointPK.java
@@ -20,23 +20,17 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the globus_gk_endpoint database table.
  * 
  */
-@Embeddable
 public class GlobusGkEndpointPK implements Serializable {
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="SUBMISSION_ID", insertable=false, updatable=false)
 	private String submissionId;
-
-	@Column(name="ENDPOINT")
 	private String endpoint;
 
 	public GlobusGkEndpointPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointEntity.java
index dd8fb98df6..cce0eff1c3 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointEntity.java
@@ -24,17 +24,22 @@
 import java.io.Serializable;
 import java.sql.Timestamp;
 
-
 /**
  * The persistent class for the gridftp_endpoint database table.
  */
 @Entity
 @Table(name = "GRIDFTP_ENDPOINT")
+@IdClass(GridftpEndpointPK.class)
 public class GridftpEndpointEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private GridftpEndpointPK id;
+    @Id
+    @Column(name = "DATA_MOVEMENT_INTERFACE_ID")
+    private String dataMovementInterfaceId;
+
+    @Id
+    @Column(name = "ENDPOINT")
+    private String endpoint;
 
     @Column(name = "CREATION_TIME")
     private Timestamp creationTime;
@@ -50,20 +55,28 @@
     public GridftpEndpointEntity() {
     }
 
-    public GridftpDataMovementEntity getGridftpDataMovement() {
-        return gridftpDataMovement;
+    public String getDataMovementInterfaceId() {
+        return dataMovementInterfaceId;
     }
 
-    public void setGridftpDataMovement(GridftpDataMovementEntity gridftpDataMovement) {
-        this.gridftpDataMovement = gridftpDataMovement;
+    public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+        this.dataMovementInterfaceId = dataMovementInterfaceId;
+    }
+
+    public String getEndpoint() {
+        return endpoint;
     }
 
-    public GridftpEndpointPK getId() {
-        return id;
+    public void setEndpoint(String endpoint) {
+        this.endpoint = endpoint;
     }
 
-    public void setId(GridftpEndpointPK id) {
-        this.id = id;
+    public GridftpDataMovementEntity getGridftpDataMovement() {
+        return gridftpDataMovement;
+    }
+
+    public void setGridftpDataMovement(GridftpDataMovementEntity gridftpDataMovement) {
+        this.gridftpDataMovement = gridftpDataMovement;
     }
 
     public Timestamp getCreationTime() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointPK.java
index 68696d97d6..329d950708 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointPK.java
@@ -20,22 +20,16 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the gridftp_endpoint database table.
  */
-@Embeddable
 public class GridftpEndpointPK implements Serializable {
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "DATA_MOVEMENT_INTERFACE_ID", insertable = false, updatable = false)
     private String dataMovementInterfaceId;
-
-    @Column(name = "ENDPOINT")
     private String endpoint;
 
     public GridftpEndpointPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefPK.java
index 973ea3a580..b73b13ca82 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupComputeResourcePrefPK.java
@@ -19,8 +19,6 @@
  */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -30,12 +28,7 @@
 
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "RESOURCE_ID")
-    @Id
     private String computeResourceId;
-
-    @Column(name = "GROUP_RESOURCE_PROFILE_ID")
-    @Id
     private String groupResourceProfileId;
 
     public String getComputeResourceId() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfilePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfilePK.java
index 3089bdf939..0a46b68212 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfilePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupResourceProfilePK.java
@@ -19,8 +19,6 @@
  */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -30,8 +28,6 @@
 
     private static final long serialVersionUID = 1L;
 
-    @Id
-    @Column(name = "GROUP_RESOURCE_PROFILE_ID")
     private String groupResourceProfileId;
 
     public GroupResourceProfilePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupSSHAccountProvisionerConfigPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupSSHAccountProvisionerConfigPK.java
index 6dea10441f..6bca31d032 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupSSHAccountProvisionerConfigPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GroupSSHAccountProvisionerConfigPK.java
@@ -19,8 +19,6 @@
  */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -30,16 +28,8 @@
 
     private static final long serialVersionUID = 1L;
 
-    @Id
-    @Column(name = "RESOURCE_ID")
     private String resourceId;
-
-    @Id
-    @Column(name = "GROUP_RESOURCE_PROFILE_ID")
     private String groupResourceProfileId;
-
-    @Id
-    @Column(name = "CONFIG_NAME")
     private String configName;
 
 
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportEntity.java
index 47ec041344..c7eb2296e8 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportEntity.java
@@ -20,31 +20,43 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 
-
 /**
  * The persistent class for the gsissh_export database table.
  */
 @Entity
 @Table(name = "GSISSH_EXPORT")
+@IdClass(GsisshExportPK.class)
 public class GsisshExportEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private GsisshExportPK id;
+    @Id
+    @Column(name = "SUBMISSION_ID")
+    private String submissionId;
+
+    @Id
+    @Column(name = "EXPORT")
+    private String export;
 
     public GsisshExportEntity() {
     }
 
-    public GsisshExportPK getId() {
-        return id;
+    public String getSubmissionId() {
+        return submissionId;
+    }
+
+    public void setSubmissionId(String submissionId) {
+        this.submissionId = submissionId;
     }
 
-    public void setId(GsisshExportPK id) {
-        this.id = id;
+    public String getExport() {
+        return export;
     }
+
+    public void setExport(String export) {
+        this.export = export;
+    }
+
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportPK.java
index d6159cf0ef..278062efa2 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportPK.java
@@ -20,23 +20,17 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the gsissh_export database table.
  * 
  */
-@Embeddable
 public class GsisshExportPK implements Serializable {
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="SUBMISSION_ID", insertable=false, updatable=false)
 	private String submissionId;
-
-	@Column(name="EXPORT")
 	private String export;
 
 	public GsisshExportPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandEntity.java
index 3a3e2c4c48..f4b2298a33 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandEntity.java
@@ -20,9 +20,7 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 
 /**
@@ -31,20 +29,35 @@
  */
 @Entity
 @Table(name = "GSISSH_POSTJOBCOMMAND")
+@IdClass(GsisshPostjobcommandPK.class)
 public class GsisshPostjobcommandEntity implements Serializable {
 	private static final long serialVersionUID = 1L;
 
-	@EmbeddedId
-	private GsisshPostjobcommandPK id;
+	@Id
+	@Column(name = "SUBMISSION_ID")
+	private String submissionId;
+
+	@Id
+	@Column(name = "COMMAND")
+	private String command;
 
 	public GsisshPostjobcommandEntity() {
 	}
 
-	public GsisshPostjobcommandPK getId() {
-		return id;
+	public String getSubmissionId() {
+		return submissionId;
+	}
+
+	public void setSubmissionId(String submissionId) {
+		this.submissionId = submissionId;
 	}
 
-	public void setId(GsisshPostjobcommandPK id) {
-		this.id = id;
+	public String getCommand() {
+		return command;
 	}
+
+	public void setCommand(String command) {
+		this.command = command;
+	}
+
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandPK.java
index 6b706b3db5..6745cad057 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandPK.java
@@ -20,23 +20,17 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the gsissh_postjobcommand database table.
  * 
  */
-@Embeddable
 public class GsisshPostjobcommandPK implements Serializable {
 	// default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name = "SUBMISSION_ID", insertable = false, updatable = false)
 	private String submissionId;
-
-	@Column(name = "COMMAND")
 	private String command;
 
 	public GsisshPostjobcommandPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandEntity.java
index 95af64117b..02a5bfa318 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandEntity.java
@@ -20,32 +20,43 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 
-
 /**
  * The persistent class for the gsissh_prejobcommand database table.
  */
 @Entity
 @Table(name = "GSISSH_PREJOBCOMMAND")
+@IdClass(GsisshPrejobcommandPK.class)
 public class GsisshPrejobcommandEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private GsisshPrejobcommandPK id;
+    @Id
+    @Column(name = "SUBMISSION_ID")
+    private String submissionId;
 
+    @Id
+    @Column(name = "COMMAND")
+    private String command;
 
     public GsisshPrejobcommandEntity() {
     }
 
-    public GsisshPrejobcommandPK getId() {
-        return id;
+    public String getSubmissionId() {
+        return submissionId;
+    }
+
+    public void setSubmissionId(String submissionId) {
+        this.submissionId = submissionId;
     }
 
-    public void setId(GsisshPrejobcommandPK id) {
-        this.id = id;
+    public String getCommand() {
+        return command;
     }
+
+    public void setCommand(String command) {
+        this.command = command;
+    }
+
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandPK.java
index b0abda8d4e..8fc844fed9 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandPK.java
@@ -20,23 +20,17 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the gsissh_prejobcommand database table.
  * 
  */
-@Embeddable
 public class GsisshPrejobcommandPK implements Serializable {
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="SUBMISSION_ID", insertable=false, updatable=false)
 	private String submissionId;
-
-	@Column(name="COMMAND")
 	private String command;
 
 	public GsisshPrejobcommandPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandEntity.java
index 160d13a409..2771847c92 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandEntity.java
@@ -28,11 +28,17 @@
  */
 @Entity
 @Table(name = "JOB_MANAGER_COMMAND")
+@IdClass(JobManagerCommandPK.class)
 public class JobManagerCommandEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private JobManagerCommandPK id;
+    @Id
+    @Column(name = "RESOURCE_JOB_MANAGER_ID")
+    private String resourceJobManagerId;
+
+    @Id
+    @Column(name = "COMMAND_TYPE")
+    private String commandType;
 
     @Column(name = "COMMAND")
     private String command;
@@ -44,20 +50,28 @@
     public JobManagerCommandEntity() {
     }
 
-    public ResourceJobManagerEntity getResourceJobManager() {
-        return resourceJobManager;
+    public String getResourceJobManagerId() {
+        return resourceJobManagerId;
     }
 
-    public void setResourceJobManager(ResourceJobManagerEntity resourceJobManager) {
-        this.resourceJobManager = resourceJobManager;
+    public void setResourceJobManagerId(String resourceJobManagerId) {
+        this.resourceJobManagerId = resourceJobManagerId;
+    }
+
+    public String getCommandType() {
+        return commandType;
     }
 
-    public JobManagerCommandPK getId() {
-        return id;
+    public void setCommandType(String commandType) {
+        this.commandType = commandType;
     }
 
-    public void setId(JobManagerCommandPK id) {
-        this.id = id;
+    public ResourceJobManagerEntity getResourceJobManager() {
+        return resourceJobManager;
+    }
+
+    public void setResourceJobManager(ResourceJobManagerEntity resourceJobManager) {
+        this.resourceJobManager = resourceJobManager;
     }
 
     public String getCommand() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandPK.java
index 74b9d4cbfc..8173ee6b6c 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandPK.java
@@ -20,22 +20,16 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the job_manager_command database table.
  */
-@Embeddable
 public class JobManagerCommandPK implements Serializable {
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "RESOURCE_JOB_MANAGER_ID", insertable = false, updatable = false)
     private String resourceJobManagerId;
-
-    @Column(name = "COMMAND_TYPE")
     private String commandType;
 
     public JobManagerCommandPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobSubmissionInterfacePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobSubmissionInterfacePK.java
index 50290a1ee5..a88e3e7895 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobSubmissionInterfacePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobSubmissionInterfacePK.java
@@ -20,9 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -32,12 +29,7 @@
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "COMPUTE_RESOURCE_ID", insertable = false, updatable = false)
-    @Id
     private String computeResourceId;
-
-    @Column(name = "JOB_SUBMISSION_INTERFACE_ID")
-    @Id
     private String jobSubmissionInterfaceId;
 
     public JobSubmissionInterfacePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ModuleLoadCmdPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ModuleLoadCmdPK.java
index 2c9b17dde7..3ab94209d8 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ModuleLoadCmdPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ModuleLoadCmdPK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandEntity.java
index 2b5feada5a..81f1629554 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandEntity.java
@@ -28,11 +28,17 @@
  */
 @Entity
 @Table(name = "PARALLELISM_COMMAND")
+@IdClass(ParallelismCommandPK.class)
 public class ParallelismCommandEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private ParallelismCommandPK id;
+    @Id
+    @Column(name = "RESOURCE_JOB_MANAGER_ID")
+    private String resourceJobManagerId;
+
+    @Id
+    @Column(name = "COMMAND_TYPE")
+    private String commandType;
 
     @Column(name = "COMMAND")
     private String command;
@@ -44,12 +50,20 @@
     public ParallelismCommandEntity() {
     }
 
-    public ParallelismCommandPK getId() {
-        return id;
+    public String getResourceJobManagerId() {
+        return resourceJobManagerId;
+    }
+
+    public void setResourceJobManagerId(String resourceJobManagerId) {
+        this.resourceJobManagerId = resourceJobManagerId;
+    }
+
+    public String getCommandType() {
+        return commandType;
     }
 
-    public void setId(ParallelismCommandPK id) {
-        this.id = id;
+    public void setCommandType(String commandType) {
+        this.commandType = commandType;
     }
 
     public String getCommand() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandPK.java
index 7c1c5cdc9c..c5f3055dea 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandPK.java
@@ -20,22 +20,16 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the parallelism_command database table.
  */
-@Embeddable
 public class ParallelismCommandPK implements Serializable {
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "RESOURCE_JOB_MANAGER_ID", insertable = false, updatable = false)
     private String resourceJobManagerId;
-
-    @Column(name = "COMMAND_TYPE")
     private String commandType;
 
     public ParallelismCommandPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PostjobCommandPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PostjobCommandPK.java
index 4e2c86a692..c96c825d4e 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PostjobCommandPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PostjobCommandPK.java
@@ -20,9 +20,7 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
 import java.io.Serializable;
-import javax.persistence.Id;
 
 /**
  * The primary key class for the postjob_command database table.
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PrejobCommandPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PrejobCommandPK.java
index 5a189fa53f..f99dc70f9a 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PrejobCommandPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/PrejobCommandPK.java
@@ -20,9 +20,7 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
 import java.io.Serializable;
-import javax.persistence.Id;
 
 /**
  * The primary key class for the prejob_command database table.
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/SSHAccountProvisionerConfigurationPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/SSHAccountProvisionerConfigurationPK.java
index b3fbb6b5e1..028f31d2e3 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/SSHAccountProvisionerConfigurationPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/SSHAccountProvisionerConfigurationPK.java
@@ -20,8 +20,6 @@
 
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -30,14 +28,8 @@
 public class SSHAccountProvisionerConfigurationPK implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @Id
-    @Column(name = "GATEWAY_ID" , insertable = false, updatable = false)
     private String gatewayId;
-    @Id
-    @Column(name = "RESOURCE_ID", insertable = false, updatable = false)
     private String resourceId;
-    @Id
-    @Column(name = "CONFIG_NAME")
     private String configName;
 
     public SSHAccountProvisionerConfigurationPK(String gatewayId, String resourceId, String configName) {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java
index 331a4ca004..d7705182a4 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java
@@ -20,10 +20,7 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
@@ -32,11 +29,17 @@
  */
 @Entity
 @Table(name = "STORAGE_INTERFACE")
+@IdClass(StorageInterfacePK.class)
 public class StorageInterfaceEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private StorageInterfacePK id;
+    @Id
+    @Column(name = "STORAGE_RESOURCE_ID")
+    private String storageResourceId;
+
+    @Id
+    @Column(name = "DATA_MOVEMENT_INTERFACE_ID")
+    private String dataMovementInterfaceId;
 
     @Column(name = "CREATION_TIME")
     private Timestamp creationTime;
@@ -53,12 +56,20 @@
     public StorageInterfaceEntity() {
     }
 
-    public StorageInterfacePK getId() {
-        return id;
+    public String getStorageResourceId() {
+        return storageResourceId;
+    }
+
+    public void setStorageResourceId(String storageResourceId) {
+        this.storageResourceId = storageResourceId;
+    }
+
+    public String getDataMovementInterfaceId() {
+        return dataMovementInterfaceId;
     }
 
-    public void setId(StorageInterfacePK id) {
-        this.id = id;
+    public void setDataMovementInterfaceId(String dataMovementInterfaceId) {
+        this.dataMovementInterfaceId = dataMovementInterfaceId;
     }
 
     public Timestamp getCreationTime() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java
index 1a5aa14e2d..da95019f39 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfacePK.java
@@ -20,23 +20,17 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the storage_interface database table.
  * 
  */
-@Embeddable
 public class StorageInterfacePK implements Serializable {
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="STORAGE_RESOURCE_ID", insertable=false, updatable=false)
 	private String storageResourceId;
-
-	@Column(name="DATA_MOVEMENT_INTERFACE_ID")
 	private String dataMovementInterfaceId;
 
 	public StorageInterfacePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferencePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferencePK.java
index 5c42ba2386..ff8488e1ea 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferencePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StoragePreferencePK.java
@@ -20,9 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -32,12 +29,7 @@
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "GATEWAY_ID", insertable = false, updatable = false)
-    @Id
     private String gatewayId;
-
-    @Column(name = "STORAGE_RESOURCE_ID")
-    @Id
     private String storageResourceId;
 
     public StoragePreferencePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserComputeResourcePreferencePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserComputeResourcePreferencePK.java
index e40ea53491..887063e7b9 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserComputeResourcePreferencePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserComputeResourcePreferencePK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserResourceProfilePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserResourceProfilePK.java
index 6b530e99c4..94b80657fd 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserResourceProfilePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserResourceProfilePK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserStoragePreferencePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserStoragePreferencePK.java
index fa11d85179..1e0856efb3 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserStoragePreferencePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/UserStoragePreferencePK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.appcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/ConfigurationPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/ConfigurationPK.java
index 374e5b6e1e..f2ccf04ada 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/ConfigurationPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/ConfigurationPK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.replicacatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -34,6 +32,9 @@
     private String configKey;
     private String configVal;
 
+    public ConfigurationPK() {
+    }
+
     public String getConfigKey() {
         return configKey;
     }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataProductMetadataPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataProductMetadataPK.java
index 9837f11b0e..cf69ad98fc 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataProductMetadataPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataProductMetadataPK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.replicacatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -34,6 +32,9 @@
     private String productUri;
     private String metadataKey;
 
+    public DataProductMetadataPK() {
+    }
+
     public String getProductUri() {
         return productUri;
     }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataReplicaMetadataPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataReplicaMetadataPK.java
index 4a3f5354ea..8e2a57e9ac 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataReplicaMetadataPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/replicacatalog/DataReplicaMetadataPK.java
@@ -20,8 +20,6 @@
 */
 package org.apache.airavata.registry.core.entities.replicacatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Id;
 import java.io.Serializable;
 
 /**
@@ -33,6 +31,9 @@
     private String replicaId;
     private String metadataKey;
 
+    public DataReplicaMetadataPK() {
+    }
+
     public String getReplicaId() {
         return replicaId;
     }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/ComponentStatusEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/ComponentStatusEntity.java
index 46e318e266..31678ce335 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/ComponentStatusEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/ComponentStatusEntity.java
@@ -32,7 +32,7 @@
  * The persistent class for the component_status database table.
  */
 @Entity
-@Table(name = "component_status")
+@Table(name = "COMPONENT_STATUS")
 public class ComponentStatusEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
@@ -47,7 +47,7 @@
     private String state;
 
     @Column(name = "UPDATE_TIME")
-    private Timestamp updateTime;
+    private Timestamp timeofStateChange;
 
     @Column(name = "TEMPLATE_ID")
     private String templateId;
@@ -79,12 +79,12 @@ public void setState(String state) {
         this.state = state;
     }
 
-    public Timestamp getUpdateTime() {
-        return updateTime;
+    public Timestamp getTimeofStateChange() {
+        return timeofStateChange;
     }
 
-    public void setUpdateTime(Timestamp updateTime) {
-        this.updateTime = updateTime;
+    public void setTimeofStateChange(Timestamp timeofStateChange) {
+        this.timeofStateChange = timeofStateChange;
     }
 
     public String getTemplateId() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgeEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgeEntity.java
index a1821f5d88..dfb70f2ec4 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgeEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgeEntity.java
@@ -20,25 +20,31 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
+import org.apache.airavata.model.ComponentStatus;
+
+import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
-
 /**
  * The persistent class for the edge database table.
  */
 @Entity
+@Table(name = "EDGE")
+@IdClass(EdgePK.class)
 public class EdgeEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private EdgePK id;
+    @Id
+    @Column(name = "EDGE_ID")
+    private String edgeId;
+
+    @Id
+    @Column(name = "TEMPLATE_ID")
+    private String templateId;
 
     @Column(name = "COMPONENT_STATUS_ID")
-    private String componentStatusId;
+    private ComponentStatus status;
 
     @Column(name = "CREATED_TIME")
     private Timestamp createdTime;
@@ -49,26 +55,31 @@
     @Column(name = "NAME")
     private String name;
 
-    @Column(name = "TEMPLATE_ID")
-    private String templateId;
-
     public EdgeEntity() {
     }
 
-    public EdgePK getId() {
-        return id;
+    public String getEdgeId() {
+        return edgeId;
+    }
+
+    public void setEdgeId(String edgeId) {
+        this.edgeId = edgeId;
+    }
+
+    public String getTemplateId() {
+        return templateId;
     }
 
-    public void setId(EdgePK id) {
-        this.id = id;
+    public void setTemplateId(String templateId) {
+        this.templateId = templateId;
     }
 
-    public String getComponentStatusId() {
-        return componentStatusId;
+    public ComponentStatus getStatus() {
+        return status;
     }
 
-    public void setComponentStatusId(String componentStatusId) {
-        this.componentStatusId = componentStatusId;
+    public void setStatus(ComponentStatus status) {
+        this.status = status;
     }
 
     public Timestamp getCreatedTime() {
@@ -94,12 +105,4 @@ public String getName() {
     public void setName(String name) {
         this.name = name;
     }
-
-    public String getTemplateId() {
-        return templateId;
-    }
-
-    public void setTemplateId(String templateId) {
-        this.templateId = templateId;
-    }
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgePK.java
index dbe4a21ce5..05734c8325 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgePK.java
@@ -20,22 +20,16 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the edge database table.
  */
-@Embeddable
 public class EdgePK implements Serializable {
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "EDGE_ID")
     private String edgeId;
-
-    @Column(name = "TEMPLATE_ID", insertable = false, updatable = false)
     private String templateId;
 
     public EdgePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodeEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodeEntity.java
index 6c65530e4d..8b5f6d8ab9 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodeEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodeEntity.java
@@ -20,22 +20,28 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
+import org.apache.airavata.model.ComponentStatus;
+
+import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
-
 /**
  * The persistent class for the node database table.
  */
 @Entity
+@Table(name = "NODE")
+@IdClass(NodePK.class)
 public class NodeEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private NodePK id;
+    @Id
+    @Column(name = "NODE_ID")
+    private String nodeId;
+
+    @Id
+    @Column(name = "TEMPLATE_ID")
+    private String templateId;
 
     @Column(name = "APPLICATION_ID")
     private String applicationId;
@@ -44,7 +50,7 @@
     private String applicationName;
 
     @Column(name = "COMPONENT_STATUS_ID")
-    private String componentStatusId;
+    private ComponentStatus status;
 
     @Column(name = "CREATED_TIME")
     private Timestamp createdTime;
@@ -55,18 +61,15 @@
     @Column(name = "NAME")
     private String name;
 
-    @Column(name = "TEMPLATE_ID")
-    private String templateId;
-
     public NodeEntity() {
     }
 
-    public NodePK getId() {
-        return id;
+    public String getNodeId() {
+        return nodeId;
     }
 
-    public void setId(NodePK id) {
-        this.id = id;
+    public void setNodeId(String nodeId) {
+        this.nodeId = nodeId;
     }
 
     public String getApplicationId() {
@@ -85,12 +88,12 @@ public void setApplicationName(String applicationName) {
         this.applicationName = applicationName;
     }
 
-    public String getComponentStatusId() {
-        return componentStatusId;
+    public ComponentStatus getStatus() {
+        return status;
     }
 
-    public void setComponentStatusId(String componentStatusId) {
-        this.componentStatusId = componentStatusId;
+    public void setStatus(ComponentStatus status) {
+        this.status = status;
     }
 
     public Timestamp getCreatedTime() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodePK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodePK.java
index 5004637c9c..76bf68d073 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodePK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodePK.java
@@ -20,22 +20,16 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the node database table.
  */
-@Embeddable
 public class NodePK implements Serializable {
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "NODE_ID")
     private String nodeId;
-
-    @Column(name = "TEMPLATE_ID", insertable = false, updatable = false)
     private String templateId;
 
     public NodePK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortEntity.java
index f6e9cef532..21f471853b 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortEntity.java
@@ -20,9 +20,9 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
+import org.apache.airavata.model.ComponentStatus;
+
+import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
@@ -31,14 +31,21 @@
  * The persistent class for the port database table.
  */
 @Entity
+@Table(name = "PORT")
+@IdClass(PortPK.class)
 public class PortEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private PortPK id;
+    @Id
+    @Column(name = "PORT_ID")
+    private String portId;
+
+    @Id
+    @Column(name = "TEMPLATE_ID")
+    private String templateId;
 
     @Column(name = "COMPONENT_STATUS_ID")
-    private String componentStatusId;
+    private ComponentStatus status;
 
     @Column(name = "CREATED_TIME")
     private Timestamp createdTime;
@@ -49,27 +56,23 @@
     @Column(name = "NAME")
     private String name;
 
-    @Column(name = "TEMPLATE_ID")
-    private String templateId;
-
     public PortEntity() {
     }
 
-
-    public PortPK getId() {
-        return id;
+    public String getPortId() {
+        return portId;
     }
 
-    public void setId(PortPK id) {
-        this.id = id;
+    public void setPortId(String portId) {
+        this.portId = portId;
     }
 
-    public String getComponentStatusId() {
-        return componentStatusId;
+    public ComponentStatus getComponentStatusId() {
+        return status;
     }
 
-    public void setComponentStatusId(String componentStatusId) {
-        this.componentStatusId = componentStatusId;
+    public void setComponentStatusId(ComponentStatus status) {
+        this.status = status;
     }
 
     public Timestamp getCreatedTime() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortPK.java
index e98c6c2337..593fedbe06 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortPK.java
@@ -20,23 +20,17 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the port database table.
  * 
  */
-@Embeddable
 public class PortPK implements Serializable {
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="PORT_ID")
 	private String portId;
-
-	@Column(name="TEMPLATE_ID", insertable=false, updatable=false)
 	private String templateId;
 
 	public PortPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowEntity.java
index 0faba1fd62..db615efc2d 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowEntity.java
@@ -20,16 +20,20 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
+import org.apache.airavata.model.application.io.InputDataObjectType;
+import org.apache.airavata.model.application.io.OutputDataObjectType;
+
+import java.nio.ByteBuffer;
+import java.util.List;
 import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
-
 /**
  * The persistent class for the workflow database table.
  */
 @Entity
-@Table(name="workflow")
+@Table(name="WORKFLOW")
 public class WorkflowEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
@@ -40,8 +44,7 @@
     @Column(name = "CREATED_USER")
     private String createdUser;
 
-    @Column(name = "CREATION_TIME", insertable = false, updatable = false)
-    @Temporal(TemporalType.TIMESTAMP)
+    @Column(name = "CREATION_TIME")
     private Timestamp creationTime;
 
     @Column(name = "GATEWAY_ID")
@@ -51,7 +54,7 @@
     private String graph;
 
     @Column(name = "IMAGE")
-    private byte[] image;
+    private ByteBuffer image;
 
     @Column(name = "UPDATE_TIME")
     private Timestamp updateTime;
@@ -59,6 +62,13 @@
     @Column(name = "WORKFLOW_NAME")
     private String name;
 
+    @OneToMany(targetEntity = WorkflowInputEntity.class, cascade = CascadeType.ALL,
+            mappedBy = "workflow", fetch = FetchType.EAGER)
+    private List<WorkflowInputEntity> workflowInputs;
+
+    @OneToMany(targetEntity = WorkflowOutputEntity.class, cascade = CascadeType.ALL,
+            mappedBy = "workflow", fetch = FetchType.EAGER)
+    private List<WorkflowOutputEntity> workflowOutputs;
 
     public WorkflowEntity() {
     }
@@ -113,12 +123,12 @@ public void setGraph(String graph) {
         this.graph = graph;
     }
 
-    public byte[] getImage() {
+    public ByteBuffer getImage() {
 
         return this.image;
     }
 
-    public void setImage(byte[] image) {
+    public void setImage(ByteBuffer image) {
 
         this.image = image;
     }
@@ -140,4 +150,20 @@ public String getName() {
     public void setName(String name) {
         this.name = name;
     }
+
+    public List<WorkflowInputEntity> getWorkflowInputs() {
+        return workflowInputs;
+    }
+
+    public void setWorkflowInputs(List<WorkflowInputEntity> workflowInputs) {
+        this.workflowInputs = workflowInputs;
+    }
+
+    public List<WorkflowOutputEntity> getWorkflowOutputs() {
+        return workflowOutputs;
+    }
+
+    public void setWorkflowOutputs(List<WorkflowOutputEntity> workflowOutputs) {
+        this.workflowOutputs = workflowOutputs;
+    }
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputEntity.java
index b28ce080e6..46adcb8128 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputEntity.java
@@ -20,32 +20,34 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 
-
 /**
  * The persistent class for the workflow_input database table.
  */
 @Entity
-@Table(name = "workflow_input")
+@Table(name = "WORKFLOW_INPUT")
+@IdClass(WorkflowInputPK.class)
 public class WorkflowInputEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private WorkflowInputPK id;
+    @Id
+    @Column(name = "TEMPLATE_ID")
+    private String templateId;
+
+    @Id
+    @Column(name = "INPUT_KEY")
+    private String name;
 
     @Column(name = "APP_ARGUMENT")
-    private String appArgument;
+    private String applicationArgument;
 
     @Column(name = "DATA_STAGED")
-    private short dataStaged;
+    private boolean dataStaged;
 
     @Column(name = "DATA_TYPE")
-    private String dataType;
+    private String type;
 
     @Column(name = "INPUT_ORDER")
     private int inputOrder;
@@ -54,57 +56,65 @@
     private String inputValue;
 
     @Column(name = "IS_REQUIRED")
-    private short isRequired;
+    private boolean isRequired;
 
     @Column(name = "METADATA")
-    private String metadata;
+    private String metaData;
 
     @Column(name = "REQUIRED_TO_COMMANDLINE")
-    private short requiredToCommandline;
+    private boolean requiredToAddedToCommandLine;
 
     @Column(name = "STANDARD_INPUT")
-    private short standardInput;
+    private boolean standardInput;
 
     @Column(name = "USER_FRIENDLY_DESC")
-    private String userFriendlyDesc;
-
+    private String userFriendlyDescription;
 
-    @Column(name = "TEMPLATE_ID")
-    private String templateId;
+    @ManyToOne(targetEntity = WorkflowEntity.class, cascade = CascadeType.MERGE)
+    @JoinColumn(name = "TEMPLATE_ID")
+    private WorkflowEntity workflow;
 
     public WorkflowInputEntity() {
     }
 
-    public WorkflowInputPK getId() {
-        return id;
+    public String getTemplateId() {
+        return templateId;
     }
 
-    public void setId(WorkflowInputPK id) {
-        this.id = id;
+    public void setTemplateId(String templateId) {
+        this.templateId = templateId;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public void setName(String name) {
+        this.name = name;
     }
 
-    public String getAppArgument() {
-        return appArgument;
+    public String getApplicationArgument() {
+        return applicationArgument;
     }
 
-    public void setAppArgument(String appArgument) {
-        this.appArgument = appArgument;
+    public void setApplicationArgument(String applicationArgument) {
+        this.applicationArgument = applicationArgument;
     }
 
-    public short getDataStaged() {
+    public boolean getDataStaged() {
         return dataStaged;
     }
 
-    public void setDataStaged(short dataStaged) {
+    public void setDataStaged(boolean dataStaged) {
         this.dataStaged = dataStaged;
     }
 
-    public String getDataType() {
-        return dataType;
+    public String getType() {
+        return type;
     }
 
-    public void setDataType(String dataType) {
-        this.dataType = dataType;
+    public void setType(String type) {
+        this.type = type;
     }
 
     public int getInputOrder() {
@@ -123,51 +133,51 @@ public void setInputValue(String inputValue) {
         this.inputValue = inputValue;
     }
 
-    public short getIsRequired() {
+    public boolean getIsRequired() {
         return isRequired;
     }
 
-    public void setIsRequired(short isRequired) {
+    public void setIsRequired(boolean isRequired) {
         this.isRequired = isRequired;
     }
 
-    public String getMetadata() {
-        return metadata;
+    public String getMetaData() {
+        return metaData;
     }
 
-    public void setMetadata(String metadata) {
-        this.metadata = metadata;
+    public void setMetaData(String metaData) {
+        this.metaData = metaData;
     }
 
-    public short getRequiredToCommandline() {
-        return requiredToCommandline;
+    public boolean getRequiredToAddedToCommandLine() {
+        return requiredToAddedToCommandLine;
     }
 
-    public void setRequiredToCommandline(short requiredToCommandline) {
-        this.requiredToCommandline = requiredToCommandline;
+    public void setRequiredToAddedToCommandLine(boolean requiredToAddedToCommandLine) {
+        this.requiredToAddedToCommandLine = requiredToAddedToCommandLine;
     }
 
-    public short getStandardInput() {
+    public boolean getStandardInput() {
         return standardInput;
     }
 
-    public void setStandardInput(short standardInput) {
+    public void setStandardInput(boolean standardInput) {
         this.standardInput = standardInput;
     }
 
-    public String getUserFriendlyDesc() {
-        return userFriendlyDesc;
+    public String getUserFriendlyDescription() {
+        return userFriendlyDescription;
     }
 
-    public void setUserFriendlyDesc(String userFriendlyDesc) {
-        this.userFriendlyDesc = userFriendlyDesc;
+    public void setUserFriendlyDescription(String userFriendlyDescription) {
+        this.userFriendlyDescription = userFriendlyDescription;
     }
 
-    public String getTemplateId() {
-        return templateId;
+    public WorkflowEntity getWorkflow() {
+        return workflow;
     }
 
-    public void setTemplateId(String templateId) {
-        this.templateId = templateId;
+    public void setWorkflow(WorkflowEntity workflow) {
+        this.workflow = workflow;
     }
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputPK.java
index 8681fb3571..8fc7eb854d 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputPK.java
@@ -20,23 +20,17 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the workflow_input database table.
  */
-@Embeddable
 public class WorkflowInputPK implements Serializable {
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "TEMPLATE_ID", insertable = false, updatable = false)
     private String templateId;
-
-    @Column(name = "INPUT_KEY")
-    private String inputKey;
+    private String name;
 
     public WorkflowInputPK() {
     }
@@ -51,14 +45,14 @@ public void setTemplateId(String templateId) {
         this.templateId = templateId;
     }
 
-    public String getInputKey() {
+    public String getName() {
 
-        return this.inputKey;
+        return this.name;
     }
 
-    public void setInputKey(String inputKey) {
+    public void setName(String name) {
 
-        this.inputKey = inputKey;
+        this.name = name;
     }
 
     public boolean equals(Object other) {
@@ -71,14 +65,14 @@ public boolean equals(Object other) {
         WorkflowInputPK castOther = (WorkflowInputPK) other;
         return
                 this.templateId.equals(castOther.templateId)
-                        && this.inputKey.equals(castOther.inputKey);
+                        && this.name.equals(castOther.name);
     }
 
     public int hashCode() {
         final int prime = 31;
         int hash = 17;
         hash = hash * prime + this.templateId.hashCode();
-        hash = hash * prime + this.inputKey.hashCode();
+        hash = hash * prime + this.name.hashCode();
 
         return hash;
     }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputEntity.java
index 0a1d62ee75..9f6fa7b46c 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputEntity.java
@@ -23,30 +23,35 @@
 import javax.persistence.*;
 import java.io.Serializable;
 
-
 /**
  * The persistent class for the workflow_output database table.
  * 
  */
 @Entity
-@Table(name="workflow_output")
+@Table(name="WORKFLOW_OUTPUT")
+@IdClass(WorkflowOutputPK.class)
 public class WorkflowOutputEntity implements Serializable {
 	private static final long serialVersionUID = 1L;
 
-	@EmbeddedId
-	private WorkflowOutputPK id;
+	@Id
+	@Column(name = "TEMPLATE_ID")
+	private String templateId;
+
+	@Id
+	@Column(name = "OUTPUT_KEY")
+	private String name;
 
 	@Column(name="APP_ARGUMENT")
-	private String appArgument;
+	private String applicationArgument;
 
 	@Column(name="DATA_MOVEMENT")
 	private short dataMovement;
 
 	@Column(name="DATA_NAME_LOCATION")
-	private String dataNameLocation;
+	private String location;
 
 	@Column(name="DATA_TYPE")
-	private String dataType;
+	private String type;
 
 	@Column(name="IS_REQUIRED")
 	private short isRequired;
@@ -54,36 +59,44 @@
 	@Column(name="OUTPUT_STREAMING")
 	private short outputStreaming;
 
-	@Lob
 	@Column(name="OUTPUT_VALUE")
-	private String outputValue;
+	private String value;
 
 	@Column(name="REQUIRED_TO_COMMANDLINE")
-	private short requiredToCommandline;
+	private short requiredToAddedToCommandLine;
 
 	@Column(name="SEARCH_QUERY")
 	private String searchQuery;
 
-	@Column(name="TEMPLATE_ID")
-	private String templateId;
+	@ManyToOne(targetEntity = WorkflowEntity.class, cascade = CascadeType.MERGE)
+	@JoinColumn(name = "TEMPLATE_ID")
+	private WorkflowEntity workflow;
 
 	public WorkflowOutputEntity() {
 	}
 
-	public WorkflowOutputPK getId() {
-		return id;
+	public String getTemplateId() {
+		return templateId;
+	}
+
+	public void setTemplateId(String templateId) {
+		this.templateId = templateId;
+	}
+
+	public String getName() {
+		return name;
 	}
 
-	public void setId(WorkflowOutputPK id) {
-		this.id = id;
+	public void setName(String name) {
+		this.name = name;
 	}
 
-	public String getAppArgument() {
-		return appArgument;
+	public String getApplicationArgument() {
+		return applicationArgument;
 	}
 
-	public void setAppArgument(String appArgument) {
-		this.appArgument = appArgument;
+	public void setApplicationArgument(String applicationArgument) {
+		this.applicationArgument = applicationArgument;
 	}
 
 	public short getDataMovement() {
@@ -94,20 +107,20 @@ public void setDataMovement(short dataMovement) {
 		this.dataMovement = dataMovement;
 	}
 
-	public String getDataNameLocation() {
-		return dataNameLocation;
+	public String getLocation() {
+		return location;
 	}
 
-	public void setDataNameLocation(String dataNameLocation) {
-		this.dataNameLocation = dataNameLocation;
+	public void setLocation(String location) {
+		this.location = location;
 	}
 
-	public String getDataType() {
-		return dataType;
+	public String getType() {
+		return type;
 	}
 
-	public void setDataType(String dataType) {
-		this.dataType = dataType;
+	public void setType(String type) {
+		this.type = type;
 	}
 
 	public short getIsRequired() {
@@ -126,20 +139,20 @@ public void setOutputStreaming(short outputStreaming) {
 		this.outputStreaming = outputStreaming;
 	}
 
-	public String getOutputValue() {
-		return outputValue;
+	public String getValue() {
+		return value;
 	}
 
-	public void setOutputValue(String outputValue) {
-		this.outputValue = outputValue;
+	public void setValue(String value) {
+		this.value = value;
 	}
 
-	public short getRequiredToCommandline() {
-		return requiredToCommandline;
+	public short getRequiredToAddedToCommandLine() {
+		return requiredToAddedToCommandLine;
 	}
 
-	public void setRequiredToCommandline(short requiredToCommandline) {
-		this.requiredToCommandline = requiredToCommandline;
+	public void setRequiredToAddedToCommandLine(short requiredToAddedToCommandLine) {
+		this.requiredToAddedToCommandLine = requiredToAddedToCommandLine;
 	}
 
 	public String getSearchQuery() {
@@ -150,11 +163,11 @@ public void setSearchQuery(String searchQuery) {
 		this.searchQuery = searchQuery;
 	}
 
-	public String getTemplateId() {
-		return templateId;
+	public WorkflowEntity getWorkflow() {
+		return workflow;
 	}
 
-	public void setTemplateId(String templateId) {
-		this.templateId = templateId;
+	public void setWorkflow(WorkflowEntity workflow) {
+		this.workflow = workflow;
 	}
 }
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputPK.java
index 810a81e145..65c03c7415 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputPK.java
@@ -20,24 +20,18 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the workflow_output database table.
  * 
  */
-@Embeddable
 public class WorkflowOutputPK implements Serializable {
 	//default serial version id, required for serializable classes.
 	private static final long serialVersionUID = 1L;
 
-	@Column(name="TEMPLATE_ID", insertable=false, updatable=false)
 	private String templateId;
-
-	@Column(name="OUTPUT_KEY")
-	private String outputKey;
+	private String name;
 
 	public WorkflowOutputPK() {
 	}
@@ -50,12 +44,12 @@ public void setTemplateId(String templateId) {
 		this.templateId = templateId;
 	}
 
-	public String getOutputKey() {
-		return outputKey;
+	public String getName() {
+		return name;
 	}
 
-	public void setOutputKey(String outputKey) {
-		this.outputKey = outputKey;
+	public void setName(String name) {
+		this.name = name;
 	}
 
 	public boolean equals(Object other) {
@@ -68,14 +62,14 @@ public boolean equals(Object other) {
 		WorkflowOutputPK castOther = (WorkflowOutputPK)other;
 		return 
 			this.templateId.equals(castOther.templateId)
-			&& this.outputKey.equals(castOther.outputKey);
+			&& this.name.equals(castOther.name);
 	}
 
 	public int hashCode() {
 		final int prime = 31;
 		int hash = 17;
 		hash = hash * prime + this.templateId.hashCode();
-		hash = hash * prime + this.outputKey.hashCode();
+		hash = hash * prime + this.name.hashCode();
 		
 		return hash;
 	}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusEntity.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusEntity.java
index bc781d31bd..b419a33ab5 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusEntity.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusEntity.java
@@ -20,24 +20,26 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.EmbeddedId;
-import javax.persistence.Entity;
-import javax.persistence.Table;
+import javax.persistence.*;
 import java.io.Serializable;
 import java.sql.Timestamp;
 
-
 /**
  * The persistent class for the workflow_status database table.
  */
 @Entity
-@Table(name = "workflow_status")
+@Table(name = "WORKFLOW_STATUS")
+@IdClass(WorkflowStatusPK.class)
 public class WorkflowStatusEntity implements Serializable {
     private static final long serialVersionUID = 1L;
 
-    @EmbeddedId
-    private WorkflowStatusPK id;
+    @Id
+    @Column(name = "STATUS_ID")
+    private String statusId;
+
+    @Id
+    @Column(name = "TEMPLATE_ID")
+    private String templateId;
 
     @Column(name = "REASON")
     private String reason;
@@ -46,20 +48,17 @@
     private String state;
 
     @Column(name = "UPDATE_TIME")
-    private Timestamp updateTime;
-
-    @Column(name = "TEMPLATE_ID")
-    private String templateId;
+    private Timestamp timeOfStateChange;
 
     public WorkflowStatusEntity() {
     }
 
-    public WorkflowStatusPK getId() {
-        return id;
+    public String getStatusId() {
+        return statusId;
     }
 
-    public void setId(WorkflowStatusPK id) {
-        this.id = id;
+    public void setStatusId(String statusId) {
+        this.statusId = statusId;
     }
 
     public String getReason() {
@@ -78,12 +77,12 @@ public void setState(String state) {
         this.state = state;
     }
 
-    public Timestamp getUpdateTime() {
-        return updateTime;
+    public Timestamp getTimeOfStateChange() {
+        return timeOfStateChange;
     }
 
-    public void setUpdateTime(Timestamp updateTime) {
-        this.updateTime = updateTime;
+    public void setTimeOfStateChange(Timestamp timeOfStateChange) {
+        this.timeOfStateChange = timeOfStateChange;
     }
 
     public String getTemplateId() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusPK.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusPK.java
index 408e7684cf..216ab794bd 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusPK.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusPK.java
@@ -20,22 +20,16 @@
 */
 package org.apache.airavata.registry.core.entities.workflowcatalog;
 
-import javax.persistence.Column;
-import javax.persistence.Embeddable;
 import java.io.Serializable;
 
 /**
  * The primary key class for the workflow_status database table.
  */
-@Embeddable
 public class WorkflowStatusPK implements Serializable {
     //default serial version id, required for serializable classes.
     private static final long serialVersionUID = 1L;
 
-    @Column(name = "STATUS_ID")
     private String statusId;
-
-    @Column(name = "TEMPLATE_ID", insertable = false, updatable = false)
     private String templateId;
 
     public WorkflowStatusPK() {
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java
index ae8c66e275..3e0dcf3000 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java
@@ -363,12 +363,10 @@ public String addGridFTPDataMovement(GridFTPDataMovement gridFTPDataMovement) th
         List<String> gridFTPEndPoint = gridFTPDataMovement.getGridFTPEndPoints();
         if (gridFTPEndPoint != null && !gridFTPEndPoint.isEmpty()) {
             for (String endpoint : gridFTPEndPoint) {
-                GridftpEndpointPK gridftpEndpointPK = new GridftpEndpointPK();
-                gridftpEndpointPK.setDataMovementInterfaceId(gridFTPDataMovement.getDataMovementInterfaceId());
-                gridftpEndpointPK.setEndpoint(endpoint);
                 GridftpEndpointEntity gridftpEndpointEntity = new GridftpEndpointEntity();
                 gridftpEndpointEntity.setGridftpDataMovement(gridftpDataMovementEntity);
-                gridftpEndpointEntity.setId(gridftpEndpointPK);
+                gridftpEndpointEntity.setDataMovementInterfaceId(gridFTPDataMovement.getDataMovementInterfaceId());
+                gridftpEndpointEntity.setEndpoint(endpoint);
                 execute(entityManager -> entityManager.merge(gridftpEndpointEntity));
             }
         }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ResourceJobManagerRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ResourceJobManagerRepository.java
index 5128d81f04..c68fdd5c92 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ResourceJobManagerRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ResourceJobManagerRepository.java
@@ -40,13 +40,11 @@ public ResourceJobManagerRepository() {
     public void createJobManagerCommand(Map<JobManagerCommand, String> jobManagerCommands, ResourceJobManagerEntity resourceJobManagerEntity) {
         for (JobManagerCommand commandType : jobManagerCommands.keySet()) {
             if (jobManagerCommands.get(commandType) != null && !jobManagerCommands.get(commandType).isEmpty()) {
-                JobManagerCommandPK jobManagerCommandPK = new JobManagerCommandPK();
-                jobManagerCommandPK.setCommandType(commandType.toString());
-                jobManagerCommandPK.setResourceJobManagerId(resourceJobManagerEntity.getResourceJobManagerId());
                 JobManagerCommandEntity jobManagerCommandEntity = new JobManagerCommandEntity();
                 jobManagerCommandEntity.setCommand(jobManagerCommands.get(commandType));
                 jobManagerCommandEntity.setResourceJobManager(resourceJobManagerEntity);
-                jobManagerCommandEntity.setId(jobManagerCommandPK);
+                jobManagerCommandEntity.setResourceJobManagerId(resourceJobManagerEntity.getResourceJobManagerId());
+                jobManagerCommandEntity.setCommandType(commandType.toString());
                 execute(entityManager -> entityManager.merge(jobManagerCommandEntity));
             }
         }
@@ -55,13 +53,11 @@ public void createJobManagerCommand(Map<JobManagerCommand, String> jobManagerCom
     public void createParallesimPrefix(Map<ApplicationParallelismType, String> parallelismPrefix,ResourceJobManagerEntity resourceJobManagerEntity) {
         for (ApplicationParallelismType commandType : parallelismPrefix.keySet()) {
             if (parallelismPrefix.get(commandType) != null && !parallelismPrefix.get(commandType).isEmpty()) {
-                ParallelismCommandPK parallelismCommandPK = new ParallelismCommandPK();
-                parallelismCommandPK.setCommandType(commandType.toString());
-                parallelismCommandPK.setResourceJobManagerId(resourceJobManagerEntity.getResourceJobManagerId());
                 ParallelismCommandEntity parallelismCommandEntity = new ParallelismCommandEntity();
                 parallelismCommandEntity.setCommand(parallelismPrefix.get(commandType));
                 parallelismCommandEntity.setResourceJobManager(resourceJobManagerEntity);
-                parallelismCommandEntity.setId(parallelismCommandPK);
+                parallelismCommandEntity.setCommandType(commandType.toString());
+                parallelismCommandEntity.setResourceJobManagerId(resourceJobManagerEntity.getResourceJobManagerId());
                 execute(entityManager -> entityManager.merge(parallelismCommandEntity));
             }
         }
@@ -82,7 +78,7 @@ public void createParallesimPrefix(Map<ApplicationParallelismType, String> paral
         List<JobManagerCommandEntity> jobManagerCommandEntityList = resultSet;
         Map<JobManagerCommand, String> jobManagerCommandMap= new HashMap<JobManagerCommand,String>();
         for (JobManagerCommandEntity jm: jobManagerCommandEntityList) {
-            jobManagerCommandMap.put(JobManagerCommand.valueOf(jm.getId().getCommandType()), jm.getCommand());
+            jobManagerCommandMap.put(JobManagerCommand.valueOf(jm.getCommandType()), jm.getCommand());
         }
         return jobManagerCommandMap;
     }
@@ -102,7 +98,7 @@ public void createParallesimPrefix(Map<ApplicationParallelismType, String> paral
         List<ParallelismCommandEntity> parallelismCommandEntityList = resultSet;
         Map<ApplicationParallelismType, String> applicationParallelismTypeMap= new HashMap<ApplicationParallelismType,String>();
         for (ParallelismCommandEntity pc: parallelismCommandEntityList) {
-            applicationParallelismTypeMap.put(ApplicationParallelismType.valueOf(pc.getId().getCommandType()), pc.getCommand());
+            applicationParallelismTypeMap.put(ApplicationParallelismType.valueOf(pc.getCommandType()), pc.getCommand());
         }
         return applicationParallelismTypeMap;
     }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataProductRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataProductRepository.java
index 606bb69425..6377d86ec2 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataProductRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataProductRepository.java
@@ -85,23 +85,28 @@ protected DataProductEntity saveDataProduct(DataProductModel dataProductModel) t
 
     }
 
+    @Override
     public String registerDataProduct(DataProductModel dataProductModel) throws ReplicaCatalogException {
         return saveDataProductModelData(dataProductModel);
     }
 
+    @Override
     public boolean updateDataProduct(DataProductModel updatedDataProductModel) throws ReplicaCatalogException {
         return (saveDataProductModelData(updatedDataProductModel) != null);
     }
 
+    @Override
     public DataProductModel getDataProduct(String productUri) throws ReplicaCatalogException {
         return get(productUri);
     }
 
+    @Override
     public DataProductModel getParentDataProduct(String productUri) throws ReplicaCatalogException {
         DataProductModel dataProductModel = getDataProduct(productUri);
         return get(dataProductModel.getParentProductUri());
     }
 
+    @Override
     public List<DataProductModel> getChildDataProducts(String parentProductUri) throws ReplicaCatalogException {
         Map<String, Object> queryParameters = new HashMap<>();
         queryParameters.put(DBConstants.DataProduct.PARENT_PRODUCT_URI, parentProductUri);
@@ -109,6 +114,7 @@ public DataProductModel getParentDataProduct(String productUri) throws ReplicaCa
         return dataProductModelList;
     }
 
+    @Override
     public List<DataProductModel> searchDataProductsByName(String gatewayId, String userId, String productName,
                                                     int limit, int offset) throws ReplicaCatalogException {
         Map<String, Object> queryParameters = new HashMap<>();
@@ -119,10 +125,12 @@ public DataProductModel getParentDataProduct(String productUri) throws ReplicaCa
         return dataProductModelList;
     }
 
+    @Override
     public boolean isDataProductExists(String productUri) throws ReplicaCatalogException {
         return isExists(productUri);
     }
 
+    @Override
     public boolean removeDataProduct(String productUri) throws ReplicaCatalogException {
         return delete(productUri);
     }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataReplicaLocationRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataReplicaLocationRepository.java
index 8cfb7dc57c..df95f90cad 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataReplicaLocationRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/replicacatalog/DataReplicaLocationRepository.java
@@ -66,18 +66,22 @@ private DataReplicaLocationEntity saveDataReplicaLocation(DataReplicaLocationMod
         return execute(entityManager -> entityManager.merge(dataReplicaLocationEntity));
     }
 
+    @Override
     public String registerReplicaLocation(DataReplicaLocationModel dataReplicaLocationModel) throws ReplicaCatalogException {
         return saveDataReplicaLocationModelData(dataReplicaLocationModel);
     }
 
+    @Override
     public boolean updateReplicaLocation(DataReplicaLocationModel dataReplicaLocationModel) throws ReplicaCatalogException {
         return (saveDataReplicaLocationModelData(dataReplicaLocationModel) != null);
     }
 
+    @Override
     public DataReplicaLocationModel getReplicaLocation(String replicaId) throws ReplicaCatalogException {
         return get(replicaId);
     }
 
+    @Override
     public List<DataReplicaLocationModel> getAllReplicaLocations(String productUri) throws ReplicaCatalogException {
         DataProductRepository dataProductRepository = new DataProductRepository();
         DataProductModel dataProductModel = dataProductRepository.getDataProduct(productUri);
@@ -85,6 +89,7 @@ public DataReplicaLocationModel getReplicaLocation(String replicaId) throws Repl
         return dataReplicaLocationModelList;
     }
 
+    @Override
     public boolean removeReplicaLocation(String replicaId) throws ReplicaCatalogException {
         return delete(replicaId);
     }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/ComponentStatusRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/ComponentStatusRepository.java
deleted file mode 100644
index 753c36f080..0000000000
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/ComponentStatusRepository.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.core.repositories.workflowcatalog;
-
-import org.apache.airavata.model.ComponentStatus;
-import org.apache.airavata.registry.core.entities.workflowcatalog.ComponentStatusEntity;
-import org.apache.airavata.registry.core.repositories.AbstractRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class ComponentStatusRepository extends AbstractRepository<ComponentStatus, ComponentStatusEntity, String> {
-
-
-    private final static Logger logger = LoggerFactory.getLogger(ComponentStatusRepository.class);
-
-    public ComponentStatusRepository(Class<ComponentStatus> thriftGenericClass, Class<ComponentStatusEntity> dbEntityGenericClass) {
-        super(thriftGenericClass, dbEntityGenericClass);
-    }
-}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/EdgeRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/EdgeRepository.java
deleted file mode 100644
index df55931cc2..0000000000
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/EdgeRepository.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.core.repositories.workflowcatalog;
-
-import org.apache.airavata.model.EdgeModel;
-import org.apache.airavata.registry.core.entities.workflowcatalog.EdgeEntity;
-import org.apache.airavata.registry.core.entities.workflowcatalog.EdgePK;
-import org.apache.airavata.registry.core.repositories.AbstractRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class EdgeRepository extends AbstractRepository<EdgeModel, EdgeEntity, EdgePK> {
-
-
-    private final static Logger logger = LoggerFactory.getLogger(EdgeRepository.class);
-
-    public EdgeRepository(Class<EdgeModel> thriftGenericClass, Class<EdgeEntity> dbEntityGenericClass) {
-        super(thriftGenericClass, dbEntityGenericClass);
-    }
-}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/NodeRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/NodeRepository.java
deleted file mode 100644
index b1cf8fa6cb..0000000000
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/NodeRepository.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.core.repositories.workflowcatalog;
-
-import org.apache.airavata.model.NodeModel;
-import org.apache.airavata.registry.core.entities.workflowcatalog.NodeEntity;
-import org.apache.airavata.registry.core.entities.workflowcatalog.NodePK;
-import org.apache.airavata.registry.core.repositories.AbstractRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class NodeRepository extends AbstractRepository<NodeModel, NodeEntity, NodePK> {
-
-
-    private final static Logger logger = LoggerFactory.getLogger(NodeRepository.class);
-
-    public NodeRepository(Class<NodeModel> thriftGenericClass, Class<NodeEntity> dbEntityGenericClass) {
-        super(thriftGenericClass, dbEntityGenericClass);
-    }
-}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowCatAbstractRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowCatAbstractRepository.java
new file mode 100644
index 0000000000..94df040887
--- /dev/null
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowCatAbstractRepository.java
@@ -0,0 +1,133 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+*/
+package org.apache.airavata.registry.core.repositories.workflowcatalog;
+
+import org.apache.airavata.registry.core.utils.Committer;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.JPAUtil.RepCatalogJPAUtils;
+import org.apache.airavata.registry.core.utils.JPAUtil.WorkflowCatalogJPAUtils;
+import org.apache.airavata.registry.core.utils.ObjectMapperSingleton;
+import org.dozer.Mapper;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.EntityManager;
+import javax.persistence.Query;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+public abstract class WorkflowCatAbstractRepository<T, E, Id> {
+    private final static Logger logger = LoggerFactory.getLogger(WorkflowCatAbstractRepository.class);
+
+    private Class<T> thriftGenericClass;
+    private Class<E> dbEntityGenericClass;
+
+    public WorkflowCatAbstractRepository(Class<T> thriftGenericClass, Class<E> dbEntityGenericClass) {
+        this.thriftGenericClass = thriftGenericClass;
+        this.dbEntityGenericClass = dbEntityGenericClass;
+    }
+
+    public T create(T t) {
+        return update(t);
+    }
+
+    public T update(T t) {
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        E entity = mapper.map(t, dbEntityGenericClass);
+        E persistedCopy = execute(entityManager -> entityManager.merge(entity));
+        return mapper.map(persistedCopy, thriftGenericClass);
+    }
+
+    public boolean delete(Id id) {
+        execute(entityManager -> {
+            E entity = entityManager.find(dbEntityGenericClass, id);
+            entityManager.remove(entity);
+            return entity;
+        });
+        return true;
+    }
+
+    public T get(Id id) {
+        E entity = execute(entityManager -> entityManager
+                .find(dbEntityGenericClass, id));
+        if(entity == null)
+            return null;
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        return mapper.map(entity, thriftGenericClass);
+    }
+
+    public List<T> select(String query, int offset) {
+        List resultSet = (List) execute(entityManager -> entityManager.createQuery(query).setFirstResult(offset)
+                .getResultList());
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        List<T> gatewayList = new ArrayList<>();
+        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
+        return gatewayList;
+    }
+
+    public List<T> select(String query, int limit, int offset, Map<String, Object> queryParams) {
+        int newLimit = limit < 0 ? DBConstants.SELECT_MAX_ROWS: limit;
+
+        List resultSet = (List) execute(entityManager -> {
+            Query jpaQuery = entityManager.createQuery(query);
+
+            for (Map.Entry<String, Object> entry : queryParams.entrySet()) {
+
+                jpaQuery.setParameter(entry.getKey(), entry.getValue());
+            }
+
+            return jpaQuery.setFirstResult(offset).setMaxResults(newLimit).getResultList();
+
+        });
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        List<T> gatewayList = new ArrayList<>();
+        resultSet.stream().forEach(rs -> gatewayList.add(mapper.map(rs, thriftGenericClass)));
+        return gatewayList;
+    }
+
+    public boolean isExists(Id id) {
+        return get(id) != null;
+    }
+
+    public <R> R execute(Committer<EntityManager, R> committer){
+        EntityManager entityManager = null;
+        try {
+            entityManager = WorkflowCatalogJPAUtils.getEntityManager();
+        } catch (Exception e) {
+            throw new RuntimeException("Failed to get Workflow Catalog EntityManager", e);
+        }
+        try {
+            entityManager.getTransaction().begin();
+            R r = committer.commit(entityManager);
+            entityManager.getTransaction().commit();
+            return  r;
+        }finally {
+            if (entityManager != null && entityManager.isOpen()) {
+                if (entityManager.getTransaction().isActive()) {
+                    entityManager.getTransaction().rollback();
+                }
+                entityManager.close();
+            }
+        }
+    }
+
+}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowRepository.java
index b702342678..d3a0f0531c 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowRepository.java
@@ -21,17 +21,135 @@
 package org.apache.airavata.registry.core.repositories.workflowcatalog;
 
 import org.apache.airavata.model.WorkflowModel;
+import org.apache.airavata.model.application.io.OutputDataObjectType;
 import org.apache.airavata.registry.core.entities.workflowcatalog.WorkflowEntity;
-import org.apache.airavata.registry.core.repositories.AbstractRepository;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.airavata.registry.core.utils.ObjectMapperSingleton;
+import org.apache.airavata.registry.core.utils.QueryConstants;
+import org.apache.airavata.registry.core.utils.WorkflowCatalogUtils;
+import org.apache.airavata.registry.cpi.WorkflowCatalog;
+import org.apache.airavata.registry.cpi.WorkflowCatalogException;
+import org.dozer.Mapper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-public class WorkflowRepository extends AbstractRepository<WorkflowModel, WorkflowEntity, String> {
+import java.sql.Timestamp;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
 
+public class WorkflowRepository extends WorkflowCatAbstractRepository<WorkflowModel, WorkflowEntity, String> implements WorkflowCatalog {
     private final static Logger logger = LoggerFactory.getLogger(WorkflowRepository.class);
 
+    public WorkflowRepository() { super(WorkflowModel.class, WorkflowEntity.class); }
 
-    public WorkflowRepository(Class<WorkflowModel> thriftGenericClass, Class<WorkflowEntity> dbEntityGenericClass) {
-        super(thriftGenericClass, dbEntityGenericClass);
+    protected String saveWorkflowModelData(WorkflowModel workflowModel, String gatewayId) throws WorkflowCatalogException {
+        WorkflowEntity workflowEntity = saveWorkflow(workflowModel, gatewayId);
+        return workflowEntity.getTemplateId();
     }
+
+    protected WorkflowEntity saveWorkflow(WorkflowModel workflowModel, String gatewayId) throws WorkflowCatalogException {
+        if (workflowModel.getTemplateId() == null) {
+            logger.debug("Setting the Template ID for the new Workflow");
+            workflowModel.setTemplateId(WorkflowCatalogUtils.getID(workflowModel.getName()));
+        }
+
+        String templateId = workflowModel.getTemplateId();
+        Mapper mapper = ObjectMapperSingleton.getInstance();
+        WorkflowEntity workflowEntity = mapper.map(workflowModel, WorkflowEntity.class);
+
+        if (gatewayId != null) {
+            logger.debug("Setting the gateway ID of the Workflow");
+            workflowEntity.setGatewayId(gatewayId);
+        }
+
+        if (workflowEntity.getWorkflowInputs() != null) {
+            logger.debug("Populating the template ID for WorkflowInput objects for the Workflow");
+            workflowEntity.getWorkflowInputs().forEach(workflowInputEntity -> workflowInputEntity.setTemplateId(templateId));
+        }
+
+        if (workflowEntity.getWorkflowOutputs() != null) {
+            logger.debug("Populating the template ID for WorkflowOutput objects for the Workflow");
+            workflowEntity.getWorkflowOutputs().forEach(workflowOutputEntity -> workflowOutputEntity.setTemplateId(templateId));
+        }
+
+        if (get(templateId) == null) {
+            logger.debug("Checking if the Workflow already exists");
+            workflowEntity.setCreationTime(new Timestamp(System.currentTimeMillis()));
+        }
+
+        workflowEntity.setUpdateTime(new Timestamp(System.currentTimeMillis()));
+
+        return execute(entityManager -> entityManager.merge(workflowEntity));
+    }
+
+    @Override
+    public String registerWorkflow(WorkflowModel workflowModel, String gatewayId) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        //return saveWorkflowModelData(workflowModel, gatewayId);
+    }
+
+    @Override
+    public void updateWorkflow(String templateId, WorkflowModel updatedWorkflowModel) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        //saveWorkflowModelData(updatedWorkflowModel, null);
+    }
+
+    @Override
+    public WorkflowModel getWorkflow(String templateId) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        //return get(templateId);
+    }
+
+    @Override
+    public List<String> getAllWorkflows(String gatewayId) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        /*Map<String, Object> queryParameters = new HashMap<>();
+        queryParameters.put(DBConstants.Workflow.GATEWAY_ID, gatewayId);
+        List<WorkflowModel> workflowModelList = select(QueryConstants.GET_ALL_WORKFLOWS, -1, 0, queryParameters);
+        List<String> workflows = new ArrayList<>();
+        for (WorkflowModel workflowModel : workflowModelList) {
+            workflows.add(workflowModel.getTemplateId());
+        }
+        return workflows;*/
+    }
+
+    @Override
+    public String getWorkflowTemplateId(String workflowName) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        /*Map<String, Object> queryParameters = new HashMap<>();
+        queryParameters.put(DBConstants.Workflow.WORKFLOW_NAME, workflowName);
+        List<WorkflowModel> workflowModelList = select(QueryConstants.GET_WORKFLOW_GIVEN_NAME, -1, 0, queryParameters);
+
+        if (!workflowModelList.isEmpty() && workflowModelList != null) {
+            logger.debug("Return the record (there is only one record)");
+            return workflowModelList.get(0).getTemplateId();
+        }
+        return null;*/
+    }
+
+    @Override
+    public boolean isWorkflowExistWithName(String workflowName) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        /*Map<String, Object> queryParameters = new HashMap<>();
+        queryParameters.put(DBConstants.Workflow.WORKFLOW_NAME, workflowName);
+        List<WorkflowModel> workflowModelList = select(QueryConstants.GET_WORKFLOW_GIVEN_NAME, -1, 0, queryParameters);
+        return (!workflowModelList.isEmpty() && workflowModelList != null);*/
+    }
+
+    @Override
+    public void updateWorkflowOutputs(String templateId, List<OutputDataObjectType> workflowOutputs) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        /*WorkflowModel workflowModel = getWorkflow(templateId);
+        workflowModel.setWorkflowOutputs(workflowOutputs);
+        updateWorkflow(workflowModel.getTemplateId(), workflowModel);*/
+    }
+
+    @Override
+    public void deleteWorkflow(String templateId) throws WorkflowCatalogException {
+        throw new WorkflowCatalogException("This method is not implemented");
+        //delete(templateId);
+    }
+
 }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowStatusRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowStatusRepository.java
deleted file mode 100644
index d4c434bb21..0000000000
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowStatusRepository.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.core.repositories.workflowcatalog;
-
-import org.apache.airavata.model.WorkflowStatus;
-import org.apache.airavata.registry.core.entities.workflowcatalog.WorkflowStatusEntity;
-import org.apache.airavata.registry.core.entities.workflowcatalog.WorkflowStatusPK;
-import org.apache.airavata.registry.core.repositories.AbstractRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowStatusRepository extends AbstractRepository<WorkflowStatus, WorkflowStatusEntity, WorkflowStatusPK> {
-
-    private final static Logger logger = LoggerFactory.getLogger(WorkflowStatusRepository.class);
-
-    public WorkflowStatusRepository(Class<WorkflowStatus> thriftGenericClass, Class<WorkflowStatusEntity> dbEntityGenericClass) {
-        super(thriftGenericClass, dbEntityGenericClass);
-    }
-}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java
index 0a0553259f..15ca0bf9e4 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/DBConstants.java
@@ -23,6 +23,7 @@
 
     public static int SELECT_MAX_ROWS = 1000;
     public static final String CONFIGURATION = "Configuration";
+    public static final String WORKFLOW = "Workflow";
 
     public static class ApplicationDeployment {
         public static final String APPLICATION_MODULE_ID = "appModuleId";
@@ -44,17 +45,10 @@
 
     public static class ApplicationInput {
         public static final String APPLICATION_INTERFACE_ID = "interfaceId";
-        public static final String INPUT_KEY = "inputKey";
     }
 
     public static class ApplicationOutput {
         public static final String APPLICATION_INTERFACE_ID = "interfaceId";
-        public static final String OUTPUT_KEY = "outputKey";
-    }
-
-    public static class AppModuleMapping {
-        public static final String APPLICATION_INTERFACE_ID = "interfaceId";
-        public static final String APPLICATION_MODULE_ID = "moduleId";
     }
 
     public static class ComputeResourcePreference {
@@ -79,36 +73,6 @@
         public static final String GROUP_RESOURCE_PROFILE_ID = "groupResourceProfileId";
     }
 
-    public final class PreJobCommand {
-        public static final String APPLICATION_DEPLOYMENT_ID = "deploymentId";
-        public static final String COMMAND = "command";
-    }
-
-    public final class PostJobCommand {
-        public static final String APPLICATION_DEPLOYMENT_ID = "deploymentId";
-        public static final String COMMAND = "command";
-    }
-
-    public final class LibraryPrepandPathConstants {
-        public static final String APPLICATION_DEPLOYMENT_ID = "deploymentID";
-        public static final String NAME = "name";
-    }
-
-    public final class LibraryApendPath {
-        public static final String APPLICATION_DEPLOYMENT_ID = "deploymentID";
-        public static final String NAME = "name";
-    }
-
-    public final class AppEnvironment {
-        public static final String APPLICATION_DEPLOYMENT_ID = "deploymentID";
-        public static final String NAME = "name";
-    }
-
-    public final class ModuleLoadCmd {
-        public static final String APPLICATION_DEPLOYMENT_ID = "appDeploymentId";
-        public static final String COMMAND = "cmd";
-    }
-
     public static class UserResourceProfile {
         public static final String USER_ID = "userId";
         public static final String GATEWAY_ID = "gatewayId";
@@ -133,4 +97,9 @@
         public static final String PARENT_PRODUCT_URI = "parentProductUri";
     }
 
+    public static class Workflow {
+        public static final String GATEWAY_ID = "gatewayId";
+        public static final String WORKFLOW_NAME = "workflowName";
+    }
+
 }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtil/WorkflowCatalogJPAUtils.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtil/WorkflowCatalogJPAUtils.java
new file mode 100644
index 0000000000..e12bbde778
--- /dev/null
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/JPAUtil/WorkflowCatalogJPAUtils.java
@@ -0,0 +1,80 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.airavata.registry.core.utils.JPAUtil;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import javax.persistence.*;
+import java.util.HashMap;
+import java.util.Map;
+
+public class WorkflowCatalogJPAUtils {
+    private final static Logger logger = LoggerFactory.getLogger(WorkflowCatalogJPAUtils.class);
+
+    private static final String PERSISTENCE_UNIT_NAME = "workflowcatalog_data";
+    private static final String WFCATALOG_JDBC_DRIVER = "workflowcatalog.jdbc.driver";
+    private static final String WFCATALOG_JDBC_URL = "workflowcatalog.jdbc.url";
+    private static final String WFCATALOG_JDBC_USER = "workflowcatalog.jdbc.user";
+    private static final String WFCATALOG_JDBC_PASSWORD = "workflowcatalog.jdbc.password";
+    private static final String WFCATALOG_VALIDATION_QUERY = "workflowcatalog.validationQuery";
+    private static final String JPA_CACHE_SIZE = "jpa.cache.size";
+    private static final String JPA_CACHE_ENABLED = "cache.enable";
+    @PersistenceUnit(unitName=PERSISTENCE_UNIT_NAME)
+    protected static EntityManagerFactory factory;
+    @PersistenceContext(unitName=PERSISTENCE_UNIT_NAME)
+    private static EntityManager wfCatEntityManager;
+
+    public static EntityManager getEntityManager() throws ApplicationSettingsException {
+        if (factory == null) {
+            String connectionProperties = "DriverClassName=" + readServerProperties(WFCATALOG_JDBC_DRIVER) + "," +
+                    "Url=" + readServerProperties(WFCATALOG_JDBC_URL) + "?autoReconnect=true," +
+                    "Username=" + readServerProperties(WFCATALOG_JDBC_USER) + "," +
+                    "Password=" + readServerProperties(WFCATALOG_JDBC_PASSWORD) +
+                    ",validationQuery=" + readServerProperties(WFCATALOG_VALIDATION_QUERY);
+            System.out.println(connectionProperties);
+            Map<String, String> properties = new HashMap<>();
+            properties.put("openjpa.ConnectionDriverName", "org.apache.commons.dbcp.BasicDataSource");
+            properties.put("openjpa.ConnectionProperties", connectionProperties);
+            properties.put("openjpa.DynamicEnhancementAgent", "true");
+            properties.put("openjpa.RuntimeUnenhancedClasses", "unsupported");
+            properties.put("openjpa.RemoteCommitProvider","sjvm");
+            properties.put("openjpa.Log","DefaultLevel=INFO, Runtime=INFO, Tool=INFO, SQL=INFO");
+            properties.put("openjpa.jdbc.SynchronizeMappings", "buildSchema(ForeignKeys=true)");
+            properties.put("openjpa.jdbc.QuerySQLCache", "false");
+            properties.put("openjpa.ConnectionFactoryProperties", "PrettyPrint=true, PrettyPrintLineLength=72, PrintParameters=true, MaxActive=10, MaxIdle=5, MinIdle=2, MaxWait=31536000,  autoReconnect=true");
+            factory = Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);
+        }
+        wfCatEntityManager = factory.createEntityManager();
+        return wfCatEntityManager;
+    }
+
+    private static String readServerProperties (String propertyName) throws ApplicationSettingsException {
+        try {
+            return ServerSettings.getSetting(propertyName);
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read airavata-server.properties...", e);
+            throw new ApplicationSettingsException("Unable to read airavata-server.properties...");
+        }
+    }
+
+}
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
index fb79c73882..da2869fe6c 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/QueryConstants.java
@@ -22,6 +22,7 @@
 import org.apache.airavata.model.user.UserProfile;
 import org.apache.airavata.registry.core.entities.appcatalog.*;
 import org.apache.airavata.registry.core.entities.replicacatalog.DataProductEntity;
+import org.apache.airavata.registry.core.entities.workflowcatalog.WorkflowEntity;
 
 public interface QueryConstants {
 
@@ -82,9 +83,9 @@
     String GET_FILE_SYSTEM = "SELECT DISTINCT FS FROM " + ComputeResourceFileSystemEntity.class.getSimpleName() + " FS " +
             "WHERE FS.computeResourceId LIKE :" + DBConstants.ComputeResource.COMPUTE_RESOURCE_ID;
     String GET_JOB_MANAGER_COMMAND = "SELECT DISTINCT JM FROM " + JobManagerCommandEntity.class.getSimpleName() + " JM " +
-            "WHERE JM.id.resourceJobManagerId LIKE :" + DBConstants.ResourceJobManager.RESOURCE_JOB_MANAGER_ID;
+            "WHERE JM.resourceJobManagerId LIKE :" + DBConstants.ResourceJobManager.RESOURCE_JOB_MANAGER_ID;
     String GET_PARALLELISM_PREFIX = "SELECT DISTINCT PF FROM " + ParallelismCommandEntity.class.getSimpleName() + " PF " +
-            "WHERE PF.id.resourceJobManagerId LIKE :" + DBConstants.ResourceJobManager.RESOURCE_JOB_MANAGER_ID;
+            "WHERE PF.resourceJobManagerId LIKE :" + DBConstants.ResourceJobManager.RESOURCE_JOB_MANAGER_ID;
 
     String FIND_ALL_GROUP_RESOURCE_PROFILES = "SELECT G FROM " + GroupResourceProfileEntity.class.getSimpleName() + " G " +
             "WHERE G.gatewayId LIKE :" + DBConstants.GroupResourceProfile.GATEWAY_ID;
@@ -113,4 +114,9 @@
             "WHERE DP.gatewayId LIKE :" + DBConstants.DataProduct.GATEWAY_ID + " AND DP.ownerName LIKE :" +
             DBConstants.DataProduct.OWNER_NAME + " AND dp.productName LIKE :" + DBConstants.DataProduct.PRODUCT_NAME;
 
+    String GET_ALL_WORKFLOWS = "SELECT W FROM " + WorkflowEntity.class.getSimpleName() + " W " +
+            "WHERE W.gatewayId LIKE :" + DBConstants.Workflow.GATEWAY_ID;
+    String GET_WORKFLOW_GIVEN_NAME = "SELECT W FROM " + WorkflowEntity.class.getSimpleName() + " W " +
+            "WHERE W.workflowName LIKE :" + DBConstants.Workflow.WORKFLOW_NAME;
+
 }
diff --git a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/PortRepository.java b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/WorkflowCatalogUtils.java
similarity index 52%
rename from modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/PortRepository.java
rename to modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/WorkflowCatalogUtils.java
index d4e7bfbb3f..ecf337dbc6 100644
--- a/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/workflowcatalog/PortRepository.java
+++ b/modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/utils/WorkflowCatalogUtils.java
@@ -1,4 +1,4 @@
-/*
+/**
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements.  See the NOTICE file
@@ -16,22 +16,14 @@
  * KIND, either express or implied.  See the License for the
  * specific language governing permissions and limitations
  * under the License.
- *
-*/
-package org.apache.airavata.registry.core.repositories.workflowcatalog;
-
-import org.apache.airavata.model.PortModel;
-import org.apache.airavata.registry.core.entities.workflowcatalog.PortEntity;
-import org.apache.airavata.registry.core.entities.workflowcatalog.PortPK;
-import org.apache.airavata.registry.core.repositories.AbstractRepository;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class PortRepository extends AbstractRepository<PortModel, PortEntity, PortPK> {
+ */
+package org.apache.airavata.registry.core.utils;
 
-    private final static Logger logger = LoggerFactory.getLogger(PortRepository.class);
+import java.util.UUID;
 
-    public PortRepository(Class<PortModel> thriftGenericClass, Class<PortEntity> dbEntityGenericClass) {
-        super(thriftGenericClass, dbEntityGenericClass);
+public class WorkflowCatalogUtils {
+    public static String getID (String name){
+        String pro = name.replaceAll("\\s", "");
+        return pro + "_" + UUID.randomUUID();
     }
 }
diff --git a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
index 78567057c1..698f48b7b8 100644
--- a/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
+++ b/modules/registry-refactoring/src/main/resources/META-INF/persistence.xml
@@ -62,19 +62,11 @@
         <class>org.apache.airavata.registry.core.entities.appcatalog.LocalDataMovementEntity</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.StoragePreferenceEntity</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.SSHAccountProvisionerConfiguration</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.GlobusGkEndpointPK</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.GsisshPostjobcommandPK</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.GsisshPrejobcommandPK</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.GsisshExportPK</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.BatchQueueResourcePolicyEntity</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.ComputeResourcePolicyEntity</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.GroupComputeResourcePrefEntity</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.GroupSSHAccountProvisionerConfig</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.GroupResourceProfileEntity</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.GridftpEndpointPK</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.StorageInterfacePK</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.JobManagerCommandPK</class>
-        <class>org.apache.airavata.registry.core.entities.appcatalog.ParallelismCommandPK</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.ModuleLoadCmdEntity</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.UserResourceProfileEntity</class>
         <class>org.apache.airavata.registry.core.entities.appcatalog.UserComputeResourcePreferenceEntity</class>
diff --git a/modules/registry-refactoring/src/main/resources/workflowcatalog-derby.sql b/modules/registry-refactoring/src/main/resources/workflowcatalog-derby.sql
new file mode 100644
index 0000000000..51a6ddfcc9
--- /dev/null
+++ b/modules/registry-refactoring/src/main/resources/workflowcatalog-derby.sql
@@ -0,0 +1,128 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+CREATE TABLE WORKFLOW
+(
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        WORKFLOW_NAME VARCHAR (255) NOT NULL,
+        CREATED_USER VARCHAR (255),
+        GATEWAY_ID VARCHAR (255),
+        GRAPH CLOB,
+        IMAGE BLOB,
+        CREATION_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+        UPDATE_TIME timestamp DEFAULT '0000-00-00 00:00:00',
+        PRIMARY KEY (TEMPLATE_ID)
+);
+
+CREATE TABLE WORKFLOW_INPUT
+(
+         TEMPLATE_ID VARCHAR(255),
+         INPUT_KEY VARCHAR(255),
+         INPUT_VALUE CLOB,
+         DATA_TYPE VARCHAR(255),
+         METADATA VARCHAR(255),
+         APP_ARGUMENT VARCHAR(255),
+         STANDARD_INPUT SMALLINT,
+         USER_FRIENDLY_DESC VARCHAR(255),
+         INPUT_ORDER INTEGER,
+         IS_REQUIRED SMALLINT,
+         REQUIRED_TO_COMMANDLINE SMALLINT,
+         DATA_STAGED SMALLINT,
+         PRIMARY KEY(TEMPLATE_ID,INPUT_KEY),
+         FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE WORKFLOW_OUTPUT
+(
+         TEMPLATE_ID VARCHAR(255),
+         OUTPUT_KEY VARCHAR(255),
+         OUTPUT_VALUE VARCHAR(255),
+         DATA_TYPE VARCHAR(255),
+         IS_REQUIRED SMALLINT,
+         REQUIRED_TO_COMMANDLINE SMALLINT,
+         DATA_MOVEMENT SMALLINT,
+         DATA_NAME_LOCATION VARCHAR(255),
+         SEARCH_QUERY VARCHAR(255),
+         APP_ARGUMENT VARCHAR(255),
+         OUTPUT_STREAMING SMALLINT,
+         PRIMARY KEY(TEMPLATE_ID,OUTPUT_KEY),
+         FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE COMPONENT_STATUS
+(
+        STATUS_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        STATE VARCHAR(255),
+        REASON VARCHAR(255),
+        UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (STATUS_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE WORKFLOW_STATUS
+(
+        STATUS_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        STATE VARCHAR(255),
+        REASON VARCHAR(255),
+        UPDATE_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (STATUS_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EDGE
+(
+        EDGE_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        NAME VARCHAR (255),
+        COMPONENT_STATUS_ID VARCHAR(255),
+        DESCRIPTION VARCHAR(500),
+        CREATED_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (EDGE_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE PORT
+(
+        PORT_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        NAME VARCHAR (255),
+        COMPONENT_STATUS_ID VARCHAR(255),
+        DESCRIPTION VARCHAR(500),
+        CREATED_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (PORT_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE
+(
+        NODE_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        NAME VARCHAR (255),
+        APPLICATION_ID VARCHAR (255),
+        APPLICATION_NAME VARCHAR (255),
+        COMPONENT_STATUS_ID VARCHAR(255),
+        DESCRIPTION VARCHAR(500),
+        CREATED_TIME timestamp DEFAULT CURRENT_TIMESTAMP,
+        PRIMARY KEY (NODE_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/main/resources/workflowcatalog-mysql.sql b/modules/registry-refactoring/src/main/resources/workflowcatalog-mysql.sql
new file mode 100644
index 0000000000..5a8ef976d2
--- /dev/null
+++ b/modules/registry-refactoring/src/main/resources/workflowcatalog-mysql.sql
@@ -0,0 +1,128 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+CREATE TABLE WORKFLOW
+(
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        WORKFLOW_NAME VARCHAR (255) NOT NULL,
+        CREATED_USER VARCHAR (255),
+        GATEWAY_ID VARCHAR (255),
+        GRAPH LONGTEXT,
+        IMAGE BLOB,
+        CREATION_TIME timestamp DEFAULT NOW(),
+        UPDATE_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+        PRIMARY KEY (TEMPLATE_ID)
+);
+
+CREATE TABLE WORKFLOW_INPUT
+(
+         TEMPLATE_ID VARCHAR(255),
+         INPUT_KEY VARCHAR(255),
+         INPUT_VALUE VARCHAR(255),
+         DATA_TYPE VARCHAR(255),
+         METADATA VARCHAR(255),
+         APP_ARGUMENT VARCHAR(255),
+         STANDARD_INPUT SMALLINT,
+         USER_FRIENDLY_DESC VARCHAR(255),
+         INPUT_ORDER INTEGER,
+         IS_REQUIRED SMALLINT,
+         REQUIRED_TO_COMMANDLINE SMALLINT,
+         DATA_STAGED SMALLINT,
+         PRIMARY KEY(TEMPLATE_ID,INPUT_KEY),
+         FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE WORKFLOW_OUTPUT
+(
+         TEMPLATE_ID VARCHAR(255),
+         OUTPUT_KEY VARCHAR(255),
+         OUTPUT_VALUE LONGTEXT,
+         DATA_TYPE VARCHAR(255),
+         IS_REQUIRED SMALLINT,
+         REQUIRED_TO_COMMANDLINE SMALLINT,
+         DATA_MOVEMENT SMALLINT,
+         DATA_NAME_LOCATION VARCHAR(255),
+         SEARCH_QUERY VARCHAR(255),
+         APP_ARGUMENT VARCHAR(255),
+         OUTPUT_STREAMING SMALLINT,
+         PRIMARY KEY(TEMPLATE_ID,OUTPUT_KEY),
+         FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE COMPONENT_STATUS
+(
+        STATUS_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        STATE VARCHAR(255),
+        REASON VARCHAR(255),
+        UPDATE_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+        PRIMARY KEY (STATUS_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE WORKFLOW_STATUS
+(
+        STATUS_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        STATE VARCHAR(255),
+        REASON VARCHAR(255),
+        UPDATE_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+        PRIMARY KEY (STATUS_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE EDGE
+(
+        EDGE_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        NAME VARCHAR (255),
+        COMPONENT_STATUS_ID VARCHAR(255),
+        DESCRIPTION VARCHAR(500),
+        CREATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+        PRIMARY KEY (EDGE_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE PORT
+(
+        PORT_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        NAME VARCHAR (255),
+        COMPONENT_STATUS_ID VARCHAR(255),
+        DESCRIPTION VARCHAR(500),
+        CREATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+        PRIMARY KEY (PORT_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
+
+CREATE TABLE NODE
+(
+        NODE_ID VARCHAR (255) NOT NULL,
+        TEMPLATE_ID VARCHAR (255) NOT NULL,
+        NAME VARCHAR (255),
+        APPLICATION_ID VARCHAR (255),
+        APPLICATION_NAME VARCHAR (255),
+        COMPONENT_STATUS_ID VARCHAR(255),
+        DESCRIPTION VARCHAR(500),
+        CREATED_TIME TIMESTAMP DEFAULT NOW() ON UPDATE NOW(),
+        PRIMARY KEY (NODE_ID, TEMPLATE_ID),
+        FOREIGN KEY (TEMPLATE_ID) REFERENCES WORKFLOW(TEMPLATE_ID) ON DELETE CASCADE
+);
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/WorkflowRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/WorkflowRepositoryTest.java
deleted file mode 100644
index 27730b8882..0000000000
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/WorkflowRepositoryTest.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- *
-*/
-package org.apache.airavata.registry.core.repositories;
-
-import org.apache.airavata.model.WorkflowModel;
-import org.apache.airavata.model.user.UserProfile;
-import org.apache.airavata.model.workspace.Gateway;
-import org.apache.airavata.model.workspace.GatewayApprovalStatus;
-import org.apache.airavata.registry.core.entities.workflowcatalog.WorkflowEntity;
-import org.apache.airavata.registry.core.entities.workspacecatalog.GatewayEntity;
-import org.apache.airavata.registry.core.entities.workspacecatalog.UserProfileEntity;
-import org.apache.airavata.registry.core.repositories.workflowcatalog.WorkflowRepository;
-import org.apache.airavata.registry.core.repositories.workspacecatalog.GatewayRepository;
-import org.apache.airavata.registry.core.repositories.workspacecatalog.UserProfileRepository;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-public class WorkflowRepositoryTest {
-    private final static Logger logger = LoggerFactory.getLogger(WorkflowRepositoryTest.class);
-
-    private GatewayRepository gatewayRepository;
-    private UserProfileRepository userProfileRepository;
-    private WorkflowRepository workflowRepository;
-    private String gatewayId;
-    private String userId;
-    private String templateId;
-
-    private final String GATEWAY_DOMAIN = "test1.com";
-    private final String WORKFLOW_NAME = "test Workflow";
-
-    @Before
-    public void setupRepository() {
-        gatewayRepository = new GatewayRepository(Gateway.class, GatewayEntity.class);
-        userProfileRepository = new UserProfileRepository(UserProfile.class, UserProfileEntity.class);
-        gatewayId = "test.com" + System.currentTimeMillis();
-        userId = "testuser" + System.currentTimeMillis();
-        workflowRepository = new WorkflowRepository(WorkflowModel.class, WorkflowEntity.class);
-        templateId = "templateId" + System.currentTimeMillis();
-    }
-
-
-    @Test
-    public void workflowRepositoryTest() {
-
-		/*
-         * Creating Gateway required for UserProfile & Workflow creation
-		 */
-//        Gateway gateway = new Gateway();
-//        gateway.setGatewayApprovalStatus(GatewayApprovalStatus.ACTIVE);
-//        gateway.setGatewayId(gatewayId);
-//        gateway.setDomain(GATEWAY_DOMAIN);
-//        gateway = gatewayRepository.create(gateway);
-//        Assert.assertTrue(!gateway.getGatewayId().isEmpty());
-
-		/*
-         * UserProfile Instance creation required for Workflow Creation
-		 */
-//        UserProfile userProfile = new UserProfile();
-//        userProfile.setAiravataInternalUserId(userId);
-//        userProfile.setGatewayId(gateway.getGatewayId());
-//        userProfile = userProfileRepository.create(userProfile);
-//        Assert.assertTrue(!userProfile.getAiravataInternalUserId().isEmpty());
-
-        /*
-         * Workflow Instance Creation
-         */
-
-//        WorkflowModel workflowModel = new WorkflowModel();
-//        workflowModel.setTemplateId(templateId);
-//        workflowModel.setCreatedUser(userId);
-//        workflowModel.setGatewayId(gatewayId);
-//        workflowModel.setName(WORKFLOW_NAME);
-
-
-        /*
-         * Workflow Repository Insert Operation Test
-		 */
-//        workflowModel = workflowRepository.create(workflowModel);
-//        Assert.assertTrue(!workflowModel.getTemplateId().isEmpty());
-
-
-        /*
-         * Workflow Repository Update Operation Test
-		 */
-//        workflowModel.setGraph("test");
-//        workflowRepository.update(workflowModel);
-//        workflowModel = workflowRepository.get(templateId);
-//        Assert.assertEquals(workflowModel.getGraph(), "test");
-
-		/*
-         * Workflow Repository Select Operation Test
-		 */
-//        workflowModel = workflowRepository.get(templateId);
-//        Assert.assertNotNull(workflowModel);
-
-		/*
-         * Workflow Repository Delete Operation
-		 */
-
-//        boolean deleteResult = workflowRepository.delete(templateId);
-//        Assert.assertTrue(deleteResult);
-//
-//        deleteResult = userProfileRepository.delete(userId);
-//        Assert.assertTrue(deleteResult);
-//
-//        deleteResult = gatewayRepository.delete(gatewayId);
-//        Assert.assertTrue(deleteResult);
-
-
-    }
-}
\ No newline at end of file
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java
index cd98189d12..878b7e6d69 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationDeploymentRepositoryTest.java
@@ -25,7 +25,7 @@
 import org.apache.airavata.model.appcatalog.appdeployment.SetEnvPaths;
 import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
 import org.apache.airavata.model.parallelism.ApplicationParallelismType;
-import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.core.repositories.appcatalog.util.Initialize;
 import org.apache.airavata.registry.core.utils.DBConstants;
 import org.apache.airavata.registry.cpi.AppCatalogException;
 import org.junit.After;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepositoryTest.java
index fc62b51fab..72bef72aaf 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ApplicationInterfaceRepositoryTest.java
@@ -26,10 +26,9 @@
 import org.apache.airavata.model.application.io.InputDataObjectType;
 import org.apache.airavata.model.application.io.OutputDataObjectType;
 import org.apache.airavata.model.parallelism.ApplicationParallelismType;
-import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.core.repositories.appcatalog.util.Initialize;
 import org.apache.airavata.registry.core.utils.DBConstants;
 import org.apache.airavata.registry.cpi.AppCatalogException;
-import org.apache.airavata.registry.cpi.ApplicationDeployment;
 import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java
index c75cf97f17..7800c46353 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepositoryTest.java
@@ -21,7 +21,7 @@
 
 import org.apache.airavata.model.appcatalog.computeresource.*;
 import org.apache.airavata.model.data.movement.*;
-import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.core.repositories.appcatalog.util.Initialize;
 import org.apache.airavata.registry.core.utils.DBConstants;
 import org.apache.airavata.registry.cpi.AppCatalogException;
 import org.junit.After;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java
index 4b42204223..6547c85d78 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GatewayProfileRepositoryTest.java
@@ -24,7 +24,7 @@
 import org.apache.airavata.model.appcatalog.gatewayprofile.ComputeResourcePreference;
 import org.apache.airavata.model.appcatalog.gatewayprofile.GatewayResourceProfile;
 import org.apache.airavata.model.data.movement.DataMovementProtocol;
-import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.core.repositories.appcatalog.util.Initialize;
 import org.apache.airavata.registry.cpi.AppCatalogException;
 import org.junit.After;
 import org.junit.Before;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
index 867ca1ae02..6b15432cac 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/GroupResourceProfileRepositoryTest.java
@@ -22,7 +22,7 @@
 import org.apache.airavata.model.appcatalog.computeresource.BatchQueue;
 import org.apache.airavata.model.appcatalog.computeresource.ComputeResourceDescription;
 import org.apache.airavata.model.appcatalog.groupresourceprofile.*;
-import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.core.repositories.appcatalog.util.Initialize;
 import org.apache.airavata.registry.cpi.AppCatalogException;
 import org.junit.After;
 import org.junit.Before;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepositoryTest.java
index 47fbfea57f..d97c80eba4 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepositoryTest.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/UserResourceProfileRepositoryTest.java
@@ -3,7 +3,7 @@
 import org.apache.airavata.model.appcatalog.userresourceprofile.UserComputeResourcePreference;
 import org.apache.airavata.model.appcatalog.userresourceprofile.UserResourceProfile;
 import org.apache.airavata.model.appcatalog.userresourceprofile.UserStoragePreference;
-import org.apache.airavata.registry.core.repositories.util.Initialize;
+import org.apache.airavata.registry.core.repositories.appcatalog.util.Initialize;
 import org.apache.airavata.registry.cpi.AppCatalogException;
 import org.junit.After;
 import org.junit.Before;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/util/Initialize.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/util/Initialize.java
similarity index 99%
rename from modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/util/Initialize.java
rename to modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/util/Initialize.java
index 8581cb7ef4..88d2815908 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/util/Initialize.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/appcatalog/util/Initialize.java
@@ -17,7 +17,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.airavata.registry.core.repositories.util;
+package org.apache.airavata.registry.core.repositories.appcatalog.util;
 
 import org.apache.airavata.common.exception.ApplicationSettingsException;
 import org.apache.airavata.common.utils.ServerSettings;
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/replicacatalog/util/Initialize.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/replicacatalog/util/Initialize.java
index 940d2e6e58..667d56e860 100644
--- a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/replicacatalog/util/Initialize.java
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/replicacatalog/util/Initialize.java
@@ -111,9 +111,9 @@ public void initializeDB() {
             conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
             if (!isDatabaseStructureCreated(DBConstants.CONFIGURATION, conn)) {
                 executeSQLScript(conn);
-                logger.info("New Database created for Data Catalog !!!");
+                logger.info("New Database created for Replica Catalog !!!");
             } else {
-                logger.debug("Database already created for Data Catalog!");
+                logger.debug("Database already created for Replica Catalog!");
             }
         } catch (Exception e) {
             logger.error(e.getMessage(), e);
@@ -200,8 +200,8 @@ private void executeSQLScript(Connection conn) throws Exception {
             executeSQL(sql.toString(), conn);
         }
         }catch (IOException e){
-            logger.error("Error occurred while executing SQL script for creating Airavata Data Catalog database", e);
-            throw new Exception("Error occurred while executing SQL script for creating Airavata Data Catalog database", e);
+            logger.error("Error occurred while executing SQL script for creating Airavata Replica Catalog database", e);
+            throw new Exception("Error occurred while executing SQL script for creating Airavata Replica Catalog database", e);
         }finally {
             if (reader != null) {
                 reader.close();
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowRepositoryTest.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowRepositoryTest.java
new file mode 100644
index 0000000000..38316a4516
--- /dev/null
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/workflowcatalog/WorkflowRepositoryTest.java
@@ -0,0 +1,111 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.airavata.registry.core.repositories.workflowcatalog;
+
+import org.apache.airavata.model.WorkflowModel;
+import org.apache.airavata.model.application.io.OutputDataObjectType;
+import org.apache.airavata.registry.core.repositories.workflowcatalog.util.Initialize;
+import org.apache.airavata.registry.cpi.WorkflowCatalogException;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.assertFalse;
+
+public class WorkflowRepositoryTest {
+
+    private static Initialize initialize;
+    private WorkflowRepository workflowRepository;
+    private String gatewayId = "testGateway";
+    private static final Logger logger = LoggerFactory.getLogger(WorkflowRepositoryTest.class);
+
+    @Before
+    public void setUp() {
+        try {
+            initialize = new Initialize("workflowcatalog-derby.sql");
+            initialize.initializeDB();
+            workflowRepository = new WorkflowRepository();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        System.out.println("********** TEAR DOWN ************");
+        initialize.stopDerbyServer();
+    }
+
+    @Test
+    public void WorkflowRepositoryTest() throws WorkflowCatalogException {
+
+        try {
+            WorkflowModel workflowModel1 = new WorkflowModel();
+            workflowModel1.setName("workflow1");
+            String templateId1 = workflowRepository.registerWorkflow(workflowModel1, gatewayId);
+            assertTrue(templateId1 != null);
+
+            workflowModel1.setCreatedUser("user1");
+            workflowRepository.updateWorkflow(templateId1, workflowModel1);
+
+            OutputDataObjectType outputDataObjectType1 = new OutputDataObjectType();
+            outputDataObjectType1.setName("outputKey1");
+            OutputDataObjectType outputDataObjectType2 = new OutputDataObjectType();
+            outputDataObjectType2.setName("outputKey2");
+            List<OutputDataObjectType> outputDataObjectTypeList = new ArrayList<>();
+            outputDataObjectTypeList.add(outputDataObjectType1);
+            outputDataObjectTypeList.add(outputDataObjectType2);
+            workflowRepository.updateWorkflowOutputs(templateId1, outputDataObjectTypeList);
+
+            WorkflowModel retrievedWorkflowModel = workflowRepository.getWorkflow(templateId1);
+            assertEquals(gatewayId, retrievedWorkflowModel.getGatewayId());
+            assertEquals(workflowModel1.getCreatedUser(), retrievedWorkflowModel.getCreatedUser());
+            assertTrue(retrievedWorkflowModel.getWorkflowOutputs().size() == 2);
+
+            WorkflowModel workflowModel2 = new WorkflowModel();
+            workflowModel2.setName("workflow2");
+            String templateId2 = workflowRepository.registerWorkflow(workflowModel2, gatewayId);
+            assertTrue(templateId2 != null);
+
+            List<String> workflows = workflowRepository.getAllWorkflows(gatewayId);
+            assertTrue(workflows.size() == 2);
+
+            String retrievedTemplateId = workflowRepository.getWorkflowTemplateId(workflowModel1.getName());
+            assertEquals(templateId1, retrievedTemplateId);
+
+            assertTrue(workflowRepository.isWorkflowExistWithName(workflowModel2.getName()));
+
+            workflowRepository.deleteWorkflow(templateId1);
+            assertFalse(workflowRepository.isWorkflowExistWithName(workflowModel1.getName()));
+
+            workflowRepository.deleteWorkflow(templateId2);
+        }
+
+        catch (Exception e) {
+            logger.error("The Workflow repository methods have not been implemented yet.");
+        }
+    }
+
+}
diff --git a/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/workflowcatalog/util/Initialize.java b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/workflowcatalog/util/Initialize.java
new file mode 100644
index 0000000000..4a91da1763
--- /dev/null
+++ b/modules/registry-refactoring/src/test/java/org/apache/airavata/registry/core/repositories/workflowcatalog/util/Initialize.java
@@ -0,0 +1,313 @@
+/**
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.airavata.registry.core.repositories.workflowcatalog.util;
+
+import org.apache.airavata.common.exception.ApplicationSettingsException;
+import org.apache.airavata.common.utils.ServerSettings;
+import org.apache.airavata.registry.core.utils.DBConstants;
+import org.apache.derby.drda.NetworkServerControl;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.net.InetAddress;
+import java.net.URI;
+import java.sql.*;
+import java.util.StringTokenizer;
+
+public class Initialize {
+    private static final Logger logger = LoggerFactory.getLogger(Initialize.class);
+    public static final String DERBY_SERVER_MODE_SYS_PROPERTY = "derby.drda.startNetworkServer";
+    public  String scriptName = "workflowcatalog-derby.sql";
+    private NetworkServerControl server;
+    private static final String delimiter = ";";
+    private String jdbcUrl = null;
+    private String jdbcDriver = null;
+    private String jdbcUser = null;
+    private String jdbcPassword = null;
+
+    public Initialize(String scriptName) {
+        this.scriptName = scriptName;
+    }
+
+    public static boolean checkStringBufferEndsWith(StringBuffer buffer, String suffix) {
+        if (suffix.length() > buffer.length()) {
+            return false;
+        }
+        // this loop is done on purpose to avoid memory allocation performance
+        // problems on various JDKs
+        // StringBuffer.lastIndexOf() was introduced in jdk 1.4 and
+        // implementation is ok though does allocation/copying
+        // StringBuffer.toString().endsWith() does massive memory
+        // allocation/copying on JDK 1.5
+        // See http://issues.apache.org/bugzilla/show_bug.cgi?id=37169
+        int endIndex = suffix.length() - 1;
+        int bufferIndex = buffer.length() - 1;
+        while (endIndex >= 0) {
+            if (buffer.charAt(bufferIndex) != suffix.charAt(endIndex)) {
+                return false;
+            }
+            bufferIndex--;
+            endIndex--;
+        }
+        return true;
+    }
+
+    private static boolean isServerStarted(NetworkServerControl server, int ntries)
+    {
+        for (int i = 1; i <= ntries; i ++)
+        {
+            try {
+                Thread.sleep(500);
+                server.ping();
+                return true;
+            }
+            catch (Exception e) {
+                if (i == ntries)
+                    return false;
+            }
+        }
+        return false;
+    }
+
+    public void initializeDB() {
+        try{
+            jdbcDriver = ServerSettings.getSetting("workflowcatalog.jdbc.driver");
+            jdbcUrl = ServerSettings.getSetting("workflowcatalog.jdbc.url");
+            jdbcUser = ServerSettings.getSetting("workflowcatalog.jdbc.user");
+            jdbcPassword = ServerSettings.getSetting("workflowcatalog.jdbc.password");
+            jdbcUrl = jdbcUrl + "?" + "user=" + jdbcUser + "&" + "password=" + jdbcPassword;
+        } catch (ApplicationSettingsException e) {
+            logger.error("Unable to read properties", e);
+        }
+
+        startDerbyInServerMode();
+        if(!isServerStarted(server, 20)){
+            throw new RuntimeException("Derby server could not started within five seconds...");
+        }
+        Connection conn = null;
+        try {
+            Class.forName(jdbcDriver).newInstance();
+            conn = DriverManager.getConnection(jdbcUrl, jdbcUser, jdbcPassword);
+            if (!isDatabaseStructureCreated(DBConstants.WORKFLOW, conn)) {
+                executeSQLScript(conn);
+                logger.info("New Database created for Workflow Catalog !!!");
+            } else {
+                logger.debug("Database already created for Workflow Catalog!");
+            }
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            throw new RuntimeException("Database failure", e);
+        } finally {
+            try {
+                if (conn != null){
+                    if (!conn.getAutoCommit()) {
+                        conn.commit();
+                    }
+                    conn.close();
+                }
+            } catch (SQLException e) {
+                logger.error(e.getMessage(), e);
+            }
+        }
+    }
+
+    public static boolean isDatabaseStructureCreated(String tableName, Connection conn) {
+        try {
+            System.out.println("Running a query to test the database tables existence.");
+            // check whether the tables are already created with a query
+            Statement statement = null;
+            try {
+                statement = conn.createStatement();
+                ResultSet rs = statement.executeQuery("select * from " + tableName);
+                if (rs != null) {
+                    rs.close();
+                }
+            } finally {
+                try {
+                    if (statement != null) {
+                        statement.close();
+                    }
+                } catch (SQLException e) {
+                    return false;
+                }
+            }
+        } catch (SQLException e) {
+            return false;
+        }
+
+        return true;
+    }
+
+    private void executeSQLScript(Connection conn) throws Exception {
+        StringBuffer sql = new StringBuffer();
+        BufferedReader reader = null;
+        try{
+
+            InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(scriptName);
+            reader = new BufferedReader(new InputStreamReader(inputStream));
+            String line;
+            while ((line = reader.readLine()) != null) {
+                line = line.trim();
+                if (line.startsWith("//")) {
+                    continue;
+                }
+                if (line.startsWith("--")) {
+                    continue;
+                }
+                StringTokenizer st = new StringTokenizer(line);
+                if (st.hasMoreTokens()) {
+                    String token = st.nextToken();
+                    if ("REM".equalsIgnoreCase(token)) {
+                        continue;
+                    }
+                }
+                sql.append(" ").append(line);
+
+                // SQL defines "--" as a comment to EOL
+                // and in Oracle it may contain a hint
+                // so we cannot just remove it, instead we must end it
+                if (line.indexOf("--") >= 0) {
+                    sql.append("\n");
+                }
+                if ((checkStringBufferEndsWith(sql, delimiter))) {
+                    executeSQL(sql.substring(0, sql.length() - delimiter.length()), conn);
+                    sql.replace(0, sql.length(), "");
+                }
+            }
+            // Catch any statements not followed by ;
+            if (sql.length() > 0) {
+                executeSQL(sql.toString(), conn);
+            }
+        }catch (IOException e){
+            logger.error("Error occurred while executing SQL script for creating Airavata Workflow Catalog database", e);
+            throw new Exception("Error occurred while executing SQL script for creating Airavata Workflow Catalog database", e);
+        }finally {
+            if (reader != null) {
+                reader.close();
+            }
+        }
+    }
+
+    private static void executeSQL(String sql, Connection conn) throws Exception {
+        // Check and ignore empty statements
+        if ("".equals(sql.trim())) {
+            return;
+        }
+
+        Statement statement = null;
+        try {
+            logger.debug("SQL : " + sql);
+
+            boolean ret;
+            int updateCount = 0, updateCountTotal = 0;
+            statement = conn.createStatement();
+            ret = statement.execute(sql);
+            updateCount = statement.getUpdateCount();
+            do {
+                if (!ret) {
+                    if (updateCount != -1) {
+                        updateCountTotal += updateCount;
+                    }
+                }
+                ret = statement.getMoreResults();
+                if (ret) {
+                    updateCount = statement.getUpdateCount();
+                }
+            } while (ret);
+
+            logger.debug(sql + " : " + updateCountTotal + " rows affected");
+
+            SQLWarning warning = conn.getWarnings();
+            while (warning != null) {
+                logger.warn(warning + " sql warning");
+                warning = warning.getNextWarning();
+            }
+            conn.clearWarnings();
+        } catch (SQLException e) {
+            if (e.getSQLState().equals("X0Y32")) {
+                // eliminating the table already exception for the derby
+                // database
+                logger.info("Table Already Exists", e);
+            } else {
+                throw new Exception("Error occurred while executing : " + sql, e);
+            }
+        } finally {
+            if (statement != null) {
+                try {
+                    statement.close();
+                } catch (SQLException e) {
+                    logger.error("Error occurred while closing result set.", e);
+                }
+            }
+        }
+    }
+
+    private void startDerbyInServerMode() {
+        try {
+            System.setProperty(DERBY_SERVER_MODE_SYS_PROPERTY, "true");
+            server = new NetworkServerControl(InetAddress.getByName("0.0.0.0"),
+                    20000,
+                    jdbcUser, jdbcPassword);
+            java.io.PrintWriter consoleWriter = new java.io.PrintWriter(System.out, true);
+            server.start(consoleWriter);
+        } catch (IOException e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        } catch (Exception e) {
+            logger.error("Unable to start Apache derby in the server mode! Check whether " +
+                    "specified port is available");
+        }
+
+    }
+
+    public static int getPort(String jdbcURL){
+        try{
+            String cleanURI = jdbcURL.substring(5);
+            URI uri = URI.create(cleanURI);
+            return uri.getPort();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+            return -1;
+        }
+    }
+
+    private void startDerbyInEmbeddedMode(){
+        try {
+            Class.forName("org.apache.derby.jdbc.EmbeddedDriver");
+            DriverManager.getConnection("jdbc:derby:memory:unit-testing-jpa;create=true").close();
+        } catch (ClassNotFoundException e) {
+            logger.error(e.getMessage(), e);
+        } catch (SQLException e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+
+    public void stopDerbyServer() {
+        try {
+            server.shutdown();
+        } catch (Exception e) {
+            logger.error(e.getMessage(), e);
+        }
+    }
+}
diff --git a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
index 8ccfa57ea0..42a2bc47e2 100644
--- a/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
+++ b/modules/registry/registry-server/registry-api-service/src/main/java/org/apache/airavata/registry/api/service/handler/RegistryServerHandler.java
@@ -74,6 +74,7 @@
 import org.apache.airavata.registry.core.repositories.replicacatalog.DataProductRepository;
 import org.apache.airavata.registry.core.repositories.replicacatalog.DataReplicaLocationRepository;
 import org.apache.airavata.registry.core.repositories.appcatalog.UserResourceProfileRepository;
+import org.apache.airavata.registry.core.repositories.workflowcatalog.WorkflowRepository;
 import org.apache.airavata.registry.cpi.*;
 import org.apache.airavata.registry.cpi.utils.Constants;
 import org.apache.thrift.TException;
@@ -87,12 +88,12 @@
 
     private ExperimentCatalog experimentCatalog;
     private AppCatalog appCatalog;
-    private WorkflowCatalog workflowCatalog;
     private ApplicationDeploymentRepository applicationDeploymentRepository = new ApplicationDeploymentRepository();
     private ApplicationInterfaceRepository applicationInterfaceRepository = new ApplicationInterfaceRepository();
     private UserResourceProfileRepository userResourceProfileRepository = new UserResourceProfileRepository();
     private DataProductRepository dataProductRepository = new DataProductRepository();
     private DataReplicaLocationRepository dataReplicaLocationRepository = new DataReplicaLocationRepository();
+    private WorkflowRepository workflowRepository = new WorkflowRepository();
 
     /**
      * Fetch Apache Registry API version
@@ -2034,7 +2035,6 @@ public ComputeResourcePreference getGatewayComputeResourcePreference(String gate
                 logger.error("Gateway does not exist.Please provide a valid gateway id...");
                 throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
             }
-            appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfileRepository gwyResourceProfileRepository = new GwyResourceProfileRepository();
             ComputeResourceRepository computeResourceRepository = new ComputeResourceRepository();
             if (!gwyResourceProfileRepository.isGatewayResourceProfileExists(gatewayID)){
@@ -2075,7 +2075,6 @@ public StoragePreference getGatewayStoragePreference(String gatewayID, String st
                 logger.error("Gateway does not exist.Please provide a valid gateway id...");
                 throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
             }
-            appCatalog = RegistryFactory.getAppCatalog();
             GwyResourceProfileRepository gwyResourceProfileRepository = new GwyResourceProfileRepository();
             if (!gwyResourceProfileRepository.isGatewayResourceProfileExists(gatewayID)){
                 logger.error(gatewayID, "Given gateway profile does not exist in the system. Please provide a valid gateway id...");
@@ -2226,7 +2225,7 @@ public boolean deleteGatewayStoragePreference(String gatewayID, String storageId
             throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
         }
         try {
-            return getWorkflowCatalog().getAllWorkflows(gatewayId);
+            return workflowRepository.getAllWorkflows(gatewayId);
         } catch (WorkflowCatalogException e) {
             String msg = "Error in retrieving all workflow template Ids.";
             logger.error(msg, e);
@@ -2244,7 +2243,7 @@ public boolean deleteGatewayStoragePreference(String gatewayID, String storageId
     @Override
     public WorkflowModel getWorkflow(String workflowTemplateId) throws RegistryServiceException, TException {
         try {
-            return getWorkflowCatalog().getWorkflow(workflowTemplateId);
+            return workflowRepository.getWorkflow(workflowTemplateId);
         } catch (WorkflowCatalogException e) {
             String msg = "Error in retrieving the workflow "+workflowTemplateId+".";
             logger.error(msg, e);
@@ -2257,7 +2256,7 @@ public WorkflowModel getWorkflow(String workflowTemplateId) throws RegistryServi
     @Override
     public void deleteWorkflow(String workflowTemplateId) throws RegistryServiceException, TException {
         try {
-            getWorkflowCatalog().deleteWorkflow(workflowTemplateId);
+            workflowRepository.deleteWorkflow(workflowTemplateId);
         } catch (WorkflowCatalogException e) {
             String msg = "Error in deleting the workflow "+workflowTemplateId+".";
             logger.error(msg, e);
@@ -2270,7 +2269,7 @@ public void deleteWorkflow(String workflowTemplateId) throws RegistryServiceExce
     @Override
     public String getWorkflowTemplateId(String workflowName) throws RegistryServiceException, TException {
         try {
-            return getWorkflowCatalog().getWorkflowTemplateId(workflowName);
+            return workflowRepository.getWorkflowTemplateId(workflowName);
         } catch (WorkflowCatalogException e) {
             String msg = "Error in retrieving the workflow template id for "+workflowName+".";
             logger.error(msg, e);
@@ -2283,7 +2282,7 @@ public String getWorkflowTemplateId(String workflowName) throws RegistryServiceE
     @Override
     public boolean isWorkflowExistWithName(String workflowName) throws RegistryServiceException, TException {
         try {
-            return getWorkflowCatalog().isWorkflowExistWithName(workflowName);
+            return workflowRepository.isWorkflowExistWithName(workflowName);
         } catch (WorkflowCatalogException e) {
             String msg = "Error in veriying the workflow for workflow name "+workflowName+".";
             logger.error(msg, e);
@@ -2627,7 +2626,7 @@ public String registerDataProduct(DataProductModel dataProductModel) throws Regi
     @Override
     public void updateWorkflow(String workflowTemplateId, WorkflowModel workflow) throws RegistryServiceException, TException {
         try {
-            getWorkflowCatalog().updateWorkflow(workflowTemplateId, workflow);
+            workflowRepository.updateWorkflow(workflowTemplateId, workflow);
         } catch (WorkflowCatalogException e) {
             String msg = "Error in updating the workflow "+workflow.getName()+".";
             logger.error(msg, e);
@@ -2644,7 +2643,7 @@ public String registerWorkflow(String gatewayId, WorkflowModel workflow) throws
             throw new RegistryServiceException("Gateway does not exist.Please provide a valid gateway id...");
         }
         try {
-            return getWorkflowCatalog().registerWorkflow(workflow, gatewayId);
+            return workflowRepository.registerWorkflow(workflow, gatewayId);
         } catch (WorkflowCatalogException e) {
             String msg = "Error in registering the workflow "+workflow.getName()+".";
             logger.error(msg, e);
@@ -4293,17 +4292,6 @@ private String addDataMovementInterface(ComputeResource computeResource,
         return computeResource.addDataMovementProtocol(computeResourceId, dmType, dataMovementInterface);
     }
 
-    private WorkflowCatalog getWorkflowCatalog() {
-        if (workflowCatalog == null) {
-            try {
-                workflowCatalog = RegistryFactory.getAppCatalog().getWorkflowCatalog();
-            } catch (Exception e) {
-                logger.error("Unable to create Workflow Catalog", e);
-            }
-        }
-        return workflowCatalog;
-    }
-
     /**
      * Register a User Resource Profile.
      *


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Refactoring Workflow Catalog Implementation
> -------------------------------------------
>
>                 Key: AIRAVATA-2730
>                 URL: https://issues.apache.org/jira/browse/AIRAVATA-2730
>             Project: Airavata
>          Issue Type: Improvement
>          Components: Registry API
>            Reporter: Sneha Tilak
>            Assignee: Sneha Tilak
>            Priority: Major
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message