rsanchez
2014-12-12 4c13c7324a920f5cca9601154e5224e5d7484fa9
securis/src/main/java/net/curisit/securis/db/Application.java
....@@ -22,6 +22,7 @@
2222 import com.fasterxml.jackson.annotation.JsonIgnore;
2323 import com.fasterxml.jackson.annotation.JsonInclude;
2424 import com.fasterxml.jackson.annotation.JsonInclude.Include;
25
+import com.fasterxml.jackson.annotation.JsonManagedReference;
2526 import com.fasterxml.jackson.annotation.JsonProperty;
2627
2728 /**
....@@ -56,13 +57,14 @@
5657 @JsonProperty("creation_timestamp")
5758 private Date creationTimestamp;
5859
59
- @JsonIgnore
6060 // We don't include the referenced entities to limit the size of each row at
61
- // the listing
61
+ // // the listing
62
+ @JsonIgnore
6263 @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
6364 private Set<LicenseType> licenseTypes;
6465
6566 @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "application")
67
+ @JsonManagedReference
6668 private Set<ApplicationMetadata> metadata;
6769
6870 public Integer getId() {
....@@ -90,7 +92,6 @@
9092 }
9193
9294 public Date getCreationTimestamp() {
93
- LOG.info("APP {} TS: {}", this.id, this.creationTimestamp);
9495 return creationTimestamp;
9596 }
9697
....@@ -98,16 +99,9 @@
9899 this.creationTimestamp = creationTimestamp;
99100 }
100101
101
- public Set<LicenseType> getLicenseTypes() {
102
- return licenseTypes;
103
- }
104
-
105
- public void setLicenseTypes(Set<LicenseType> licenseTypes) {
106
- this.licenseTypes = licenseTypes;
107
- }
108
-
109102 @JsonProperty("metadata")
110103 public Set<ApplicationMetadata> getApplicationMetadata() {
104
+ LOG.info("Getting metadata from app: {}", metadata);
111105 return metadata;
112106 }
113107
....@@ -137,4 +131,13 @@
137131 public void setLicenseFilename(String licenseFilename) {
138132 this.licenseFilename = licenseFilename;
139133 }
134
+
135
+ public Set<LicenseType> getLicenseTypes() {
136
+ LOG.info("Getting list license types!!!!");
137
+ return licenseTypes;
138
+ }
139
+
140
+ public void setLicenseTypes(Set<LicenseType> licenseTypes) {
141
+ this.licenseTypes = licenseTypes;
142
+ }
140143 }