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 java.io.Serializable;
30  import java.util.Collection;
31  import java.util.HashSet;
32  
33  /**
34   * Contenu du format XML - Balises avec les types et  description
35   */
36  // HibernateEntity.vsl annotations merge-point
37  public abstract class SandreXmlBalise
38      implements Serializable, Comparable<SandreXmlBalise>
39  {
40      /**
41       * The serial version UID of this class. Needed for serialization.
42       */
43      private static final long serialVersionUID = 3678554505362680999L;
44  
45      // Generate 4 attributes
46      private Integer sandreXmlBalId;
47  
48      /**
49       * Identifiant de la balise sandre
50       * @return this.sandreXmlBalId Integer
51       */
52      public Integer getSandreXmlBalId()
53      {
54          return this.sandreXmlBalId;
55      }
56  
57      /**
58       * Identifiant de la balise sandre
59       * @param sandreXmlBalIdIn Integer
60       */
61      public void setSandreXmlBalId(Integer sandreXmlBalIdIn)
62      {
63          this.sandreXmlBalId = sandreXmlBalIdIn;
64      }
65  
66      private String sandreXmlBalNm;
67  
68      /**
69       * Nom de la balise sandre
70       * @return this.sandreXmlBalNm String
71       */
72      public String getSandreXmlBalNm()
73      {
74          return this.sandreXmlBalNm;
75      }
76  
77      /**
78       * Nom de la balise sandre
79       * @param sandreXmlBalNmIn String
80       */
81      public void setSandreXmlBalNm(String sandreXmlBalNmIn)
82      {
83          this.sandreXmlBalNm = sandreXmlBalNmIn;
84      }
85  
86      private String sandreXmlBalDc;
87  
88      /**
89       * Description de la balise sandre
90       * @return this.sandreXmlBalDc String
91       */
92      public String getSandreXmlBalDc()
93      {
94          return this.sandreXmlBalDc;
95      }
96  
97      /**
98       * Description de la balise sandre
99       * @param sandreXmlBalDcIn String
100      */
101     public void setSandreXmlBalDc(String sandreXmlBalDcIn)
102     {
103         this.sandreXmlBalDc = sandreXmlBalDcIn;
104     }
105 
106     private String sandreXmlBalType;
107 
108     /**
109      * Type de la balise XML (caractère, entier, heure etc.)
110      * @return this.sandreXmlBalType String
111      */
112     public String getSandreXmlBalType()
113     {
114         return this.sandreXmlBalType;
115     }
116 
117     /**
118      * Type de la balise XML (caractère, entier, heure etc.)
119      * @param sandreXmlBalTypeIn String
120      */
121     public void setSandreXmlBalType(String sandreXmlBalTypeIn)
122     {
123         this.sandreXmlBalType = sandreXmlBalTypeIn;
124     }
125 
126     // Generate 2 associations
127     private Collection<SandreBaliseEq> sandreBalEqIds = new HashSet<SandreBaliseEq>();
128 
129     /**
130      * Equivalence des balises XML dans les tables pour trouver pour une valeur code d'un fichier
131      * d'échange
132      * la valeur dans les tables de référence Q2.
133      * @return this.sandreBalEqIds Collection<SandreBaliseEq>
134      */
135     public Collection<SandreBaliseEq> getSandreBalEqIds()
136     {
137         return this.sandreBalEqIds;
138     }
139 
140     /**
141      * Equivalence des balises XML dans les tables pour trouver pour une valeur code d'un fichier
142      * d'échange
143      * la valeur dans les tables de référence Q2.
144      * @param sandreBalEqIdsIn Collection<SandreBaliseEq>
145      */
146     public void setSandreBalEqIds(Collection<SandreBaliseEq> sandreBalEqIdsIn)
147     {
148         this.sandreBalEqIds = sandreBalEqIdsIn;
149     }
150 
151     /**
152      * Equivalence des balises XML dans les tables pour trouver pour une valeur code d'un fichier
153      * d'échange
154      * la valeur dans les tables de référence Q2.
155      * @param elementToAdd SandreBaliseEq
156      * @return <tt>true</tt> if this collection changed as a result of the
157      *         call
158      */
159     public boolean addSandreBalEqIds(SandreBaliseEq elementToAdd)
160     {
161         return this.sandreBalEqIds.add(elementToAdd);
162     }
163 
164     /**
165      * Equivalence des balises XML dans les tables pour trouver pour une valeur code d'un fichier
166      * d'échange
167      * la valeur dans les tables de référence Q2.
168      * @param elementToRemove SandreBaliseEq
169      * @return <tt>true</tt> if this collection changed as a result of the
170      *         call
171      */
172     public boolean removeSandreBalEqIds(SandreBaliseEq elementToRemove)
173     {
174         return this.sandreBalEqIds.remove(elementToRemove);
175     }
176 
177     /**
178      * Returns <code>true</code> if the argument is an SandreXmlBalise instance and all identifiers for this entity
179      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
180      */
181     @Override
182     public boolean equals(Object object)
183     {
184         if (this == object)
185         {
186             return true;
187         }
188         if (!(object instanceof SandreXmlBalise))
189         {
190             return false;
191         }
192         final SandreXmlBalise that = (SandreXmlBalise)object;
193         if (this.sandreXmlBalId == null || that.getSandreXmlBalId() == null || !this.sandreXmlBalId.equals(that.getSandreXmlBalId()))
194         {
195             return false;
196         }
197         return true;
198     }
199 
200     /**
201      * Returns a hash code based on this entity's identifiers.
202      */
203     @Override
204     public int hashCode()
205     {
206         int hashCode = 0;
207         hashCode = 29 * hashCode + (this.sandreXmlBalId == null ? 0 : this.sandreXmlBalId.hashCode());
208 
209         return hashCode;
210     }
211 
212     /**
213      * Constructs new instances of {@link SandreXmlBalise}.
214      */
215     public static final class Factory
216     {
217         /**
218          * Constructs a new instance of {@link SandreXmlBalise}.
219          * @return new SandreXmlBaliseImpl()
220          */
221         public static SandreXmlBalise newInstance()
222         {
223             return new SandreXmlBaliseImpl();
224         }
225 
226         /**
227          * Constructs a new instance of {@link SandreXmlBalise}, taking all required and/or
228          * read-only properties as arguments, except for identifiers.
229          * @param sandreXmlBalNm String
230          * @param sandreXmlBalType String
231          * @return newInstance
232          */
233         public static SandreXmlBalise newInstance(String sandreXmlBalNm, String sandreXmlBalType)
234         {
235             final SandreXmlBalise entity = new SandreXmlBaliseImpl();
236             entity.setSandreXmlBalNm(sandreXmlBalNm);
237             entity.setSandreXmlBalType(sandreXmlBalType);
238             return entity;
239         }
240 
241         /**
242          * Constructs a new instance of {@link SandreXmlBalise}, taking all possible properties
243          * (except the identifier(s))as arguments.
244          * @param sandreXmlBalNm String
245          * @param sandreXmlBalDc String
246          * @param sandreXmlBalType String
247          * @param sandreBalEqIds Collection<SandreBaliseEq>
248          * @return newInstance SandreXmlBalise
249          */
250         public static SandreXmlBalise newInstance(String sandreXmlBalNm, String sandreXmlBalDc, String sandreXmlBalType, Collection<SandreBaliseEq> sandreBalEqIds)
251         {
252             final SandreXmlBalise entity = new SandreXmlBaliseImpl();
253             entity.setSandreXmlBalNm(sandreXmlBalNm);
254             entity.setSandreXmlBalDc(sandreXmlBalDc);
255             entity.setSandreXmlBalType(sandreXmlBalType);
256             entity.setSandreBalEqIds(sandreBalEqIds);
257             return entity;
258         }
259     }
260 
261     /**
262      * @see Comparable#compareTo
263      */
264     public int compareTo(SandreXmlBalise o)
265     {
266         int cmp = 0;
267         if (this.getSandreXmlBalId() != null)
268         {
269             cmp = this.getSandreXmlBalId().compareTo(o.getSandreXmlBalId());
270         }
271         else
272         {
273             if (this.getSandreXmlBalNm() != null)
274             {
275                 cmp = (cmp != 0 ? cmp : this.getSandreXmlBalNm().compareTo(o.getSandreXmlBalNm()));
276             }
277             if (this.getSandreXmlBalDc() != null)
278             {
279                 cmp = (cmp != 0 ? cmp : this.getSandreXmlBalDc().compareTo(o.getSandreXmlBalDc()));
280             }
281             if (this.getSandreXmlBalType() != null)
282             {
283                 cmp = (cmp != 0 ? cmp : this.getSandreXmlBalType().compareTo(o.getSandreXmlBalType()));
284             }
285         }
286         return cmp;
287     }
288 // HibernateEntity.vsl merge-point
289 // SandreXmlBalise.java merge-point
290 }