View Javadoc
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 des niveaux de qualification.
33   */
34  // HibernateEntity.vsl annotations merge-point
35  public abstract class QualityFlag
36      implements Serializable, Comparable<QualityFlag>
37  {
38      /**
39       * The serial version UID of this class. Needed for serialization.
40       */
41      private static final long serialVersionUID = 1683091495343672195L;
42  
43      // Generate 4 attributes
44      private String qualFlagCd;
45  
46      /**
47       * Code identifiant le niveau de qualification (0,1,2, 3,4).
48       * @return this.qualFlagCd String
49       */
50      public String getQualFlagCd()
51      {
52          return this.qualFlagCd;
53      }
54  
55      /**
56       * Code identifiant le niveau de qualification (0,1,2, 3,4).
57       * @param qualFlagCdIn String
58       */
59      public void setQualFlagCd(String qualFlagCdIn)
60      {
61          this.qualFlagCd = qualFlagCdIn;
62      }
63  
64      private String qualFlagNm;
65  
66      /**
67       * Libellé du niveau de qualification
68       * @return this.qualFlagNm String
69       */
70      public String getQualFlagNm()
71      {
72          return this.qualFlagNm;
73      }
74  
75      /**
76       * Libellé du niveau de qualification
77       * @param qualFlagNmIn String
78       */
79      public void setQualFlagNm(String qualFlagNmIn)
80      {
81          this.qualFlagNm = qualFlagNmIn;
82      }
83  
84      private String qualFlagDc;
85  
86      /**
87       * Description optionnelle de la qualification
88       * @return this.qualFlagDc String
89       */
90      public String getQualFlagDc()
91      {
92          return this.qualFlagDc;
93      }
94  
95      /**
96       * Description optionnelle de la qualification
97       * @param qualFlagDcIn String
98       */
99      public void setQualFlagDc(String qualFlagDcIn)
100     {
101         this.qualFlagDc = qualFlagDcIn;
102     }
103 
104     private Timestamp updateDt;
105 
106     /**
107      * Date de modification de l'objet, mise à jour par le système
108      * @return this.updateDt Timestamp
109      */
110     public Timestamp getUpdateDt()
111     {
112         return this.updateDt;
113     }
114 
115     /**
116      * Date de modification de l'objet, mise à jour par le système
117      * @param updateDtIn Timestamp
118      */
119     public void setUpdateDt(Timestamp updateDtIn)
120     {
121         this.updateDt = updateDtIn;
122     }
123 
124     // Generate 15 associations
125     private Status status;
126 
127     /**
128      * Liste des états possibles d'un objet.
129      * @return this.status Status
130      */
131     public Status getStatus()
132     {
133         return this.status;
134     }
135 
136     /**
137      * Liste des états possibles d'un objet.
138      * @param statusIn Status
139      */
140     public void setStatus(Status statusIn)
141     {
142         this.status = statusIn;
143     }
144 
145     /**
146      * Returns <code>true</code> if the argument is an QualityFlag instance and all identifiers for this entity
147      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
148      */
149     @Override
150     public boolean equals(Object object)
151     {
152         if (this == object)
153         {
154             return true;
155         }
156         if (!(object instanceof QualityFlag))
157         {
158             return false;
159         }
160         final QualityFlag that = (QualityFlag)object;
161         if (this.qualFlagCd == null || that.getQualFlagCd() == null || !this.qualFlagCd.equals(that.getQualFlagCd()))
162         {
163             return false;
164         }
165         return true;
166     }
167 
168     /**
169      * Returns a hash code based on this entity's identifiers.
170      */
171     @Override
172     public int hashCode()
173     {
174         int hashCode = 0;
175         hashCode = 29 * hashCode + (this.qualFlagCd == null ? 0 : this.qualFlagCd.hashCode());
176 
177         return hashCode;
178     }
179 
180     /**
181      * Constructs new instances of {@link QualityFlag}.
182      */
183     public static final class Factory
184     {
185         /**
186          * Constructs a new instance of {@link QualityFlag}.
187          * @return new QualityFlagImpl()
188          */
189         public static QualityFlag newInstance()
190         {
191             return new QualityFlagImpl();
192         }
193 
194         /**
195          * Constructs a new instance of {@link QualityFlag}, taking all required and/or
196          * read-only properties as arguments, except for identifiers.
197          * @param qualFlagNm String
198          * @param status Status
199          * @return newInstance
200          */
201         public static QualityFlag newInstance(String qualFlagNm, Status status)
202         {
203             final QualityFlag entity = new QualityFlagImpl();
204             entity.setQualFlagNm(qualFlagNm);
205             entity.setStatus(status);
206             return entity;
207         }
208 
209         /**
210          * Constructs a new instance of {@link QualityFlag}, taking all possible properties
211          * (except the identifier(s))as arguments.
212          * @param qualFlagNm String
213          * @param qualFlagDc String
214          * @param updateDt Timestamp
215          * @param status Status
216          * @return newInstance QualityFlag
217          */
218         public static QualityFlag newInstance(String qualFlagNm, String qualFlagDc, Timestamp updateDt, Status status)
219         {
220             final QualityFlag entity = new QualityFlagImpl();
221             entity.setQualFlagNm(qualFlagNm);
222             entity.setQualFlagDc(qualFlagDc);
223             entity.setUpdateDt(updateDt);
224             entity.setStatus(status);
225             return entity;
226         }
227     }
228 
229     /**
230      * @see Comparable#compareTo
231      */
232     public int compareTo(QualityFlag o)
233     {
234         int cmp = 0;
235         if (this.getQualFlagCd() != null)
236         {
237             cmp = this.getQualFlagCd().compareTo(o.getQualFlagCd());
238         }
239         else
240         {
241             if (this.getQualFlagNm() != null)
242             {
243                 cmp = (cmp != 0 ? cmp : this.getQualFlagNm().compareTo(o.getQualFlagNm()));
244             }
245             if (this.getQualFlagDc() != null)
246             {
247                 cmp = (cmp != 0 ? cmp : this.getQualFlagDc().compareTo(o.getQualFlagDc()));
248             }
249             if (this.getUpdateDt() != null)
250             {
251                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
252             }
253         }
254         return cmp;
255     }
256 // HibernateEntity.vsl merge-point
257 // QualityFlag.java merge-point
258 }