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
package net.curisit.securis.db;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
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.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_history")
@JsonIgnoreProperties(ignoreUnknown = true)
@NamedQueries(
   { @NamedQuery(name = "list-license-history", query = "SELECT lh FROM LicenseHistory lh where lh.license.id = :licId") })
public class LicenseHistory implements Serializable {
   private static final long serialVersionUID = 1L;
   @Id
   @GeneratedValue
   private int id;
   @JsonIgnore
   @ManyToOne
   @JoinColumn(name = "license_id")
   private License license;
   @JsonIgnore
   @ManyToOne
   @JoinColumn(name = "username")
   private User user;
   private String action;
   private String comments;
   private Date timestamp;
   public int getId() {
       return id;
   }
   public License getLicense() {
       return license;
   }
   public void setLicense(License license) {
       this.license = license;
   }
   public User getUser() {
       return user;
   }
   @JsonProperty("username")
   public String getUsername() {
       return user == null ? null : user.getUsername();
   }
   public void setUser(User user) {
       this.user = user;
   }
   public String getAction() {
       return action;
   }
   public void setAction(String action) {
       this.action = action;
   }
   public String getComments() {
       return comments;
   }
   public void setComments(String comments) {
       this.comments = comments;
   }
   public Date getTimestamp() {
       return timestamp;
   }
   public void setTimestamp(Date timestamp) {
       this.timestamp = timestamp;
   }
   public void setId(int id) {
       this.id = id;
   }
   public static class Actions {
       public static final String CREATE = "creation";
       public static final String ADD_REQUEST = "request";
       public static final String SEND = "send";
       public static final String MODIFY = "modify";
       public static final String ACTIVATE = "activate";
       public static final String CANCEL = "cancel";
       public static final String DELETE = "delete";
   }
}