1 // license-header java merge-point
2 //
3 // Attention: Generated code! Do not modify by hand!
4 // Generated by: hibernate/HibernateEntity.vsl in andromda-hibernate-cartridge.
5 //
6 package fr.ifremer.quadrige3.core.dao.administration.strategy;
7
8 /*-
9 * #%L
10 * Quadrige3 Core :: Client API
11 * %%
12 * Copyright (C) 2017 - 2024 Ifremer
13 * %%
14 * This program is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Affero General Public License as published by
16 * the Free Software Foundation, either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU Affero General Public License
25 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 * #L%
27 */
28 import fr.ifremer.quadrige3.core.dao.referential.Status;
29 import java.io.Serializable;
30 import java.sql.Timestamp;
31
32 /**
33 * Fonction de calcul affichées lors de la saisie en mode colonne.
34 * Permet de fournir un calcul sur une série de mesure.
35 * Ces calculs ne sont pas stockés et sont là uniquement pour un contrôle lors de la saisie
36 */
37 // HibernateEntity.vsl annotations merge-point
38 public abstract class UiFunction
39 implements Serializable, Comparable<UiFunction>
40 {
41 /**
42 * The serial version UID of this class. Needed for serialization.
43 */
44 private static final long serialVersionUID = -9193921057398452432L;
45
46 // Generate 3 attributes
47 private String uiFunctionCd;
48
49 /**
50 * Code de la fonction de calcul
51 * @return this.uiFunctionCd String
52 */
53 public String getUiFunctionCd()
54 {
55 return this.uiFunctionCd;
56 }
57
58 /**
59 * Code de la fonction de calcul
60 * @param uiFunctionCdIn String
61 */
62 public void setUiFunctionCd(String uiFunctionCdIn)
63 {
64 this.uiFunctionCd = uiFunctionCdIn;
65 }
66
67 private String uiFunctionNm;
68
69 /**
70 * Libellé de la fonction de calcul
71 * @return this.uiFunctionNm String
72 */
73 public String getUiFunctionNm()
74 {
75 return this.uiFunctionNm;
76 }
77
78 /**
79 * Libellé de la fonction de calcul
80 * @param uiFunctionNmIn String
81 */
82 public void setUiFunctionNm(String uiFunctionNmIn)
83 {
84 this.uiFunctionNm = uiFunctionNmIn;
85 }
86
87 private Timestamp updateDt;
88
89 /**
90 * Date de modification de l'objet, mise à jour par le système
91 * @return this.updateDt Timestamp
92 */
93 public Timestamp getUpdateDt()
94 {
95 return this.updateDt;
96 }
97
98 /**
99 * Date de modification de l'objet, mise à jour par le système
100 * @param updateDtIn Timestamp
101 */
102 public void setUpdateDt(Timestamp updateDtIn)
103 {
104 this.updateDt = updateDtIn;
105 }
106
107 // Generate 2 associations
108 private Status status;
109
110 /**
111 * Liste des états possibles d'un objet.
112 * @return this.status Status
113 */
114 public Status getStatus()
115 {
116 return this.status;
117 }
118
119 /**
120 * Liste des états possibles d'un objet.
121 * @param statusIn Status
122 */
123 public void setStatus(Status statusIn)
124 {
125 this.status = statusIn;
126 }
127
128 /**
129 * Returns <code>true</code> if the argument is an UiFunction instance and all identifiers for this entity
130 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
131 */
132 @Override
133 public boolean equals(Object object)
134 {
135 if (this == object)
136 {
137 return true;
138 }
139 if (!(object instanceof UiFunction))
140 {
141 return false;
142 }
143 final UiFunction that = (UiFunction)object;
144 if (this.uiFunctionCd == null || that.getUiFunctionCd() == null || !this.uiFunctionCd.equals(that.getUiFunctionCd()))
145 {
146 return false;
147 }
148 return true;
149 }
150
151 /**
152 * Returns a hash code based on this entity's identifiers.
153 */
154 @Override
155 public int hashCode()
156 {
157 int hashCode = 0;
158 hashCode = 29 * hashCode + (this.uiFunctionCd == null ? 0 : this.uiFunctionCd.hashCode());
159
160 return hashCode;
161 }
162
163 /**
164 * Constructs new instances of {@link UiFunction}.
165 */
166 public static final class Factory
167 {
168 /**
169 * Constructs a new instance of {@link UiFunction}.
170 * @return new UiFunctionImpl()
171 */
172 public static UiFunction newInstance()
173 {
174 return new UiFunctionImpl();
175 }
176
177 /**
178 * Constructs a new instance of {@link UiFunction}, taking all required and/or
179 * read-only properties as arguments, except for identifiers.
180 * @param uiFunctionNm String
181 * @param status Status
182 * @return newInstance
183 */
184 public static UiFunction newInstance(String uiFunctionNm, Status status)
185 {
186 final UiFunction entity = new UiFunctionImpl();
187 entity.setUiFunctionNm(uiFunctionNm);
188 entity.setStatus(status);
189 return entity;
190 }
191
192 /**
193 * Constructs a new instance of {@link UiFunction}, taking all possible properties
194 * (except the identifier(s))as arguments.
195 * @param uiFunctionNm String
196 * @param updateDt Timestamp
197 * @param status Status
198 * @return newInstance UiFunction
199 */
200 public static UiFunction newInstance(String uiFunctionNm, Timestamp updateDt, Status status)
201 {
202 final UiFunction entity = new UiFunctionImpl();
203 entity.setUiFunctionNm(uiFunctionNm);
204 entity.setUpdateDt(updateDt);
205 entity.setStatus(status);
206 return entity;
207 }
208 }
209
210 /**
211 * @see Comparable#compareTo
212 */
213 public int compareTo(UiFunction o)
214 {
215 int cmp = 0;
216 if (this.getUiFunctionCd() != null)
217 {
218 cmp = this.getUiFunctionCd().compareTo(o.getUiFunctionCd());
219 }
220 else
221 {
222 if (this.getUiFunctionNm() != null)
223 {
224 cmp = (cmp != 0 ? cmp : this.getUiFunctionNm().compareTo(o.getUiFunctionNm()));
225 }
226 if (this.getUpdateDt() != null)
227 {
228 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
229 }
230 }
231 return cmp;
232 }
233 // HibernateEntity.vsl merge-point
234 // UiFunction.java merge-point
235 }