rsanchez
2014-10-14 fb1b6755a9ecd43601dc4fbef9166d11d8a86f24
securis/src/main/java/net/curisit/securis/db/Application.java
....@@ -16,7 +16,9 @@
1616
1717 import org.codehaus.jackson.annotate.JsonAutoDetect;
1818 import org.codehaus.jackson.annotate.JsonIgnore;
19
+import org.codehaus.jackson.annotate.JsonProperty;
1920 import org.codehaus.jackson.map.annotate.JsonSerialize;
21
+
2022
2123 /**
2224 * Entity implementation class for Entity: application
....@@ -35,7 +37,7 @@
3537
3638 @Id
3739 @GeneratedValue
38
- private int id;
40
+ private Integer id;
3941
4042 private String name;
4143 private String description;
....@@ -49,9 +51,6 @@
4951 @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
5052 private Set<LicenseType> licenseTypes;
5153
52
- @JsonIgnore
53
- // We don't include the referenced entities to limit the size of each row at
54
- // the listing
5554 @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
5655 private Set<ApplicationMetadata> metadata;
5756
....@@ -95,12 +94,27 @@
9594 this.licenseTypes = licenseTypes;
9695 }
9796
97
+ @JsonProperty("metadata")
9898 public Set<ApplicationMetadata> getApplicationMetadata() {
9999 return metadata;
100100 }
101101
102
+ @JsonProperty("metadata")
102103 public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {
103104 this.metadata = metadata;
104105 }
105106
107
+ @Override
108
+ public boolean equals(Object obj) {
109
+ if (!(obj instanceof Application))
110
+ return false;
111
+ Application other = (Application)obj;
112
+ return id.equals(other.id);
113
+ }
114
+
115
+ @Override
116
+ public int hashCode() {
117
+
118
+ return (id == null ? 0 : id.hashCode());
119
+ }
106120 }