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.sandre;
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.SamplingEquipment;
30  import java.io.Serializable;
31  
32  /**
33   * Engins de prélèvement SANDRE pour les exports de données
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class SandreSamplingEquipmentExp
37      implements Serializable, Comparable<SandreSamplingEquipmentExp>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = -1923451513842055895L;
43  
44      // Generate 3 attributes
45      private Integer sandreSamplingEquipmentId;
46  
47      /**
48       * Identifiant de l'engin sandre
49       * @return this.sandreSamplingEquipmentId Integer
50       */
51      public Integer getSandreSamplingEquipmentId()
52      {
53          return this.sandreSamplingEquipmentId;
54      }
55  
56      /**
57       * Identifiant de l'engin sandre
58       * @param sandreSamplingEquipmentIdIn Integer
59       */
60      public void setSandreSamplingEquipmentId(Integer sandreSamplingEquipmentIdIn)
61      {
62          this.sandreSamplingEquipmentId = sandreSamplingEquipmentIdIn;
63      }
64  
65      private String sandreSamplingEquipmentLb;
66  
67      /**
68       * Libellé de l'engin sandre
69       * @return this.sandreSamplingEquipmentLb String
70       */
71      public String getSandreSamplingEquipmentLb()
72      {
73          return this.sandreSamplingEquipmentLb;
74      }
75  
76      /**
77       * Libellé de l'engin sandre
78       * @param sandreSamplingEquipmentLbIn String
79       */
80      public void setSandreSamplingEquipmentLb(String sandreSamplingEquipmentLbIn)
81      {
82          this.sandreSamplingEquipmentLb = sandreSamplingEquipmentLbIn;
83      }
84  
85      private Integer sandreSamplingEquipmentExpId;
86  
87      /**
88       * 
89       * @return this.sandreSamplingEquipmentExpId Integer
90       */
91      public Integer getSandreSamplingEquipmentExpId()
92      {
93          return this.sandreSamplingEquipmentExpId;
94      }
95  
96      /**
97       * 
98       * @param sandreSamplingEquipmentExpIdIn Integer
99       */
100     public void setSandreSamplingEquipmentExpId(Integer sandreSamplingEquipmentExpIdIn)
101     {
102         this.sandreSamplingEquipmentExpId = sandreSamplingEquipmentExpIdIn;
103     }
104 
105     // Generate 1 associations
106     private SamplingEquipment samplingEquipmentId;
107 
108     /**
109      * Liste les engins de prélèvement (au sens marque/modèle et non numéro de série).
110      * @return this.samplingEquipmentId SamplingEquipment
111      */
112     public SamplingEquipment getSamplingEquipmentId()
113     {
114         return this.samplingEquipmentId;
115     }
116 
117     /**
118      * Liste les engins de prélèvement (au sens marque/modèle et non numéro de série).
119      * @param samplingEquipmentIdIn SamplingEquipment
120      */
121     public void setSamplingEquipmentId(SamplingEquipment samplingEquipmentIdIn)
122     {
123         this.samplingEquipmentId = samplingEquipmentIdIn;
124     }
125 
126     /**
127      * Returns <code>true</code> if the argument is an SandreSamplingEquipmentExp instance and all identifiers for this entity
128      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
129      */
130     @Override
131     public boolean equals(Object object)
132     {
133         if (this == object)
134         {
135             return true;
136         }
137         if (!(object instanceof SandreSamplingEquipmentExp))
138         {
139             return false;
140         }
141         final SandreSamplingEquipmentExp that = (SandreSamplingEquipmentExp)object;
142         if (this.sandreSamplingEquipmentExpId == null || that.getSandreSamplingEquipmentExpId() == null || !this.sandreSamplingEquipmentExpId.equals(that.getSandreSamplingEquipmentExpId()))
143         {
144             return false;
145         }
146         return true;
147     }
148 
149     /**
150      * Returns a hash code based on this entity's identifiers.
151      */
152     @Override
153     public int hashCode()
154     {
155         int hashCode = 0;
156         hashCode = 29 * hashCode + (this.sandreSamplingEquipmentExpId == null ? 0 : this.sandreSamplingEquipmentExpId.hashCode());
157 
158         return hashCode;
159     }
160 
161     /**
162      * Constructs new instances of {@link SandreSamplingEquipmentExp}.
163      */
164     public static final class Factory
165     {
166         /**
167          * Constructs a new instance of {@link SandreSamplingEquipmentExp}.
168          * @return new SandreSamplingEquipmentExpImpl()
169          */
170         public static SandreSamplingEquipmentExp newInstance()
171         {
172             return new SandreSamplingEquipmentExpImpl();
173         }
174 
175         /**
176          * Constructs a new instance of {@link SandreSamplingEquipmentExp}, taking all required and/or
177          * read-only properties as arguments, except for identifiers.
178          * @param sandreSamplingEquipmentId Integer
179          * @param samplingEquipmentId SamplingEquipment
180          * @return newInstance
181          */
182         public static SandreSamplingEquipmentExp newInstance(Integer sandreSamplingEquipmentId, SamplingEquipment samplingEquipmentId)
183         {
184             final SandreSamplingEquipmentExp entity = new SandreSamplingEquipmentExpImpl();
185             entity.setSandreSamplingEquipmentId(sandreSamplingEquipmentId);
186             entity.setSamplingEquipmentId(samplingEquipmentId);
187             return entity;
188         }
189 
190         /**
191          * Constructs a new instance of {@link SandreSamplingEquipmentExp}, taking all possible properties
192          * (except the identifier(s))as arguments.
193          * @param sandreSamplingEquipmentId Integer
194          * @param sandreSamplingEquipmentLb String
195          * @param samplingEquipmentId SamplingEquipment
196          * @return newInstance SandreSamplingEquipmentExp
197          */
198         public static SandreSamplingEquipmentExp newInstance(Integer sandreSamplingEquipmentId, String sandreSamplingEquipmentLb, SamplingEquipment samplingEquipmentId)
199         {
200             final SandreSamplingEquipmentExp entity = new SandreSamplingEquipmentExpImpl();
201             entity.setSandreSamplingEquipmentId(sandreSamplingEquipmentId);
202             entity.setSandreSamplingEquipmentLb(sandreSamplingEquipmentLb);
203             entity.setSamplingEquipmentId(samplingEquipmentId);
204             return entity;
205         }
206     }
207 
208     /**
209      * @see Comparable#compareTo
210      */
211     public int compareTo(SandreSamplingEquipmentExp o)
212     {
213         int cmp = 0;
214         if (this.getSandreSamplingEquipmentExpId() != null)
215         {
216             cmp = this.getSandreSamplingEquipmentExpId().compareTo(o.getSandreSamplingEquipmentExpId());
217         }
218         else
219         {
220             if (this.getSandreSamplingEquipmentId() != null)
221             {
222                 cmp = (cmp != 0 ? cmp : this.getSandreSamplingEquipmentId().compareTo(o.getSandreSamplingEquipmentId()));
223             }
224             if (this.getSandreSamplingEquipmentLb() != null)
225             {
226                 cmp = (cmp != 0 ? cmp : this.getSandreSamplingEquipmentLb().compareTo(o.getSandreSamplingEquipmentLb()));
227             }
228         }
229         return cmp;
230     }
231 // HibernateEntity.vsl merge-point
232 // SandreSamplingEquipmentExp.java merge-point
233 }