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 auxquels les prélèvements peuvent être effectués.
33   */
34  // HibernateEntity.vsl annotations merge-point
35  public abstract class DepthLevel
36      implements Serializable, Comparable<DepthLevel>
37  {
38      /**
39       * The serial version UID of this class. Needed for serialization.
40       */
41      private static final long serialVersionUID = 8248132632609809042L;
42  
43      // Generate 4 attributes
44      private Integer depthLevelId;
45  
46      /**
47       * Identifiant interne du niveau de prélèvement
48       * @return this.depthLevelId Integer
49       */
50      public Integer getDepthLevelId()
51      {
52          return this.depthLevelId;
53      }
54  
55      /**
56       * Identifiant interne du niveau de prélèvement
57       * @param depthLevelIdIn Integer
58       */
59      public void setDepthLevelId(Integer depthLevelIdIn)
60      {
61          this.depthLevelId = depthLevelIdIn;
62      }
63  
64      private String depthLevelNm;
65  
66      /**
67       * Libellé du niveau
68       * @return this.depthLevelNm String
69       */
70      public String getDepthLevelNm()
71      {
72          return this.depthLevelNm;
73      }
74  
75      /**
76       * Libellé du niveau
77       * @param depthLevelNmIn String
78       */
79      public void setDepthLevelNm(String depthLevelNmIn)
80      {
81          this.depthLevelNm = depthLevelNmIn;
82      }
83  
84      private String depthLevelDc;
85  
86      /**
87       * Description du niveau
88       * @return this.depthLevelDc String
89       */
90      public String getDepthLevelDc()
91      {
92          return this.depthLevelDc;
93      }
94  
95      /**
96       * Description du niveau
97       * @param depthLevelDcIn String
98       */
99      public void setDepthLevelDc(String depthLevelDcIn)
100     {
101         this.depthLevelDc = depthLevelDcIn;
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 3 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 DepthLevel 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 DepthLevel))
157         {
158             return false;
159         }
160         final DepthLevel that = (DepthLevel)object;
161         if (this.depthLevelId == null || that.getDepthLevelId() == null || !this.depthLevelId.equals(that.getDepthLevelId()))
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.depthLevelId == null ? 0 : this.depthLevelId.hashCode());
176 
177         return hashCode;
178     }
179 
180     /**
181      * Constructs new instances of {@link DepthLevel}.
182      */
183     public static final class Factory
184     {
185         /**
186          * Constructs a new instance of {@link DepthLevel}.
187          * @return new DepthLevelImpl()
188          */
189         public static DepthLevel newInstance()
190         {
191             return new DepthLevelImpl();
192         }
193 
194         /**
195          * Constructs a new instance of {@link DepthLevel}, taking all required and/or
196          * read-only properties as arguments, except for identifiers.
197          * @param depthLevelNm String
198          * @param status Status
199          * @return newInstance
200          */
201         public static DepthLevel newInstance(String depthLevelNm, Status status)
202         {
203             final DepthLevel entity = new DepthLevelImpl();
204             entity.setDepthLevelNm(depthLevelNm);
205             entity.setStatus(status);
206             return entity;
207         }
208 
209         /**
210          * Constructs a new instance of {@link DepthLevel}, taking all possible properties
211          * (except the identifier(s))as arguments.
212          * @param depthLevelNm String
213          * @param depthLevelDc String
214          * @param updateDt Timestamp
215          * @param status Status
216          * @return newInstance DepthLevel
217          */
218         public static DepthLevel newInstance(String depthLevelNm, String depthLevelDc, Timestamp updateDt, Status status)
219         {
220             final DepthLevel entity = new DepthLevelImpl();
221             entity.setDepthLevelNm(depthLevelNm);
222             entity.setDepthLevelDc(depthLevelDc);
223             entity.setUpdateDt(updateDt);
224             entity.setStatus(status);
225             return entity;
226         }
227     }
228 
229     /**
230      * @see Comparable#compareTo
231      */
232     public int compareTo(DepthLevel o)
233     {
234         int cmp = 0;
235         if (this.getDepthLevelId() != null)
236         {
237             cmp = this.getDepthLevelId().compareTo(o.getDepthLevelId());
238         }
239         else
240         {
241             if (this.getDepthLevelNm() != null)
242             {
243                 cmp = (cmp != 0 ? cmp : this.getDepthLevelNm().compareTo(o.getDepthLevelNm()));
244             }
245             if (this.getDepthLevelDc() != null)
246             {
247                 cmp = (cmp != 0 ? cmp : this.getDepthLevelDc().compareTo(o.getDepthLevelDc()));
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 // DepthLevel.java merge-point
258 }