Joaquín Reñé
2025-10-07 146a0fb8b0e90f9196e569152f649baf60d6cc8f
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
/*
* Copyright @ 2013 CurisTEC, S.A.S. All Rights Reserved.
*/
package net.curisit.securis.db;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import net.curisit.securis.db.common.ModificationTimestampEntity;
import net.curisit.securis.db.listeners.ModificationTimestampListener;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import com.fasterxml.jackson.annotation.JsonProperty;
/**
* Settings
* <p>
* Simple key/value store with last modification timestamp.
* Table rows have columns: "key", "value", "modification_timestamp".
*
* Mapping details:
* - Table: settings
* - Listeners: {@link ModificationTimestampListener}
* - NamedQuery: get-param by key
* @author JRA
* Last reviewed by JRA on Oct 5, 2025.
*/
@Entity
@EntityListeners({ ModificationTimestampListener.class })
@Table(name = "settings")
@NamedQueries({
    @NamedQuery(name = "get-param", query = "SELECT p FROM Settings p where p.key = :key")
})
public class Settings implements ModificationTimestampEntity, Serializable {
    @SuppressWarnings("unused")
    private static final Logger LOG = LogManager.getLogger(Settings.class);
    private static final long serialVersionUID = 1L;
    /** Primary key: setting key. */
    @Id
    String key;
    /** Setting value as string. */
    String value;
    /** Last modification timestamp. */
    @Column(name = "modification_timestamp")
    @JsonProperty("modification_timestamp")
    private Date modificationTimestamp;
    // -------- Getters/setters --------
    /** 
     * getKey<p>
     * Return setting key. 
     * 
     * @return key
     */
    public String getKey() { return key; }
    /** 
     * setKey<p>
     * Set setting key.
     * 
     * @param key
     */
    public void setKey(String key) { this.key = key; }
    /** 
     * getValue<p>
     * Return value.
     * 
     * @return value
     */
    public String getValue() { return value; }
    /** 
     * setValue<p>
     * Set value. 
     * 
     * @param value
     */
    public void setValue(String value) { this.value = value; }
    /** 
     * getModificationTimestamp<p>
     * Required by ModificationTimestampEntity. 
     * 
     * @return modificationTimestamp
     */
    @Override
    public Date getModificationTimestamp() { return modificationTimestamp; }
    /** 
     * setModificationTimestamp<p>
     * Required by ModificationTimestampEntity. 
     * 
     * @param modificationTimestamp
     */
    @Override
    public void setModificationTimestamp(Date modificationTimestamp) { this.modificationTimestamp = modificationTimestamp; }
    /**
     * toString<p>
     * Get the string describing the current object
     * 
     * @return object string
     */
    @Override
    public String toString() { return String.format("{key: %s, value: %s, ts: %s}", key, value, modificationTimestamp); }
}