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.quadrige2.core.dao.administration.program;
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 fr.ifremer.quadrige2.core.dao.referential.monitoringLocation.MonitoringLocation;
30  import java.io.Serializable;
31  import java.sql.Timestamp;
32  
33  /**
34   * Liste des lieux surveillés par un programme.
35   */
36  // HibernateEntity.vsl annotations merge-point
37  public abstract class MonLocProg
38      implements Serializable, Comparable<MonLocProg>
39  {
40      /**
41       * The serial version UID of this class. Needed for serialization.
42       */
43      private static final long serialVersionUID = 338046219447421036L;
44  
45      // Generate 2 attributes
46      private Integer monLocProgId;
47  
48      /**
49       * 
50       * @return this.monLocProgId Integer
51       */
52      public Integer getMonLocProgId()
53      {
54          return this.monLocProgId;
55      }
56  
57      /**
58       * 
59       * @param monLocProgIdIn Integer
60       */
61      public void setMonLocProgId(Integer monLocProgIdIn)
62      {
63          this.monLocProgId = monLocProgIdIn;
64      }
65  
66      private Timestamp updateDt;
67  
68      /**
69       * Date de modification de l'objet, mise à jour par le système
70       * @return this.updateDt Timestamp
71       */
72      public Timestamp getUpdateDt()
73      {
74          return this.updateDt;
75      }
76  
77      /**
78       * Date de modification de l'objet, mise à jour par le système
79       * @param updateDtIn Timestamp
80       */
81      public void setUpdateDt(Timestamp updateDtIn)
82      {
83          this.updateDt = updateDtIn;
84      }
85  
86      // Generate 3 associations
87      private Program program;
88  
89      /**
90       * Activités à l'origine de la collecte d'un ensemble cohérent de données.
91       * @return this.program Program
92       */
93      public Program getProgram()
94      {
95          return this.program;
96      }
97  
98      /**
99       * Activités à l'origine de la collecte d'un ensemble cohérent de données.
100      * @param programIn Program
101      */
102     public void setProgram(Program programIn)
103     {
104         this.program = programIn;
105     }
106 
107     private MonitoringLocation monitoringLocation;
108 
109     /**
110      * Liste les lieux associés aux programmes de surveillance.
111      * @return this.monitoringLocation MonitoringLocation
112      */
113     public MonitoringLocation getMonitoringLocation()
114     {
115         return this.monitoringLocation;
116     }
117 
118     /**
119      * Liste les lieux associés aux programmes de surveillance.
120      * @param monitoringLocationIn MonitoringLocation
121      */
122     public void setMonitoringLocation(MonitoringLocation monitoringLocationIn)
123     {
124         this.monitoringLocation = monitoringLocationIn;
125     }
126 
127     /**
128      * Returns <code>true</code> if the argument is an MonLocProg instance and all identifiers for this entity
129      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
130      */
131     @Override
132     public boolean equals(Object object)
133     {
134         if (this == object)
135         {
136             return true;
137         }
138         if (!(object instanceof MonLocProg))
139         {
140             return false;
141         }
142         final MonLocProg that = (MonLocProg)object;
143         if (this.monLocProgId == null || that.getMonLocProgId() == null || !this.monLocProgId.equals(that.getMonLocProgId()))
144         {
145             return false;
146         }
147         return true;
148     }
149 
150     /**
151      * Returns a hash code based on this entity's identifiers.
152      */
153     @Override
154     public int hashCode()
155     {
156         int hashCode = 0;
157         hashCode = 29 * hashCode + (this.monLocProgId == null ? 0 : this.monLocProgId.hashCode());
158 
159         return hashCode;
160     }
161 
162     /**
163      * Constructs new instances of {@link MonLocProg}.
164      */
165     public static final class Factory
166     {
167         /**
168          * Constructs a new instance of {@link MonLocProg}.
169          * @return new MonLocProgImpl()
170          */
171         public static MonLocProg newInstance()
172         {
173             return new MonLocProgImpl();
174         }
175 
176 
177         /**
178          * Constructs a new instance of {@link MonLocProg}, taking all possible properties
179          * (except the identifier(s))as arguments.
180          * @param updateDt Timestamp
181          * @param program Program
182          * @param monitoringLocation MonitoringLocation
183          * @return newInstance MonLocProg
184          */
185         public static MonLocProg newInstance(Timestamp updateDt, Program program, MonitoringLocation monitoringLocation)
186         {
187             final MonLocProg entity = new MonLocProgImpl();
188             entity.setUpdateDt(updateDt);
189             entity.setProgram(program);
190             entity.setMonitoringLocation(monitoringLocation);
191             return entity;
192         }
193     }
194 
195     /**
196      * @see Comparable#compareTo
197      */
198     public int compareTo(MonLocProg o)
199     {
200         int cmp = 0;
201         if (this.getMonLocProgId() != null)
202         {
203             cmp = this.getMonLocProgId().compareTo(o.getMonLocProgId());
204         }
205         else
206         {
207             if (this.getUpdateDt() != null)
208             {
209                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
210             }
211         }
212         return cmp;
213     }
214 // HibernateEntity.vsl merge-point
215 // MonLocProg.java merge-point
216 }