rsanchez
2014-10-15 973ee9056995d1c9e7a533d9999329a70f0d2b2d
securis/src/main/java/net/curisit/securis/db/LicenseTypeMetadata.java
....@@ -32,25 +32,15 @@
3232 private static final long serialVersionUID = 1L;
3333
3434 @Id
35
- @GeneratedValue
36
- private int id;
37
-
38
- private String key;
39
-
40
- private String value;
41
-
4235 @JsonIgnore
4336 @ManyToOne
4437 @JoinColumn(name = "license_type_id")
4538 private LicenseType licenseType;
4639
47
- public int getId() {
48
- return id;
49
- }
40
+ @Id
41
+ private String key;
5042
51
- public void setId(int id) {
52
- this.id = id;
53
- }
43
+ private String value;
5444
5545 @JsonProperty("licensetype_id")
5646 public Integer getLicenseTypeId() {
....@@ -91,4 +81,17 @@
9181 this.key = key;
9282 }
9383
84
+ @Override
85
+ public boolean equals(Object obj) {
86
+ if (!(obj instanceof LicenseTypeMetadata))
87
+ return false;
88
+ LicenseTypeMetadata other = (LicenseTypeMetadata)obj;
89
+ return key.equals(other.key) && (licenseType == null || licenseType.equals(other.licenseType));
90
+ }
91
+
92
+ @Override
93
+ public int hashCode() {
94
+
95
+ return key.hashCode() + (licenseType == null ? 0 : licenseType.hashCode());
96
+ }
9497 }