Joaquín Reñé
2025-10-07 146a0fb8b0e90f9196e569152f649baf60d6cc8f
securis/src/main/java/net/curisit/securis/db/LicenseHistory.java
....@@ -1,3 +1,6 @@
1
+/*
2
+* Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
3
+*/
14 package net.curisit.securis.db;
25
36 import java.io.Serializable;
....@@ -21,16 +24,26 @@
2124 import com.fasterxml.jackson.annotation.JsonProperty;
2225
2326 /**
24
- * Entity implementation class for Entity: license
25
- *
26
- */
27
+* LicenseHistory
28
+* <p>
29
+* Audit trail entries for a given license (who/what/when).
30
+*
31
+* Mapping details:
32
+* - Table: license_history
33
+* - Many-to-one to License and User (ignored in JSON).
34
+* - NamedQuery: list-license-history by license id.
35
+*
36
+* @author JRA
37
+* Last reviewed by JRA on Oct 5, 2025.
38
+*/
2739 @JsonAutoDetect
2840 @JsonInclude(Include.NON_NULL)
2941 @Entity
3042 @Table(name = "license_history")
3143 @JsonIgnoreProperties(ignoreUnknown = true)
3244 @NamedQueries({
33
- @NamedQuery(name = "list-license-history", query = "SELECT lh FROM LicenseHistory lh where lh.license.id = :licId")
45
+ @NamedQuery(name = "list-license-history",
46
+ query = "SELECT lh FROM LicenseHistory lh where lh.license.id = :licId")
3447 })
3548 public class LicenseHistory implements Serializable {
3649
....@@ -57,59 +70,117 @@
5770 @JsonProperty("creation_timestamp")
5871 private Date creationTimestamp;
5972
60
- public int getId() {
61
- return id;
62
- }
73
+ // ---------------- Getters & setters ----------------
6374
64
- public License getLicense() {
65
- return license;
66
- }
75
+ /**
76
+ * getId<p>
77
+ * Return primary key.
78
+ *
79
+ * @return id
80
+ */
81
+ public int getId() { return id; }
6782
68
- public void setLicense(License license) {
69
- this.license = license;
70
- }
83
+ /**
84
+ * getLicense<p>
85
+ * Return parent license (entity).
86
+ *
87
+ * @return license
88
+ */
89
+ public License getLicense() { return license; }
7190
72
- public User getUser() {
73
- return user;
74
- }
91
+ /**
92
+ * setLicense<p>
93
+ * Set parent license (entity).
94
+ *
95
+ * @return license
96
+ */
97
+ public void setLicense(License license) { this.license = license; }
7598
99
+ /**
100
+ * getUser<p>
101
+ * Return actor user (entity).
102
+ *
103
+ * @return user
104
+ */
105
+ public User getUser() { return user; }
106
+
107
+ /**
108
+ * getUsername<p>
109
+ * Expose username for JSON.
110
+ *
111
+ * @return username
112
+ */
76113 @JsonProperty("username")
77
- public String getUsername() {
78
- return user == null ? null : user.getUsername();
79
- }
114
+ public String getUsername() { return user == null ? null : user.getUsername(); }
80115
81
- public void setUser(User user) {
82
- this.user = user;
83
- }
116
+ /**
117
+ * setUser<p>
118
+ * Set actor user (entity).
119
+ *
120
+ * @param user
121
+ */
122
+ public void setUser(User user) { this.user = user; }
84123
85
- public String getAction() {
86
- return action;
87
- }
124
+ /**
125
+ * getAction<p>
126
+ * Return action key (e.g., "activate").
127
+ *
128
+ * @return action
129
+ */
130
+ public String getAction() { return action; }
88131
89
- public void setAction(String action) {
90
- this.action = action;
91
- }
132
+ /**
133
+ * setAction<p>
134
+ * Set action key.
135
+ *
136
+ * @param action
137
+ */
138
+ public void setAction(String action) { this.action = action; }
92139
93
- public String getComments() {
94
- return comments;
95
- }
140
+ /**
141
+ * getComments<p>
142
+ * Return optional comments.
143
+ *
144
+ * @return comments
145
+ */
146
+ public String getComments() { return comments; }
96147
97
- public void setComments(String comments) {
98
- this.comments = comments;
99
- }
148
+ /**
149
+ * setComments<p>
150
+ * Set optional comments.
151
+ *
152
+ * @param comments
153
+ */
154
+ public void setComments(String comments) { this.comments = comments; }
100155
101
- public void setId(int id) {
102
- this.id = id;
103
- }
156
+ /**
157
+ * setId<p>
158
+ * Set primary key (normally framework-managed)
159
+ *
160
+ * @param id.
161
+ */
162
+ public void setId(int id) { this.id = id; }
104163
105
- public Date getCreationTimestamp() {
106
- return creationTimestamp;
107
- }
164
+ /**
165
+ * getCreationTimestamp<p>
166
+ * Return timestamp.
167
+ *
168
+ * @return creationTimestamp
169
+ */
170
+ public Date getCreationTimestamp() { return creationTimestamp; }
108171
109
- public void setCreationTimestamp(Date creationTimestamp) {
110
- this.creationTimestamp = creationTimestamp;
111
- }
172
+ /**
173
+ * setCreationTimestamp<p>
174
+ * Set timestamp.
175
+ *
176
+ * @param creationTimestamp
177
+ */
178
+ public void setCreationTimestamp(Date creationTimestamp) { this.creationTimestamp = creationTimestamp; }
112179
180
+ /**
181
+ * Actions<p>
182
+ * Catalog of action names.
183
+ */
113184 public static class Actions {
114185 public static final String CREATE = "creation";
115186 public static final String ADD_REQUEST = "request";
....@@ -125,3 +196,4 @@
125196 public static final String DELETE = "delete";
126197 }
127198 }
199
+