| .. | .. |
|---|
| 37 | 37 | @JsonIgnoreProperties(ignoreUnknown = true) |
|---|
| 38 | 38 | @Entity |
|---|
| 39 | 39 | @Table(name = "license_type") |
|---|
| 40 | | -@NamedQueries({ |
|---|
| 41 | | - @NamedQuery(name = "list-license_types", query = "SELECT lt FROM LicenseType lt"), |
|---|
| 42 | | - @NamedQuery(name = "list-application-license_types", query = "SELECT lt FROM LicenseType lt where lt.application.id = :appId") |
|---|
| 43 | | -}) |
|---|
| 40 | +@NamedQueries({ @NamedQuery(name = "list-license_types", query = "SELECT lt FROM LicenseType lt"), |
|---|
| 41 | + @NamedQuery(name = "list-application-license_types", query = "SELECT lt FROM LicenseType lt where lt.application.id = :appId") }) |
|---|
| 44 | 42 | public class LicenseType implements Serializable { |
|---|
| 45 | 43 | |
|---|
| 46 | | - @SuppressWarnings("unused") |
|---|
| 47 | | - private static final Logger LOG = LogManager.getLogger(LicenseType.class); |
|---|
| 48 | | - private static final long serialVersionUID = 1L; |
|---|
| 44 | + @SuppressWarnings("unused") |
|---|
| 45 | + private static final Logger LOG = LogManager.getLogger(LicenseType.class); |
|---|
| 46 | + private static final long serialVersionUID = 1L; |
|---|
| 49 | 47 | |
|---|
| 50 | | - @Id |
|---|
| 51 | | - @GeneratedValue |
|---|
| 52 | | - private Integer id; |
|---|
| 48 | + @Id |
|---|
| 49 | + @GeneratedValue |
|---|
| 50 | + private Integer id; |
|---|
| 53 | 51 | |
|---|
| 54 | | - private String code; |
|---|
| 55 | | - private String name; |
|---|
| 56 | | - private String description; |
|---|
| 52 | + private String code; |
|---|
| 53 | + private String name; |
|---|
| 54 | + private String description; |
|---|
| 57 | 55 | |
|---|
| 58 | | - @Column(name = "creation_timestamp") |
|---|
| 59 | | - @JsonProperty("creation_timestamp") |
|---|
| 60 | | - private Date creationTimestamp; |
|---|
| 56 | + @Column(name = "creation_timestamp") |
|---|
| 57 | + @JsonProperty("creation_timestamp") |
|---|
| 58 | + private Date creationTimestamp; |
|---|
| 61 | 59 | |
|---|
| 62 | | - @JsonIgnore |
|---|
| 63 | | - @ManyToOne(fetch = FetchType.LAZY) |
|---|
| 64 | | - @JoinColumn(name = "application_id") |
|---|
| 65 | | - private Application application; |
|---|
| 60 | + @JsonIgnore |
|---|
| 61 | + @ManyToOne(fetch = FetchType.LAZY) |
|---|
| 62 | + @JoinColumn(name = "application_id") |
|---|
| 63 | + private Application application; |
|---|
| 66 | 64 | |
|---|
| 67 | | - @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "licenseType") |
|---|
| 68 | | - @JsonManagedReference |
|---|
| 69 | | - private Set<LicenseTypeMetadata> metadata; |
|---|
| 65 | + @OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "licenseType") |
|---|
| 66 | + @JsonManagedReference |
|---|
| 67 | + private Set<LicenseTypeMetadata> metadata; |
|---|
| 70 | 68 | |
|---|
| 71 | | - public Set<LicenseTypeMetadata> getMetadata() { |
|---|
| 72 | | - return metadata; |
|---|
| 73 | | - } |
|---|
| 69 | + public Set<LicenseTypeMetadata> getMetadata() { |
|---|
| 70 | + return metadata; |
|---|
| 71 | + } |
|---|
| 74 | 72 | |
|---|
| 75 | | - public void setMetadata(Set<LicenseTypeMetadata> metadata) { |
|---|
| 76 | | - this.metadata = metadata; |
|---|
| 77 | | - } |
|---|
| 73 | + public void setMetadata(Set<LicenseTypeMetadata> metadata) { |
|---|
| 74 | + this.metadata = metadata; |
|---|
| 75 | + } |
|---|
| 78 | 76 | |
|---|
| 79 | | - public Integer getId() { |
|---|
| 80 | | - return id; |
|---|
| 81 | | - } |
|---|
| 77 | + public Integer getId() { |
|---|
| 78 | + return id; |
|---|
| 79 | + } |
|---|
| 82 | 80 | |
|---|
| 83 | | - public void setId(Integer id) { |
|---|
| 84 | | - this.id = id; |
|---|
| 85 | | - } |
|---|
| 81 | + public void setId(Integer id) { |
|---|
| 82 | + this.id = id; |
|---|
| 83 | + } |
|---|
| 86 | 84 | |
|---|
| 87 | | - public String getName() { |
|---|
| 88 | | - return name; |
|---|
| 89 | | - } |
|---|
| 85 | + public String getName() { |
|---|
| 86 | + return name; |
|---|
| 87 | + } |
|---|
| 90 | 88 | |
|---|
| 91 | | - public void setName(String name) { |
|---|
| 92 | | - this.name = name; |
|---|
| 93 | | - } |
|---|
| 89 | + public void setName(String name) { |
|---|
| 90 | + this.name = name; |
|---|
| 91 | + } |
|---|
| 94 | 92 | |
|---|
| 95 | | - public String getDescription() { |
|---|
| 96 | | - return description; |
|---|
| 97 | | - } |
|---|
| 93 | + public String getDescription() { |
|---|
| 94 | + return description; |
|---|
| 95 | + } |
|---|
| 98 | 96 | |
|---|
| 99 | | - public void setDescription(String description) { |
|---|
| 100 | | - this.description = description; |
|---|
| 101 | | - } |
|---|
| 97 | + public void setDescription(String description) { |
|---|
| 98 | + this.description = description; |
|---|
| 99 | + } |
|---|
| 102 | 100 | |
|---|
| 103 | | - public String getCode() { |
|---|
| 104 | | - return code; |
|---|
| 105 | | - } |
|---|
| 101 | + public String getCode() { |
|---|
| 102 | + return code; |
|---|
| 103 | + } |
|---|
| 106 | 104 | |
|---|
| 107 | | - public void setCode(String code) { |
|---|
| 108 | | - this.code = code; |
|---|
| 109 | | - } |
|---|
| 105 | + public void setCode(String code) { |
|---|
| 106 | + this.code = code; |
|---|
| 107 | + } |
|---|
| 110 | 108 | |
|---|
| 111 | | - public Application getApplication() { |
|---|
| 112 | | - LOG.info("Getting APP from LicType"); |
|---|
| 113 | | - return application; |
|---|
| 114 | | - } |
|---|
| 109 | + public Application getApplication() { |
|---|
| 110 | + return application; |
|---|
| 111 | + } |
|---|
| 115 | 112 | |
|---|
| 116 | | - @JsonProperty("application_name") |
|---|
| 117 | | - public String getApplicationName() { |
|---|
| 118 | | - return application == null ? null : application.getName(); |
|---|
| 119 | | - } |
|---|
| 113 | + @JsonProperty("application_name") |
|---|
| 114 | + public String getApplicationName() { |
|---|
| 115 | + return application == null ? null : application.getName(); |
|---|
| 116 | + } |
|---|
| 120 | 117 | |
|---|
| 121 | | - @JsonProperty("application_id") |
|---|
| 122 | | - public Integer getApplicationId() { |
|---|
| 123 | | - return application == null ? null : application.getId(); |
|---|
| 124 | | - } |
|---|
| 118 | + @JsonProperty("application_id") |
|---|
| 119 | + public Integer getApplicationId() { |
|---|
| 120 | + return application == null ? null : application.getId(); |
|---|
| 121 | + } |
|---|
| 125 | 122 | |
|---|
| 126 | | - @JsonProperty("application_id") |
|---|
| 127 | | - public void setApplicationId(Integer appId) { |
|---|
| 128 | | - if (appId == null) { |
|---|
| 129 | | - application = null; |
|---|
| 130 | | - } else { |
|---|
| 131 | | - application = new Application(); |
|---|
| 132 | | - application.setId(appId); |
|---|
| 133 | | - } |
|---|
| 134 | | - } |
|---|
| 123 | + @JsonProperty("application_id") |
|---|
| 124 | + public void setApplicationId(Integer appId) { |
|---|
| 125 | + if (appId == null) { |
|---|
| 126 | + application = null; |
|---|
| 127 | + } else { |
|---|
| 128 | + application = new Application(); |
|---|
| 129 | + application.setId(appId); |
|---|
| 130 | + } |
|---|
| 131 | + } |
|---|
| 135 | 132 | |
|---|
| 136 | | - public void setApplication(Application application) { |
|---|
| 137 | | - this.application = application; |
|---|
| 138 | | - } |
|---|
| 133 | + public void setApplication(Application application) { |
|---|
| 134 | + this.application = application; |
|---|
| 135 | + } |
|---|
| 139 | 136 | |
|---|
| 140 | | - public Date getCreationTimestamp() { |
|---|
| 141 | | - return creationTimestamp; |
|---|
| 142 | | - } |
|---|
| 137 | + public Date getCreationTimestamp() { |
|---|
| 138 | + return creationTimestamp; |
|---|
| 139 | + } |
|---|
| 143 | 140 | |
|---|
| 144 | | - public void setCreationTimestamp(Date creationTimestamp) { |
|---|
| 145 | | - this.creationTimestamp = creationTimestamp; |
|---|
| 146 | | - } |
|---|
| 141 | + public void setCreationTimestamp(Date creationTimestamp) { |
|---|
| 142 | + this.creationTimestamp = creationTimestamp; |
|---|
| 143 | + } |
|---|
| 147 | 144 | |
|---|
| 148 | | - @Override |
|---|
| 149 | | - public boolean equals(Object obj) { |
|---|
| 150 | | - if (!(obj instanceof LicenseType)) |
|---|
| 151 | | - return false; |
|---|
| 152 | | - LicenseType other = (LicenseType) obj; |
|---|
| 153 | | - return id.equals(other.id); |
|---|
| 154 | | - } |
|---|
| 145 | + @Override |
|---|
| 146 | + public boolean equals(Object obj) { |
|---|
| 147 | + if (!(obj instanceof LicenseType)) |
|---|
| 148 | + return false; |
|---|
| 149 | + LicenseType other = (LicenseType) obj; |
|---|
| 150 | + return id.equals(other.id); |
|---|
| 151 | + } |
|---|
| 155 | 152 | |
|---|
| 156 | | - @Override |
|---|
| 157 | | - public int hashCode() { |
|---|
| 153 | + @Override |
|---|
| 154 | + public int hashCode() { |
|---|
| 158 | 155 | |
|---|
| 159 | | - return (id == null ? 0 : id.hashCode()); |
|---|
| 160 | | - } |
|---|
| 156 | + return (id == null ? 0 : id.hashCode()); |
|---|
| 157 | + } |
|---|
| 161 | 158 | } |
|---|