Skip to content

Commit 2a7cf59

Browse files
committed
Refactor SampleType: Move PID column to unique constraints and add getter/setter methods
1 parent 487e528 commit 2a7cf59

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/main/java/org/icatproject/core/entity/SampleType.java

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,20 @@
2626
@SuppressWarnings("serial")
2727
@Entity
2828
@Table(uniqueConstraints = { @UniqueConstraint(columnNames = { "FACILITY_ID", "NAME",
29-
"MOLECULARFORMULA" }) })
29+
"PID" }) })
3030
public class SampleType extends EntityBaseBean implements Serializable {
3131

3232
@Comment("The facility which has defined this sample type")
3333
@JoinColumn(name = "FACILITY_ID", nullable = false)
3434
@ManyToOne(fetch = FetchType.LAZY)
3535
private Facility facility;
3636

37+
@Comment("A persistent identifier attributed to this sample type, ideally referring to a vocabulary term")
38+
@Column(name = "PID", nullable = false)
39+
private String pid;
40+
3741
@Comment("The formula written as a string -e.g. C2H6O2 for ethylene glycol")
38-
@Column(nullable = false, name = "MOLECULARFORMULA")
42+
@Column(name = "MOLECULARFORMULA")
3943
private String molecularFormula;
4044

4145
@Column(nullable = false, name = "NAME")
@@ -58,6 +62,10 @@ public Facility getFacility() {
5862
return facility;
5963
}
6064

65+
public String getPid() {
66+
return pid;
67+
}
68+
6169
public String getMolecularFormula() {
6270
return molecularFormula;
6371
}
@@ -78,6 +86,10 @@ public void setFacility(Facility facility) {
7886
this.facility = facility;
7987
}
8088

89+
public void setPid(String pid) {
90+
this.pid = pid;
91+
}
92+
8193
public void setMolecularFormula(String molecularFormula) {
8294
this.molecularFormula = molecularFormula;
8395
}

0 commit comments

Comments
 (0)