Making necessary changed to appcatalog entities and repositories
MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GlobusGkEndpointEntity.java
*/
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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GridftpEndpointEntity.java
@@ -24,17 +24,22 @@ import javax.persistence.*;
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 class GridftpEndpointEntity implements Serializable {
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshExportEntity.java
*/
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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPostjobcommandEntity.java
*/
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 @@ import java.io.Serializable;
*/
@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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/GsisshPrejobcommandEntity.java
*/
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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/JobManagerCommandEntity.java
@@ -28,11 +28,17 @@ import java.io.Serializable;
*/
@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 class JobManagerCommandEntity implements Serializable {
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/ParallelismCommandEntity.java
@@ -28,11 +28,17 @@ import java.io.Serializable;
*/
@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 class ParallelismCommandEntity implements Serializable {
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/appcatalog/StorageInterfaceEntity.java
*/
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 @@ import java.sql.Timestamp;
*/
@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 class StorageInterfaceEntity implements Serializable {
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ComputeResourceRepository.java
@@ -363,12 +363,10 @@ public class ComputeResourceRepository extends AppCatAbstractRepository<ComputeR
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));
}
}

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ResourceJobManagerRepository.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/repositories/appcatalog/ResourceJobManagerRepository.java
@@ -40,13 +40,11 @@ public class ResourceJobManagerRepository extends AppCatAbstractRepository<Resou
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 class ResourceJobManagerRepository extends AppCatAbstractRepository<Resou
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 class ResourceJobManagerRepository extends AppCatAbstractRepository<Resou
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 class ResourceJobManagerRepository extends AppCatAbstractRepository<Resou
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;
}

Making necessary changed to appcatalog entities and repositories