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.referential;
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 java.io.Serializable;
29 import java.sql.Timestamp;
30
31 /**
32 * Liste les différents niveau de saisie des résultats (Passage, Prélèvement, échantillon).
33 */
34 // HibernateEntity.vsl annotations merge-point
35 public abstract class AcquisitionLevel
36 implements Serializable, Comparable<AcquisitionLevel>
37 {
38 /**
39 * The serial version UID of this class. Needed for serialization.
40 */
41 private static final long serialVersionUID = -327550891455996428L;
42
43 // Generate 3 attributes
44 private String acquisLevelCd;
45
46 /**
47 * Code du niveau de saisie
48 * @return this.acquisLevelCd String
49 */
50 public String getAcquisLevelCd()
51 {
52 return this.acquisLevelCd;
53 }
54
55 /**
56 * Code du niveau de saisie
57 * @param acquisLevelCdIn String
58 */
59 public void setAcquisLevelCd(String acquisLevelCdIn)
60 {
61 this.acquisLevelCd = acquisLevelCdIn;
62 }
63
64 private String acquisLevelNm;
65
66 /**
67 * Libellé du niveau de saisie
68 * @return this.acquisLevelNm String
69 */
70 public String getAcquisLevelNm()
71 {
72 return this.acquisLevelNm;
73 }
74
75 /**
76 * Libellé du niveau de saisie
77 * @param acquisLevelNmIn String
78 */
79 public void setAcquisLevelNm(String acquisLevelNmIn)
80 {
81 this.acquisLevelNm = acquisLevelNmIn;
82 }
83
84 private Timestamp updateDt;
85
86 /**
87 * Date de modification de l'objet, mise à jour par le système
88 * @return this.updateDt Timestamp
89 */
90 public Timestamp getUpdateDt()
91 {
92 return this.updateDt;
93 }
94
95 /**
96 * Date de modification de l'objet, mise à jour par le système
97 * @param updateDtIn Timestamp
98 */
99 public void setUpdateDt(Timestamp updateDtIn)
100 {
101 this.updateDt = updateDtIn;
102 }
103
104 // Generate 1 associations
105 /**
106 * Returns <code>true</code> if the argument is an AcquisitionLevel instance and all identifiers for this entity
107 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
108 */
109 @Override
110 public boolean equals(Object object)
111 {
112 if (this == object)
113 {
114 return true;
115 }
116 if (!(object instanceof AcquisitionLevel))
117 {
118 return false;
119 }
120 final AcquisitionLevel that = (AcquisitionLevel)object;
121 if (this.acquisLevelCd == null || that.getAcquisLevelCd() == null || !this.acquisLevelCd.equals(that.getAcquisLevelCd()))
122 {
123 return false;
124 }
125 return true;
126 }
127
128 /**
129 * Returns a hash code based on this entity's identifiers.
130 */
131 @Override
132 public int hashCode()
133 {
134 int hashCode = 0;
135 hashCode = 29 * hashCode + (this.acquisLevelCd == null ? 0 : this.acquisLevelCd.hashCode());
136
137 return hashCode;
138 }
139
140 /**
141 * Constructs new instances of {@link AcquisitionLevel}.
142 */
143 public static final class Factory
144 {
145 /**
146 * Constructs a new instance of {@link AcquisitionLevel}.
147 * @return new AcquisitionLevelImpl()
148 */
149 public static AcquisitionLevel newInstance()
150 {
151 return new AcquisitionLevelImpl();
152 }
153
154 /**
155 * Constructs a new instance of {@link AcquisitionLevel}, taking all required and/or
156 * read-only properties as arguments, except for identifiers.
157 * @param acquisLevelNm String
158 * @return newInstance
159 */
160 public static AcquisitionLevel newInstance(String acquisLevelNm)
161 {
162 final AcquisitionLevel entity = new AcquisitionLevelImpl();
163 entity.setAcquisLevelNm(acquisLevelNm);
164 return entity;
165 }
166
167 /**
168 * Constructs a new instance of {@link AcquisitionLevel}, taking all possible properties
169 * (except the identifier(s))as arguments.
170 * @param acquisLevelNm String
171 * @param updateDt Timestamp
172 * @return newInstance AcquisitionLevel
173 */
174 public static AcquisitionLevel newInstance(String acquisLevelNm, Timestamp updateDt)
175 {
176 final AcquisitionLevel entity = new AcquisitionLevelImpl();
177 entity.setAcquisLevelNm(acquisLevelNm);
178 entity.setUpdateDt(updateDt);
179 return entity;
180 }
181 }
182
183 /**
184 * @see Comparable#compareTo
185 */
186 public int compareTo(AcquisitionLevel o)
187 {
188 int cmp = 0;
189 if (this.getAcquisLevelCd() != null)
190 {
191 cmp = this.getAcquisLevelCd().compareTo(o.getAcquisLevelCd());
192 }
193 else
194 {
195 if (this.getAcquisLevelNm() != null)
196 {
197 cmp = (cmp != 0 ? cmp : this.getAcquisLevelNm().compareTo(o.getAcquisLevelNm()));
198 }
199 if (this.getUpdateDt() != null)
200 {
201 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
202 }
203 }
204 return cmp;
205 }
206 // HibernateEntity.vsl merge-point
207 // AcquisitionLevel.java merge-point
208 }