Roberto Sánchez
2014-01-26 6d8aff7b3657332020ef215eb1b2fc16017e4cc8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
package net.curisit.securis.db;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.codehaus.jackson.annotate.JsonAutoDetect;
import org.codehaus.jackson.annotate.JsonIgnore;
import org.codehaus.jackson.annotate.JsonIgnoreProperties;
import org.codehaus.jackson.annotate.JsonProperty;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
 * Entity implementation class for Entity: license
 * 
 */
@JsonAutoDetect
@JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@Entity
@Table(name = "license")
@JsonIgnoreProperties(ignoreUnknown = true)
@NamedQueries(
   { @NamedQuery(name = "list-licenses-by-pack", query = "SELECT l FROM License l where l.pack.id = :packId") })
public class License implements Serializable {
   private static final long serialVersionUID = 1L;
   @Id
   @GeneratedValue
   private int id;
   private String code;
   @JsonIgnore
   @ManyToOne
   @JoinColumn(name = "pack_id")
   private Pack pack;
   @JsonIgnore
   @ManyToOne
   @JoinColumn(name = "created_by")
   private User createdBy;
   @JsonIgnore
   @ManyToOne
   @JoinColumn(name = "canceled_by")
   private User canceledBy;
   private int status;
   @Column(name = "full_name")
   @JsonProperty("full_name")
   private String fullName;
   private String email;
   @Column(name = "request_data")
   @JsonProperty("request_data")
   private String requestData;
   @Column(name = "license_data")
   @JsonProperty("license_data")
   private String licenseData;
   @Column(name = "creation_timestamp")
   private Date creationTimestamp;
   @Column(name = "modification_timestamp")
   private Date modificationTimestamp;
   @Column(name = "last_access_timestamp")
   private Date lastAccessTimestamp;
   private String comments;
   @OneToMany(fetch = FetchType.LAZY, mappedBy = "license")
   private List<LicenseHistory> history;
   public int getId() {
       return id;
   }
   public String getCode() {
       return code;
   }
   public void setCode(String code) {
       this.code = code;
   }
   public Date getCreationTimestamp() {
       return creationTimestamp;
   }
   public void setCreationTimestamp(Date creationTimestamp) {
       this.creationTimestamp = creationTimestamp;
   }
   public User getCreatedBy() {
       return createdBy;
   }
   public void setCreatedBy(User createdBy) {
       this.createdBy = createdBy;
   }
   public Pack getPack() {
       return pack;
   }
   public void setPack(Pack pack) {
       this.pack = pack;
   }
   @JsonProperty("created_by_id")
   public String getCreatedById() {
       return createdBy == null ? null : createdBy.getUsername();
   }
   @JsonProperty("created_by_id")
   public void setCreatedById(String username) {
       if (username == null) {
           createdBy = null;
       } else {
           createdBy = new User();
           createdBy.setUsername(username);
       }
   }
   @JsonProperty("canceled_by_id")
   public String getCanceledById() {
       return canceledBy == null ? null : canceledBy.getUsername();
   }
   @JsonProperty("canceled_by_id")
   public void setCanceledById(String username) {
       if (username == null) {
           canceledBy = null;
       } else {
           canceledBy = new User();
           canceledBy.setUsername(username);
       }
   }
   @JsonProperty("pack_code")
   public String getPackCode() {
       return pack == null ? null : pack.getCode();
   }
   @JsonProperty("pack_id")
   public Integer getPackId() {
       return pack == null ? null : pack.getId();
   }
   @JsonProperty("pack_id")
   public void setPackId(Integer idPack) {
       if (idPack == null) {
           pack = null;
       } else {
           pack = new Pack();
           pack.setId(idPack);
       }
   }
   public int getStatus() {
       return status;
   }
   public void setStatus(int status) {
       this.status = status;
   }
   public Date getModificationTimestamp() {
       return modificationTimestamp;
   }
   public void setModificationTimestamp(Date modificationTimestamp) {
       this.modificationTimestamp = modificationTimestamp;
   }
   public String getFullName() {
       return fullName;
   }
   public void setFullName(String fullName) {
       this.fullName = fullName;
   }
   public String getEmail() {
       return email;
   }
   public void setEmail(String email) {
       this.email = email;
   }
   public void setId(int id) {
       this.id = id;
   }
   public User getCanceledBy() {
       return canceledBy;
   }
   public void setCanceledBy(User canceledBy) {
       this.canceledBy = canceledBy;
   }
   public Date getLastAccessTimestamp() {
       return lastAccessTimestamp;
   }
   public void setLastAccessTimestamp(Date lastAccessTimestamp) {
       this.lastAccessTimestamp = lastAccessTimestamp;
   }
   public String getRequestData() {
       return requestData;
   }
   public void setRequestData(String requestData) {
       this.requestData = requestData;
   }
   public String getLicenseData() {
       return licenseData;
   }
   public void setLicenseData(String licenseData) {
       this.licenseData = licenseData;
   }
   public String getComments() {
       return comments;
   }
   public void setComments(String comments) {
       this.comments = comments;
   }
   public List<LicenseHistory> getHistory() {
       return history;
   }
   public void setHistory(List<LicenseHistory> history) {
       this.history = history;
   }
   public static class Status {
       public static final int CREATED = 0;
       public static final int SENT = 1;
       public static final int ACTIVE = 2;
       public static final int CANCELED = 3;
   }
}