rsanchez
2016-12-05 1ed7bc42993b3d23d92dfc38dfd34026a4619ae7
securis/src/main/java/net/curisit/securis/db/LicenseType.java
....@@ -37,125 +37,122 @@
3737 @JsonIgnoreProperties(ignoreUnknown = true)
3838 @Entity
3939 @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") })
4442 public class LicenseType implements Serializable {
4543
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;
4947
50
- @Id
51
- @GeneratedValue
52
- private Integer id;
48
+ @Id
49
+ @GeneratedValue
50
+ private Integer id;
5351
54
- private String code;
55
- private String name;
56
- private String description;
52
+ private String code;
53
+ private String name;
54
+ private String description;
5755
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;
6159
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;
6664
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;
7068
71
- public Set<LicenseTypeMetadata> getMetadata() {
72
- return metadata;
73
- }
69
+ public Set<LicenseTypeMetadata> getMetadata() {
70
+ return metadata;
71
+ }
7472
75
- public void setMetadata(Set<LicenseTypeMetadata> metadata) {
76
- this.metadata = metadata;
77
- }
73
+ public void setMetadata(Set<LicenseTypeMetadata> metadata) {
74
+ this.metadata = metadata;
75
+ }
7876
79
- public Integer getId() {
80
- return id;
81
- }
77
+ public Integer getId() {
78
+ return id;
79
+ }
8280
83
- public void setId(Integer id) {
84
- this.id = id;
85
- }
81
+ public void setId(Integer id) {
82
+ this.id = id;
83
+ }
8684
87
- public String getName() {
88
- return name;
89
- }
85
+ public String getName() {
86
+ return name;
87
+ }
9088
91
- public void setName(String name) {
92
- this.name = name;
93
- }
89
+ public void setName(String name) {
90
+ this.name = name;
91
+ }
9492
95
- public String getDescription() {
96
- return description;
97
- }
93
+ public String getDescription() {
94
+ return description;
95
+ }
9896
99
- public void setDescription(String description) {
100
- this.description = description;
101
- }
97
+ public void setDescription(String description) {
98
+ this.description = description;
99
+ }
102100
103
- public String getCode() {
104
- return code;
105
- }
101
+ public String getCode() {
102
+ return code;
103
+ }
106104
107
- public void setCode(String code) {
108
- this.code = code;
109
- }
105
+ public void setCode(String code) {
106
+ this.code = code;
107
+ }
110108
111
- public Application getApplication() {
112
- LOG.info("Getting APP from LicType");
113
- return application;
114
- }
109
+ public Application getApplication() {
110
+ return application;
111
+ }
115112
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
+ }
120117
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
+ }
125122
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
+ }
135132
136
- public void setApplication(Application application) {
137
- this.application = application;
138
- }
133
+ public void setApplication(Application application) {
134
+ this.application = application;
135
+ }
139136
140
- public Date getCreationTimestamp() {
141
- return creationTimestamp;
142
- }
137
+ public Date getCreationTimestamp() {
138
+ return creationTimestamp;
139
+ }
143140
144
- public void setCreationTimestamp(Date creationTimestamp) {
145
- this.creationTimestamp = creationTimestamp;
146
- }
141
+ public void setCreationTimestamp(Date creationTimestamp) {
142
+ this.creationTimestamp = creationTimestamp;
143
+ }
147144
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
+ }
155152
156
- @Override
157
- public int hashCode() {
153
+ @Override
154
+ public int hashCode() {
158155
159
- return (id == null ? 0 : id.hashCode());
160
- }
156
+ return (id == null ? 0 : id.hashCode());
157
+ }
161158 }