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/Application.java |  167 ++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 162 insertions(+), 5 deletions(-)

diff --git a/securis/src/main/java/net/curisit/securis/db/Application.java b/securis/src/main/java/net/curisit/securis/db/Application.java
index 138481f..bc57809 100644
--- a/securis/src/main/java/net/curisit/securis/db/Application.java
+++ b/securis/src/main/java/net/curisit/securis/db/Application.java
@@ -1,3 +1,6 @@
+/*
+ * Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
+ */
 package net.curisit.securis.db;
 
 import java.io.Serializable;
@@ -30,9 +33,25 @@
 import com.fasterxml.jackson.annotation.JsonProperty;
 
 /**
- * Entity implementation class for Entity: application
- * 
- */
+* Application
+* <p>
+* JPA entity that represents an application registered in the licensing server.
+* Includes descriptive fields and relationships to <code>LicenseType</code>,
+* <code>ApplicationMetadata</code> and <code>User</code>.
+*
+* Mapping details:
+* <ul>
+* <li>Table: <code>application</code></li>
+* <li>Named queries: <code>list-applications</code>, <code>list-applications-by_ids</code></li>
+* <li>Relationships:
+* <ul>
+* <li><code>@OneToMany</code> <b>licenseTypes</b> (mappedBy="application")</li>
+* <li><code>@OneToMany</code> <b>metadata</b> with cascade PERSIST/REMOVE/REFRESH</li>
+* <li><code>@ManyToMany</code> <b>users</b> via join table <code>user_application</code></li>
+* </ul>
+* </li>
+* </ul>
+*/
 @JsonAutoDetect
 @JsonInclude(Include.NON_NULL)
 @JsonIgnoreProperties(ignoreUnknown = true)
@@ -46,32 +65,57 @@
 
 	private static final long serialVersionUID = 1L;
 
+	// ------------------------------------------------------------------
+	// Columns
+	// ------------------------------------------------------------------
+
+
+	/** Surrogate primary key. */
 	@Id
 	@GeneratedValue
 	private Integer id;
 
+	/** Unique short code for the application (business identifier). */
 	private String code;
+	
+	/** Human-friendly application name. */
 	private String name;
+	
+	/** Optional description. */
 	private String description;
 
+	/** Default license file name suggested for downloads/exports. */
 	@Column(name = "license_filename")
 	@JsonProperty("license_filename")
 	private String licenseFilename;
 
+	/** Creation timestamp (server-side). */
 	@Column(name = "creation_timestamp")
 	@JsonProperty("creation_timestamp")
 	private Date creationTimestamp;
 
-	// We don't include the referenced entities to limit the size of each row at
-	// // the listing
+	// ----------------------- Relationships ---------------------------
+
+
+	/**
+	* License types attached to this application (ignored in default JSON to keep listings small).
+	* 
+	* We don't include the referenced entities to limit the size of each row at the listing
+	*/
 	@JsonIgnore
 	@OneToMany(fetch = FetchType.LAZY, mappedBy = "application")
 	private Set<LicenseType> licenseTypes;
 
+	/**
+	* Metadata key/value entries for this application.
+	*/
 	@OneToMany(fetch = FetchType.LAZY, cascade = { CascadeType.PERSIST, CascadeType.REMOVE, CascadeType.REFRESH }, mappedBy = "application")
 	@JsonManagedReference
 	private Set<ApplicationMetadata> metadata;
 
+	/**
+	* Users that have access/relationship with this application (ignored in JSON listings).
+	*/
 	@JsonIgnore
 	// We don't include the users to limit the size of each row a the listing
 	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.REMOVE)
@@ -80,73 +124,180 @@
 			inverseJoinColumns = { @JoinColumn(name = "username", referencedColumnName = "username") })
 	private Set<User> users;
 
+	// ------------------------------------------------------------------
+	// Getters & setters
+	// ------------------------------------------------------------------
+
+	/** 
+	 * getId<p>
+	 * Return the primary key. 
+	 * 
+	 * @return id
+	 */
 	public Integer getId() {
 		return id;
 	}
 
+	/**
+	 * setId<p>
+	 * Set the primary key
+	 * 
+	 * @param id
+	 */
 	public void setId(Integer id) {
 		this.id = id;
 	}
 
+	/**
+	 * getName<p>
+	 * Get the name
+	 * 
+	 * @return name
+	 */
 	public String getName() {
 		return name;
 	}
 
+	/**
+	 * setName<p>
+	 * Set the name
+	 * 
+	 * @param name
+	 */
 	public void setName(String name) {
 		this.name = name;
 	}
 
+	/**
+	 * getDescription<p>
+	 * Get the description
+	 * 
+	 * @return description
+	 */
 	public String getDescription() {
 		return description;
 	}
 
+	/**
+	 * setDescription<p>
+	 * Set the description
+	 * 
+	 * @param description
+	 */
 	public void setDescription(String description) {
 		this.description = description;
 	}
 
+	/**
+	 * getCreationTimestamp<p>
+	 * Get the creation timestamp
+	 * 
+	 * @return creationTimestamp
+	 */
 	public Date getCreationTimestamp() {
 		return creationTimestamp;
 	}
 
+	/**
+	 * setCreationTimestamp<p>
+	 * Set the creation timestamp
+	 * 
+	 * @param creationTimestamp
+	 */
 	public void setCreationTimestamp(Date creationTimestamp) {
 		this.creationTimestamp = creationTimestamp;
 	}
 
+	/**
+	 * getApplicationMetadata<p>
+	 * Set the application metadata
+	 * 
+	 * @return appMetadata
+	 */
 	@JsonProperty("metadata")
 	public Set<ApplicationMetadata> getApplicationMetadata() {
 		return metadata;
 	}
 
+	/**
+	 * setApplicationMetadata<p>
+	 * Set the application metadata
+	 * 
+	 * @param metadata
+	 */
 	@JsonProperty("metadata")
 	public void setApplicationMetadata(Set<ApplicationMetadata> metadata) {
 		this.metadata = metadata;
 	}
 
+	/**
+	 * getLicenseFilename<p>
+	 * Get the license file name
+	 * 
+	 * @return licenseFilename
+	 */
 	public String getLicenseFilename() {
 		return licenseFilename;
 	}
 
+	/**
+	 * setLicenseFilename<p>
+	 * Set the license file name
+	 * 
+	 * @param licenseFilename
+	 */
 	public void setLicenseFilename(String licenseFilename) {
 		this.licenseFilename = licenseFilename;
 	}
 
+	/**
+	 * getLicenseTypes<p>
+	 * Get the license types
+	 * 
+	 * @return licenseTypes
+	 */
 	public Set<LicenseType> getLicenseTypes() {
 		LOG.info("Getting list license types!!!!");
 		return licenseTypes;
 	}
 
+	/**
+	 * setLicenseTypes<p>
+	 * Set the license types
+	 * 
+	 * @param licenseTypes
+	 */
 	public void setLicenseTypes(Set<LicenseType> licenseTypes) {
 		this.licenseTypes = licenseTypes;
 	}
 
+	/**
+	 * getCode<p>
+	 * Get the application code
+	 * 
+	 * @return code
+	 */
 	public String getCode() {
 		return code;
 	}
 
+	/**
+	 * setCode<p>
+	 * Set the application code
+	 * 
+	 * @param code
+	 */
 	public void setCode(String code) {
 		this.code = code;
 	}
 
+	/**
+	 * equals<p>
+	 * Compares the current object with the given object
+	 * 
+	 * @param object
+	 * @return isEquals
+	 */
 	@Override
 	public boolean equals(Object obj) {
 		if (!(obj instanceof Application))
@@ -155,6 +306,12 @@
 		return id.equals(other.id);
 	}
 
+	/**
+	 * hashCode<p>
+	 * Get the object hashCode
+	 * 
+	 * @param hashCode
+	 */
 	@Override
 	public int hashCode() {
 

--
Gitblit v1.3.2