Endpoint info saved in Edge now.

This commit is contained in:
Zhen Tang 2013-06-09 12:35:42 +08:00
parent 4ed7559d51
commit ae3d4b99e5
3 changed files with 44 additions and 0 deletions

View File

@ -15,7 +15,9 @@ public class Edge {
private UUID id;
private Flow flow;
private Node sourceNode;
private String sourceEndpoint;
private Node targetNode;
private String targetEndpoint;
@Id
@Column(name = "id", length = 16)
@ -47,6 +49,15 @@ public class Edge {
this.sourceNode = sourceNode;
}
@Column(name = "sourceEndpoint")
public String getSourceEndpoint() {
return sourceEndpoint;
}
public void setSourceEndpoint(String sourceEndpoint) {
this.sourceEndpoint = sourceEndpoint;
}
@ManyToOne
@JoinColumn(name = "targetNodeId")
public Node getTargetNode() {
@ -57,4 +68,13 @@ public class Edge {
this.targetNode = targetNode;
}
@Column(name = "targetEndpoint")
public String getTargetEndpoint() {
return targetEndpoint;
}
public void setTargetEndpoint(String targetEndpoint) {
this.targetEndpoint = targetEndpoint;
}
}

View File

@ -119,7 +119,9 @@ public class FlowHelper {
edgeModel.setFlowId(edge.getFlow().getId());
edgeModel.setId(edge.getId());
edgeModel.setSourceNodeId(edge.getSourceNode().getId());
edgeModel.setSourceEndpoint(edge.getSourceEndpoint());
edgeModel.setTargetNodeId(edge.getTargetNode().getId());
edgeModel.setTargetEndpoint(edge.getTargetEndpoint());
flowModel.getEdges().add(edgeModel);
}
return flowModel;
@ -173,8 +175,10 @@ public class FlowHelper {
edge.setId(edgeModel.getId());
edge.setSourceNode(new Node());
edge.getSourceNode().setId(edgeModel.getSourceNodeId());
edge.setSourceEndpoint(edgeModel.getSourceEndpoint());
edge.setTargetNode(new Node());
edge.getTargetNode().setId(edgeModel.getTargetNodeId());
edge.setTargetEndpoint(edgeModel.getTargetEndpoint());
edges.add(edge);
}
boolean result = true;

View File

@ -10,7 +10,9 @@ public class EdgeModel {
private UUID id;
private UUID flowId;
private UUID sourceNodeId;
private String sourceEndpoint;
private UUID targetNodeId;
private String targetEndpoint;
@XmlElement
public UUID getId() {
@ -39,6 +41,15 @@ public class EdgeModel {
this.sourceNodeId = sourceNodeId;
}
@XmlElement
public String getSourceEndpoint() {
return sourceEndpoint;
}
public void setSourceEndpoint(String sourceEndpoint) {
this.sourceEndpoint = sourceEndpoint;
}
@XmlElement
public UUID getTargetNodeId() {
return targetNodeId;
@ -48,4 +59,13 @@ public class EdgeModel {
this.targetNodeId = targetNodeId;
}
@XmlElement
public String getTargetEndpoint() {
return targetEndpoint;
}
public void setTargetEndpoint(String targetEndpoint) {
this.targetEndpoint = targetEndpoint;
}
}