| .. | .. |
|---|
| 20 | 20 | |
|---|
| 21 | 21 | import com.fasterxml.jackson.annotation.JsonAutoDetect; |
|---|
| 22 | 22 | import com.fasterxml.jackson.annotation.JsonIgnore; |
|---|
| 23 | +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|---|
| 23 | 24 | import com.fasterxml.jackson.annotation.JsonInclude; |
|---|
| 24 | 25 | import com.fasterxml.jackson.annotation.JsonInclude.Include; |
|---|
| 25 | 26 | import com.fasterxml.jackson.annotation.JsonManagedReference; |
|---|
| .. | .. |
|---|
| 31 | 32 | */ |
|---|
| 32 | 33 | @JsonAutoDetect |
|---|
| 33 | 34 | @JsonInclude(Include.NON_NULL) |
|---|
| 35 | +@JsonIgnoreProperties(ignoreUnknown = true) |
|---|
| 34 | 36 | @Entity |
|---|
| 35 | 37 | @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") }) |
|---|
| 39 | 39 | public class Application implements Serializable { |
|---|
| 40 | 40 | |
|---|
| 41 | | - private static final Logger LOG = LogManager.getLogger(Application.class); |
|---|
| 41 | + private static final Logger LOG = LogManager.getLogger(Application.class); |
|---|
| 42 | 42 | |
|---|
| 43 | | - private static final long serialVersionUID = 1L; |
|---|
| 43 | + private static final long serialVersionUID = 1L; |
|---|
| 44 | 44 | |
|---|
| 45 | | - @Id |
|---|
| 46 | | - @GeneratedValue |
|---|
| 47 | | - private Integer id; |
|---|
| 45 | + @Id |
|---|
| 46 | + @GeneratedValue |
|---|
| 47 | + private Integer id; |
|---|
| 48 | 48 | |
|---|
| 49 | | - private String code; |
|---|
| 50 | | - private String name; |
|---|
| 51 | | - private String description; |
|---|
| 49 | + private String code; |
|---|
| 50 | + private String name; |
|---|
| 51 | + private String description; |
|---|
| 52 | 52 | |
|---|
| 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; |
|---|
| 56 | 56 | |
|---|
| 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; |
|---|
| 60 | 60 | |
|---|
| 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; |
|---|
| 66 | 66 | |
|---|
| 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; |
|---|
| 70 | 70 | |
|---|
| 71 | | - public Integer getId() { |
|---|
| 72 | | - return id; |
|---|
| 73 | | - } |
|---|
| 71 | + public Integer getId() { |
|---|
| 72 | + return id; |
|---|
| 73 | + } |
|---|
| 74 | 74 | |
|---|
| 75 | | - public void setId(Integer id) { |
|---|
| 76 | | - this.id = id; |
|---|
| 77 | | - } |
|---|
| 75 | + public void setId(Integer id) { |
|---|
| 76 | + this.id = id; |
|---|
| 77 | + } |
|---|
| 78 | 78 | |
|---|
| 79 | | - public String getName() { |
|---|
| 80 | | - return name; |
|---|
| 81 | | - } |
|---|
| 79 | + public String getName() { |
|---|
| 80 | + return name; |
|---|
| 81 | + } |
|---|
| 82 | 82 | |
|---|
| 83 | | - public void setName(String name) { |
|---|
| 84 | | - this.name = name; |
|---|
| 85 | | - } |
|---|
| 83 | + public void setName(String name) { |
|---|
| 84 | + this.name = name; |
|---|
| 85 | + } |
|---|
| 86 | 86 | |
|---|
| 87 | | - public String getDescription() { |
|---|
| 88 | | - return description; |
|---|
| 89 | | - } |
|---|
| 87 | + public String getDescription() { |
|---|
| 88 | + return description; |
|---|
| 89 | + } |
|---|
| 90 | 90 | |
|---|
| 91 | | - public void setDescription(String description) { |
|---|
| 92 | | - this.description = description; |
|---|
| 93 | | - } |
|---|
| 91 | + public void setDescription(String description) { |
|---|
| 92 | + this.description = description; |
|---|
| 93 | + } |
|---|
| 94 | 94 | |
|---|
| 95 | | - public Date getCreationTimestamp() { |
|---|
| 96 | | - return creationTimestamp; |
|---|
| 97 | | - } |
|---|
| 95 | + public Date getCreationTimestamp() { |
|---|
| 96 | + return creationTimestamp; |
|---|
| 97 | + } |
|---|
| 98 | 98 | |
|---|
| 99 | | - public void setCreationTimestamp(Date creationTimestamp) { |
|---|
| 100 | | - this.creationTimestamp = creationTimestamp; |
|---|
| 101 | | - } |
|---|
| 99 | + public void setCreationTimestamp(Date creationTimestamp) { |
|---|
| 100 | + this.creationTimestamp = creationTimestamp; |
|---|
| 101 | + } |
|---|
| 102 | 102 | |
|---|
| 103 | | - @JsonProperty("metadata") |
|---|
| 104 | | - public Set<ApplicationMetadata> getApplicationMetadata() { |
|---|
| 105 | | - return metadata; |
|---|
| 106 | | - } |
|---|
| 103 | + @JsonProperty("metadata") |
|---|
| 104 | + public Set<ApplicationMetadata> getApplicationMetadata() { |
|---|
| 105 | + return metadata; |
|---|
| 106 | + } |
|---|
| 107 | 107 | |
|---|
| 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 | + } |
|---|
| 112 | 112 | |
|---|
| 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 | + } |
|---|
| 120 | 120 | |
|---|
| 121 | | - @Override |
|---|
| 122 | | - public int hashCode() { |
|---|
| 121 | + @Override |
|---|
| 122 | + public int hashCode() { |
|---|
| 123 | 123 | |
|---|
| 124 | | - return (id == null ? 0 : id.hashCode()); |
|---|
| 125 | | - } |
|---|
| 124 | + return (id == null ? 0 : id.hashCode()); |
|---|
| 125 | + } |
|---|
| 126 | 126 | |
|---|
| 127 | | - public String getLicenseFilename() { |
|---|
| 128 | | - return licenseFilename; |
|---|
| 129 | | - } |
|---|
| 127 | + public String getLicenseFilename() { |
|---|
| 128 | + return licenseFilename; |
|---|
| 129 | + } |
|---|
| 130 | 130 | |
|---|
| 131 | | - public void setLicenseFilename(String licenseFilename) { |
|---|
| 132 | | - this.licenseFilename = licenseFilename; |
|---|
| 133 | | - } |
|---|
| 131 | + public void setLicenseFilename(String licenseFilename) { |
|---|
| 132 | + this.licenseFilename = licenseFilename; |
|---|
| 133 | + } |
|---|
| 134 | 134 | |
|---|
| 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 | + } |
|---|
| 139 | 139 | |
|---|
| 140 | | - public void setLicenseTypes(Set<LicenseType> licenseTypes) { |
|---|
| 141 | | - this.licenseTypes = licenseTypes; |
|---|
| 142 | | - } |
|---|
| 140 | + public void setLicenseTypes(Set<LicenseType> licenseTypes) { |
|---|
| 141 | + this.licenseTypes = licenseTypes; |
|---|
| 142 | + } |
|---|
| 143 | 143 | |
|---|
| 144 | | - public String getCode() { |
|---|
| 145 | | - return code; |
|---|
| 146 | | - } |
|---|
| 144 | + public String getCode() { |
|---|
| 145 | + return code; |
|---|
| 146 | + } |
|---|
| 147 | 147 | |
|---|
| 148 | | - public void setCode(String code) { |
|---|
| 149 | | - this.code = code; |
|---|
| 150 | | - } |
|---|
| 148 | + public void setCode(String code) { |
|---|
| 149 | + this.code = code; |
|---|
| 150 | + } |
|---|
| 151 | 151 | } |
|---|