rsanchez
2017-03-21 45029ab3bc4f6c293f3a59af233f015b71cc0c09
securis/src/main/java/net/curisit/securis/db/Application.java
....@@ -20,6 +20,7 @@
2020
2121 import com.fasterxml.jackson.annotation.JsonAutoDetect;
2222 import com.fasterxml.jackson.annotation.JsonIgnore;
23
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
2324 import com.fasterxml.jackson.annotation.JsonInclude;
2425 import com.fasterxml.jackson.annotation.JsonInclude.Include;
2526 import com.fasterxml.jackson.annotation.JsonManagedReference;
....@@ -31,121 +32,120 @@
3132 */
3233 @JsonAutoDetect
3334 @JsonInclude(Include.NON_NULL)
35
+@JsonIgnoreProperties(ignoreUnknown = true)
3436 @Entity
3537 @Table(name = "application")
36
-@NamedQueries({
37
- @NamedQuery(name = "list-applications", query = "SELECT a FROM Application a")
38
-})
38
+@NamedQueries({ @NamedQuery(name = "list-applications", query = "SELECT a FROM Application a") })
3939 public class Application implements Serializable {
4040
41
- private static final Logger LOG = LogManager.getLogger(Application.class);
41
+ private static final Logger LOG = LogManager.getLogger(Application.class);
4242
43
- private static final long serialVersionUID = 1L;
43
+ private static final long serialVersionUID = 1L;
4444
45
- @Id
46
- @GeneratedValue
47
- private Integer id;
45
+ @Id
46
+ @GeneratedValue
47
+ private Integer id;
4848
49
- private String code;
50
- private String name;
51
- private String description;
49
+ private String code;
50
+ private String name;
51
+ private String description;
5252
53
- @Column(name = "license_filename")
54
- @JsonProperty("license_filename")
55
- private String licenseFilename;
53
+ @Column(name = "license_filename")
54
+ @JsonProperty("license_filename")
55
+ private String licenseFilename;
5656
57
- @Column(name = "creation_timestamp")
58
- @JsonProperty("creation_timestamp")
59
- private Date creationTimestamp;
57
+ @Column(name = "creation_timestamp")
58
+ @JsonProperty("creation_timestamp")
59
+ private Date creationTimestamp;
6060
61
- // We don't include the referenced entities to limit the size of each row at
62
- // // the listing
63
- @JsonIgnore
64
- @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
65
- private Set<LicenseType> licenseTypes;
61
+ // We don't include the referenced entities to limit the size of each row at
62
+ // // the listing
63
+ @JsonIgnore
64
+ @OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
65
+ private Set<LicenseType> licenseTypes;
6666
67
- @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "application")
68
- @JsonManagedReference
69
- private Set<ApplicationMetadata> metadata;
67
+ @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "application")
68
+ @JsonManagedReference
69
+ private Set<ApplicationMetadata> metadata;
7070
71
- public Integer getId() {
72
- return id;
73
- }
71
+ public Integer getId() {
72
+ return id;
73
+ }
7474
75
- public void setId(Integer id) {
76
- this.id = id;
77
- }
75
+ public void setId(Integer id) {
76
+ this.id = id;
77
+ }
7878
79
- public String getName() {
80
- return name;
81
- }
79
+ public String getName() {
80
+ return name;
81
+ }
8282
83
- public void setName(String name) {
84
- this.name = name;
85
- }
83
+ public void setName(String name) {
84
+ this.name = name;
85
+ }
8686
87
- public String getDescription() {
88
- return description;
89
- }
87
+ public String getDescription() {
88
+ return description;
89
+ }
9090
91
- public void setDescription(String description) {
92
- this.description = description;
93
- }
91
+ public void setDescription(String description) {
92
+ this.description = description;
93
+ }
9494
95
- public Date getCreationTimestamp() {
96
- return creationTimestamp;
97
- }
95
+ public Date getCreationTimestamp() {
96
+ return creationTimestamp;
97
+ }
9898
99
- public void setCreationTimestamp(Date creationTimestamp) {
100
- this.creationTimestamp = creationTimestamp;
101
- }
99
+ public void setCreationTimestamp(Date creationTimestamp) {
100
+ this.creationTimestamp = creationTimestamp;
101
+ }
102102
103
- @JsonProperty("metadata")
104
- public Set<ApplicationMetadata> getApplicationMetadata() {
105
- return metadata;
106
- }
103
+ @JsonProperty("metadata")
104
+ public Set<ApplicationMetadata> getApplicationMetadata() {
105
+ return metadata;
106
+ }
107107
108
- @JsonProperty("metadata")
109
- public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {
110
- this.metadata = metadata;
111
- }
108
+ @JsonProperty("metadata")
109
+ public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {
110
+ this.metadata = metadata;
111
+ }
112112
113
- @Override
114
- public boolean equals(Object obj) {
115
- if (!(obj instanceof Application))
116
- return false;
117
- Application other = (Application) obj;
118
- return id.equals(other.id);
119
- }
113
+ @Override
114
+ public boolean equals(Object obj) {
115
+ if (!(obj instanceof Application))
116
+ return false;
117
+ Application other = (Application) obj;
118
+ return id.equals(other.id);
119
+ }
120120
121
- @Override
122
- public int hashCode() {
121
+ @Override
122
+ public int hashCode() {
123123
124
- return (id == null ? 0 : id.hashCode());
125
- }
124
+ return (id == null ? 0 : id.hashCode());
125
+ }
126126
127
- public String getLicenseFilename() {
128
- return licenseFilename;
129
- }
127
+ public String getLicenseFilename() {
128
+ return licenseFilename;
129
+ }
130130
131
- public void setLicenseFilename(String licenseFilename) {
132
- this.licenseFilename = licenseFilename;
133
- }
131
+ public void setLicenseFilename(String licenseFilename) {
132
+ this.licenseFilename = licenseFilename;
133
+ }
134134
135
- public Set<LicenseType> getLicenseTypes() {
136
- LOG.info("Getting list license types!!!!");
137
- return licenseTypes;
138
- }
135
+ public Set<LicenseType> getLicenseTypes() {
136
+ LOG.info("Getting list license types!!!!");
137
+ return licenseTypes;
138
+ }
139139
140
- public void setLicenseTypes(Set<LicenseType> licenseTypes) {
141
- this.licenseTypes = licenseTypes;
142
- }
140
+ public void setLicenseTypes(Set<LicenseType> licenseTypes) {
141
+ this.licenseTypes = licenseTypes;
142
+ }
143143
144
- public String getCode() {
145
- return code;
146
- }
144
+ public String getCode() {
145
+ return code;
146
+ }
147147
148
- public void setCode(String code) {
149
- this.code = code;
150
- }
148
+ public void setCode(String code) {
149
+ this.code = code;
150
+ }
151151 }