Updating the entity and primary key classes for workflow catalog
MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/ComponentStatusEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/ComponentStatusEntity.java
@@ -32,7 +32,7 @@ import java.sql.Timestamp;
* 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 @@ public class ComponentStatusEntity implements Serializable {
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 class ComponentStatusEntity implements Serializable {
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgeEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgeEntity.java
*/
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 @@ public class EdgeEntity implements Serializable {
@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 class EdgeEntity implements Serializable {
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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgePK.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/EdgePK.java
*/
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodeEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodeEntity.java
*/
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 @@ public class NodeEntity implements Serializable {
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 @@ public class NodeEntity implements Serializable {
@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 class NodeEntity implements Serializable {
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodePK.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/NodePK.java
*/
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() {

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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortPK.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/PortPK.java
*/
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowEntity.java
*/
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 @@ public class WorkflowEntity implements Serializable {
@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 @@ public class WorkflowEntity implements Serializable {
private String graph;
@Column(name = "IMAGE")
- private byte[] image;
+ private ByteBuffer image;
@Column(name = "UPDATE_TIME")
private Timestamp updateTime;
@@ -59,6 +62,13 @@ public class WorkflowEntity implements Serializable {
@Column(name = "WORKFLOW_NAME")
private String name;
+ @OneToMany(targetEntity = WorkflowInputEntity.class, cascade = CascadeType.ALL,
+ mappedBy = "workflow", fetch = FetchType.EAGER)
+ private List<InputDataObjectType> workflowInputs;
+
+ @OneToMany(targetEntity = WorkflowOutputEntity.class, cascade = CascadeType.ALL,
+ mappedBy = "workflow", fetch = FetchType.EAGER)
+ private List<OutputDataObjectType> workflowOutputs;
public WorkflowEntity() {
}
@@ -113,12 +123,12 @@ public class WorkflowEntity implements Serializable {
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 class WorkflowEntity implements Serializable {
public void setName(String name) {
this.name = name;
}
+
+ public List<InputDataObjectType> getWorkflowInputs() {
+ return workflowInputs;
+ }
+
+ public void setWorkflowInputs(List<InputDataObjectType> workflowInputs) {
+ this.workflowInputs = workflowInputs;
+ }
+
+ public List<OutputDataObjectType> getWorkflowOutputs() {
+ return workflowOutputs;
+ }
+
+ public void setWorkflowOutputs(List<OutputDataObjectType> workflowOutputs) {
+ this.workflowOutputs = workflowOutputs;
+ }
}
\ No newline at end of file

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputEntity.java
*/
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 @@ public class WorkflowInputEntity implements Serializable {
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 class WorkflowInputEntity implements Serializable {
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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputPK.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowInputPK.java
*/
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 class WorkflowInputPK implements Serializable {
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 class WorkflowInputPK implements Serializable {
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;
}

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputEntity.java
@@ -23,30 +23,35 @@ package org.apache.airavata.registry.core.entities.workflowcatalog;
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(WorkflowOutputEntity.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 @@ public class WorkflowOutputEntity implements Serializable {
@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 class WorkflowOutputEntity implements Serializable {
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 class WorkflowOutputEntity implements Serializable {
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 class WorkflowOutputEntity implements Serializable {
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

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputPK.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowOutputPK.java
*/
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 class WorkflowOutputPK implements Serializable {
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 class WorkflowOutputPK implements Serializable {
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;
}

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusEntity.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusEntity.java
*/
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 @@ public class WorkflowStatusEntity implements Serializable {
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 class WorkflowStatusEntity implements Serializable {
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() {

MODIFY
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusPK.java
modules/registry-refactoring/src/main/java/org/apache/airavata/registry/core/entities/workflowcatalog/WorkflowStatusPK.java
*/
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() {

Updating the entity and primary key classes for workflow catalog