From 146a0fb8b0e90f9196e569152f649baf60d6cc8f Mon Sep 17 00:00:00 2001
From: Joaquín Reñé <jrene@curisit.net>
Date: Tue, 07 Oct 2025 14:52:57 +0000
Subject: [PATCH] #4410 - Comments on classes

---
 securis/src/main/java/net/curisit/securis/db/LicenseHistory.java |  158 ++++++++++++++++++++++++++++++++++++++--------------
 1 files changed, 115 insertions(+), 43 deletions(-)

diff --git a/securis/src/main/java/net/curisit/securis/db/LicenseHistory.java b/securis/src/main/java/net/curisit/securis/db/LicenseHistory.java
index 7fd0b03..78f8cbd 100644
--- a/securis/src/main/java/net/curisit/securis/db/LicenseHistory.java
+++ b/securis/src/main/java/net/curisit/securis/db/LicenseHistory.java
@@ -1,3 +1,6 @@
+/*
+* Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
+*/
 package net.curisit.securis.db;
 
 import java.io.Serializable;
@@ -21,16 +24,26 @@
 import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
- * Entity implementation class for Entity: license
- * 
- */
+* LicenseHistory
+* <p>
+* Audit trail entries for a given license (who/what/when).
+*
+* Mapping details:
+* - Table: license_history
+* - Many-to-one to License and User (ignored in JSON).
+* - NamedQuery: list-license-history by license id.
+* 
+* @author JRA
+* Last reviewed by JRA on Oct 5, 2025.
+*/
 @JsonAutoDetect
 @JsonInclude(Include.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")
+    @NamedQuery(name = "list-license-history",
+                query = "SELECT lh FROM LicenseHistory lh where lh.license.id = :licId")
 })
 public class LicenseHistory implements Serializable {
 
@@ -57,59 +70,117 @@
     @JsonProperty("creation_timestamp")
     private Date creationTimestamp;
 
-    public int getId() {
-        return id;
-    }
+    // ---------------- Getters & setters ----------------
 
-    public License getLicense() {
-        return license;
-    }
+    /** 
+     * getId<p>
+     * Return primary key. 
+     * 
+     * @return id
+     */
+    public int getId() { return id; }
 
-    public void setLicense(License license) {
-        this.license = license;
-    }
+    /** 
+     * getLicense<p>
+     * Return parent license (entity). 
+     * 
+     * @return license
+     */
+    public License getLicense() { return license; }
 
-    public User getUser() {
-        return user;
-    }
+    /** 
+     * setLicense<p>
+     * Set parent license (entity). 
+     * 
+     * @return license
+     */
+    public void setLicense(License license) { this.license = license; }
 
+    /** 
+     * getUser<p>
+     * Return actor user (entity). 
+     * 
+     * @return user
+     */
+    public User getUser() { return user; }
+
+    /** 
+     * getUsername<p>
+     * Expose username for JSON. 
+     * 
+     * @return username
+     */
     @JsonProperty("username")
-    public String getUsername() {
-        return user == null ? null : user.getUsername();
-    }
+    public String getUsername() { return user == null ? null : user.getUsername(); }
 
-    public void setUser(User user) {
-        this.user = user;
-    }
+    /** 
+     * setUser<p>
+     * Set actor user (entity). 
+     * 
+     * @param user
+     */
+    public void setUser(User user) { this.user = user; }
 
-    public String getAction() {
-        return action;
-    }
+    /** 
+     * getAction<p>
+     * Return action key (e.g., "activate"). 
+     * 
+     * @return action
+     */
+    public String getAction() { return action; }
 
-    public void setAction(String action) {
-        this.action = action;
-    }
+    /** 
+     * setAction<p>
+     * Set action key. 
+     * 
+     * @param action
+     */
+    public void setAction(String action) { this.action = action; }
 
-    public String getComments() {
-        return comments;
-    }
+    /** 
+     * getComments<p>
+     * Return optional comments. 
+     * 
+     * @return comments
+     */
+    public String getComments() { return comments; }
 
-    public void setComments(String comments) {
-        this.comments = comments;
-    }
+    /** 
+     * setComments<p>
+     * Set optional comments. 
+     * 
+     * @param comments
+     */
+    public void setComments(String comments) { this.comments = comments; }
 
-    public void setId(int id) {
-        this.id = id;
-    }
+    /** 
+     * setId<p>
+     * Set primary key (normally framework-managed)
+     * 
+     * @param id. 
+     */
+    public void setId(int id) { this.id = id; }
 
-    public Date getCreationTimestamp() {
-        return creationTimestamp;
-    }
+    /** 
+     * getCreationTimestamp<p>
+     * Return timestamp. 
+     * 
+     * @return creationTimestamp
+     */
+    public Date getCreationTimestamp() { return creationTimestamp; }
 
-    public void setCreationTimestamp(Date creationTimestamp) {
-        this.creationTimestamp = creationTimestamp;
-    }
+    /** 
+     * setCreationTimestamp<p>
+     * Set timestamp. 
+     * 
+     * @param creationTimestamp
+     */
+    public void setCreationTimestamp(Date creationTimestamp) { this.creationTimestamp = creationTimestamp; }
 
+    /** 
+     * Actions<p>
+     * Catalog of action names. 
+     */
     public static class Actions {
         public static final String CREATE = "creation";
         public static final String ADD_REQUEST = "request";
@@ -125,3 +196,4 @@
         public static final String DELETE = "delete";
     }
 }
+

--
Gitblit v1.3.2