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.quadrige2.core.dao.system;
7
8 /*-
9 * #%L
10 * Quadrige2 Core :: Server API
11 * %%
12 * Copyright (C) 2017 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
29 import java.io.Serializable;
30 import java.sql.Timestamp;
31
32 /**
33 * Table listant les systèmes d'exploitation qui sont compatibles avec l'applicatif Quadrige²
34 */
35 // HibernateEntity.vsl annotations merge-point
36 public abstract class CompliantOs
37 implements Serializable, Comparable<CompliantOs>
38 {
39 /**
40 * The serial version UID of this class. Needed for serialization.
41 */
42 private static final long serialVersionUID = -8180059064847543628L;
43
44 // Generate 3 attributes
45 private String compliantOsCd;
46
47 /**
48 * Code du système d'exploitation compatible (concaténation nom de l'OS + la version).
49 * @return this.compliantOsCd String
50 */
51 public String getCompliantOsCd()
52 {
53 return this.compliantOsCd;
54 }
55
56 /**
57 * Code du système d'exploitation compatible (concaténation nom de l'OS + la version).
58 * @param compliantOsCdIn String
59 */
60 public void setCompliantOsCd(String compliantOsCdIn)
61 {
62 this.compliantOsCd = compliantOsCdIn;
63 }
64
65 private String compliantOsNm;
66
67 /**
68 * Libellé du système d'exploitation compatible.
69 * @return this.compliantOsNm String
70 */
71 public String getCompliantOsNm()
72 {
73 return this.compliantOsNm;
74 }
75
76 /**
77 * Libellé du système d'exploitation compatible.
78 * @param compliantOsNmIn String
79 */
80 public void setCompliantOsNm(String compliantOsNmIn)
81 {
82 this.compliantOsNm = compliantOsNmIn;
83 }
84
85 private Timestamp updateDt;
86
87 /**
88 *
89 * @return this.updateDt Timestamp
90 */
91 public Timestamp getUpdateDt()
92 {
93 return this.updateDt;
94 }
95
96 /**
97 *
98 * @param updateDtIn Timestamp
99 */
100 public void setUpdateDt(Timestamp updateDtIn)
101 {
102 this.updateDt = updateDtIn;
103 }
104
105 // Generate 0 associations
106 /**
107 * Returns <code>true</code> if the argument is an CompliantOs instance and all identifiers for this entity
108 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
109 */
110 @Override
111 public boolean equals(Object object)
112 {
113 if (this == object)
114 {
115 return true;
116 }
117 if (!(object instanceof CompliantOs))
118 {
119 return false;
120 }
121 final CompliantOs that = (CompliantOs)object;
122 if (this.compliantOsCd == null || that.getCompliantOsCd() == null || !this.compliantOsCd.equals(that.getCompliantOsCd()))
123 {
124 return false;
125 }
126 return true;
127 }
128
129 /**
130 * Returns a hash code based on this entity's identifiers.
131 */
132 @Override
133 public int hashCode()
134 {
135 int hashCode = 0;
136 hashCode = 29 * hashCode + (this.compliantOsCd == null ? 0 : this.compliantOsCd.hashCode());
137
138 return hashCode;
139 }
140
141 /**
142 * Constructs new instances of {@link CompliantOs}.
143 */
144 public static final class Factory
145 {
146 /**
147 * Constructs a new instance of {@link CompliantOs}.
148 * @return new CompliantOsImpl()
149 */
150 public static CompliantOs newInstance()
151 {
152 return new CompliantOsImpl();
153 }
154
155
156 /**
157 * Constructs a new instance of {@link CompliantOs}, taking all possible properties
158 * (except the identifier(s))as arguments.
159 * @param compliantOsNm String
160 * @param updateDt Timestamp
161 * @return newInstance CompliantOs
162 */
163 public static CompliantOs newInstance(String compliantOsNm, Timestamp updateDt)
164 {
165 final CompliantOs entity = new CompliantOsImpl();
166 entity.setCompliantOsNm(compliantOsNm);
167 entity.setUpdateDt(updateDt);
168 return entity;
169 }
170 }
171
172 /**
173 * @see Comparable#compareTo
174 */
175 public int compareTo(CompliantOs o)
176 {
177 int cmp = 0;
178 if (this.getCompliantOsCd() != null)
179 {
180 cmp = this.getCompliantOsCd().compareTo(o.getCompliantOsCd());
181 }
182 else
183 {
184 if (this.getCompliantOsNm() != null)
185 {
186 cmp = (cmp != 0 ? cmp : this.getCompliantOsNm().compareTo(o.getCompliantOsNm()));
187 }
188 if (this.getUpdateDt() != null)
189 {
190 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
191 }
192 }
193 return cmp;
194 }
195 // HibernateEntity.vsl merge-point
196 // CompliantOs.java merge-point
197 }