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.system;
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.administration.user.Department;
29  import fr.ifremer.quadrige3.core.dao.administration.user.Quser;
30  import java.io.Serializable;
31  import java.sql.Timestamp;
32  
33  /**
34   * Projet cartographique
35   */
36  // HibernateEntity.vsl annotations merge-point
37  public abstract class MapProject
38      implements Serializable, Comparable<MapProject>
39  {
40      /**
41       * The serial version UID of this class. Needed for serialization.
42       */
43      private static final long serialVersionUID = -6142234822980131325L;
44  
45      // Generate 4 attributes
46      private Integer mapProjectId;
47  
48      /**
49       * Identifiant du projet cartographique
50       * @return this.mapProjectId Integer
51       */
52      public Integer getMapProjectId()
53      {
54          return this.mapProjectId;
55      }
56  
57      /**
58       * Identifiant du projet cartographique
59       * @param mapProjectIdIn Integer
60       */
61      public void setMapProjectId(Integer mapProjectIdIn)
62      {
63          this.mapProjectId = mapProjectIdIn;
64      }
65  
66      private String mapProjectNm;
67  
68      /**
69       * Libellé du projet
70       * @return this.mapProjectNm String
71       */
72      public String getMapProjectNm()
73      {
74          return this.mapProjectNm;
75      }
76  
77      /**
78       * Libellé du projet
79       * @param mapProjectNmIn String
80       */
81      public void setMapProjectNm(String mapProjectNmIn)
82      {
83          this.mapProjectNm = mapProjectNmIn;
84      }
85  
86      private String mapProjetConfig;
87  
88      /**
89       * Contenu du projet cartographique
90       * @return this.mapProjetConfig String
91       */
92      public String getMapProjetConfig()
93      {
94          return this.mapProjetConfig;
95      }
96  
97      /**
98       * Contenu du projet cartographique
99       * @param mapProjetConfigIn String
100      */
101     public void setMapProjetConfig(String mapProjetConfigIn)
102     {
103         this.mapProjetConfig = mapProjetConfigIn;
104     }
105 
106     private Timestamp updateDt;
107 
108     /**
109      * Date de mise à jour
110      * @return this.updateDt Timestamp
111      */
112     public Timestamp getUpdateDt()
113     {
114         return this.updateDt;
115     }
116 
117     /**
118      * Date de mise à jour
119      * @param updateDtIn Timestamp
120      */
121     public void setUpdateDt(Timestamp updateDtIn)
122     {
123         this.updateDt = updateDtIn;
124     }
125 
126     // Generate 3 associations
127     private Department depId;
128 
129     /**
130      * Liste les départements ou services auxquels sont rattachés les agents
131      * @return this.depId Department
132      */
133     public Department getDepId()
134     {
135         return this.depId;
136     }
137 
138     /**
139      * Liste les départements ou services auxquels sont rattachés les agents
140      * @param depIdIn Department
141      */
142     public void setDepId(Department depIdIn)
143     {
144         this.depId = depIdIn;
145     }
146 
147     private Quser quserId;
148 
149     /**
150      * Liste l'ensemble des agents et utilisateurs du système.
151      * @return this.quserId Quser
152      */
153     public Quser getQuserId()
154     {
155         return this.quserId;
156     }
157 
158     /**
159      * Liste l'ensemble des agents et utilisateurs du système.
160      * @param quserIdIn Quser
161      */
162     public void setQuserId(Quser quserIdIn)
163     {
164         this.quserId = quserIdIn;
165     }
166 
167     /**
168      * Returns <code>true</code> if the argument is an MapProject instance and all identifiers for this entity
169      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
170      */
171     @Override
172     public boolean equals(Object object)
173     {
174         if (this == object)
175         {
176             return true;
177         }
178         if (!(object instanceof MapProject))
179         {
180             return false;
181         }
182         final MapProject that = (MapProject)object;
183         if (this.mapProjectId == null || that.getMapProjectId() == null || !this.mapProjectId.equals(that.getMapProjectId()))
184         {
185             return false;
186         }
187         return true;
188     }
189 
190     /**
191      * Returns a hash code based on this entity's identifiers.
192      */
193     @Override
194     public int hashCode()
195     {
196         int hashCode = 0;
197         hashCode = 29 * hashCode + (this.mapProjectId == null ? 0 : this.mapProjectId.hashCode());
198 
199         return hashCode;
200     }
201 
202     /**
203      * Constructs new instances of {@link MapProject}.
204      */
205     public static final class Factory
206     {
207         /**
208          * Constructs a new instance of {@link MapProject}.
209          * @return new MapProjectImpl()
210          */
211         public static MapProject newInstance()
212         {
213             return new MapProjectImpl();
214         }
215 
216         /**
217          * Constructs a new instance of {@link MapProject}, taking all required and/or
218          * read-only properties as arguments, except for identifiers.
219          * @param mapProjectNm String
220          * @param quserId Quser
221          * @return newInstance
222          */
223         public static MapProject newInstance(String mapProjectNm, Quser quserId)
224         {
225             final MapProject entity = new MapProjectImpl();
226             entity.setMapProjectNm(mapProjectNm);
227             entity.setQuserId(quserId);
228             return entity;
229         }
230 
231         /**
232          * Constructs a new instance of {@link MapProject}, taking all possible properties
233          * (except the identifier(s))as arguments.
234          * @param mapProjectNm String
235          * @param mapProjetConfig String
236          * @param updateDt Timestamp
237          * @param depId Department
238          * @param quserId Quser
239          * @return newInstance MapProject
240          */
241         public static MapProject newInstance(String mapProjectNm, String mapProjetConfig, Timestamp updateDt, Department depId, Quser quserId)
242         {
243             final MapProject entity = new MapProjectImpl();
244             entity.setMapProjectNm(mapProjectNm);
245             entity.setMapProjetConfig(mapProjetConfig);
246             entity.setUpdateDt(updateDt);
247             entity.setDepId(depId);
248             entity.setQuserId(quserId);
249             return entity;
250         }
251     }
252 
253     /**
254      * @see Comparable#compareTo
255      */
256     public int compareTo(MapProject o)
257     {
258         int cmp = 0;
259         if (this.getMapProjectId() != null)
260         {
261             cmp = this.getMapProjectId().compareTo(o.getMapProjectId());
262         }
263         else
264         {
265             if (this.getMapProjectNm() != null)
266             {
267                 cmp = (cmp != 0 ? cmp : this.getMapProjectNm().compareTo(o.getMapProjectNm()));
268             }
269             if (this.getMapProjetConfig() != null)
270             {
271                 cmp = (cmp != 0 ? cmp : this.getMapProjetConfig().compareTo(o.getMapProjetConfig()));
272             }
273             if (this.getUpdateDt() != null)
274             {
275                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
276             }
277         }
278         return cmp;
279     }
280 // HibernateEntity.vsl merge-point
281 // MapProject.java merge-point
282 }