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.Quser;
29  import fr.ifremer.quadrige3.core.dao.referential.ObjectType;
30  import java.io.Serializable;
31  import java.util.Collection;
32  import java.util.HashSet;
33  
34  /**
35   * Liste des sélections cartographique.
36   */
37  // HibernateEntity.vsl annotations merge-point
38  public abstract class Selection
39      implements Serializable, Comparable<Selection>
40  {
41      /**
42       * The serial version UID of this class. Needed for serialization.
43       */
44      private static final long serialVersionUID = 4743617357468307693L;
45  
46      // Generate 3 attributes
47      private Integer selId;
48  
49      /**
50       * Identifiant interne de la sélection
51       * @return this.selId Integer
52       */
53      public Integer getSelId()
54      {
55          return this.selId;
56      }
57  
58      /**
59       * Identifiant interne de la sélection
60       * @param selIdIn Integer
61       */
62      public void setSelId(Integer selIdIn)
63      {
64          this.selId = selIdIn;
65      }
66  
67      private Integer selSessionId;
68  
69      /**
70       * Identifiant de la session utilisateur
71       * @return this.selSessionId Integer
72       */
73      public Integer getSelSessionId()
74      {
75          return this.selSessionId;
76      }
77  
78      /**
79       * Identifiant de la session utilisateur
80       * @param selSessionIdIn Integer
81       */
82      public void setSelSessionId(Integer selSessionIdIn)
83      {
84          this.selSessionId = selSessionIdIn;
85      }
86  
87      private String selPosition;
88  
89      /**
90       * Géométries sélectionnées
91       * @return this.selPosition String
92       */
93      public String getSelPosition()
94      {
95          return this.selPosition;
96      }
97  
98      /**
99       * Géométries sélectionnées
100      * @param selPositionIn String
101      */
102     public void setSelPosition(String selPositionIn)
103     {
104         this.selPosition = selPositionIn;
105     }
106 
107     // Generate 3 associations
108     private Collection<SelectionItem> selItemGeomObjectIds = new HashSet<SelectionItem>();
109 
110     /**
111      * Liste des objets sélectionnés dans la vue cartographique.
112      * @return this.selItemGeomObjectIds Collection<SelectionItem>
113      */
114     public Collection<SelectionItem> getSelItemGeomObjectIds()
115     {
116         return this.selItemGeomObjectIds;
117     }
118 
119     /**
120      * Liste des objets sélectionnés dans la vue cartographique.
121      * @param selItemGeomObjectIdsIn Collection<SelectionItem>
122      */
123     public void setSelItemGeomObjectIds(Collection<SelectionItem> selItemGeomObjectIdsIn)
124     {
125         this.selItemGeomObjectIds = selItemGeomObjectIdsIn;
126     }
127 
128     /**
129      * Liste des objets sélectionnés dans la vue cartographique.
130      * @param elementToAdd SelectionItem
131      * @return <tt>true</tt> if this collection changed as a result of the
132      *         call
133      */
134     public boolean addSelItemGeomObjectIds(SelectionItem elementToAdd)
135     {
136         return this.selItemGeomObjectIds.add(elementToAdd);
137     }
138 
139     /**
140      * Liste des objets sélectionnés dans la vue cartographique.
141      * @param elementToRemove SelectionItem
142      * @return <tt>true</tt> if this collection changed as a result of the
143      *         call
144      */
145     public boolean removeSelItemGeomObjectIds(SelectionItem elementToRemove)
146     {
147         return this.selItemGeomObjectIds.remove(elementToRemove);
148     }
149 
150     private ObjectType objectTypeCd;
151 
152     /**
153      * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
154      * ne peut
155      * pas être modifiée par l'utilisateur.
156      * @return this.objectTypeCd ObjectType
157      */
158     public ObjectType getObjectTypeCd()
159     {
160         return this.objectTypeCd;
161     }
162 
163     /**
164      * Liste des types d'objets qui peuvent être associés à la photo ou à un résultat. Cette liste
165      * ne peut
166      * pas être modifiée par l'utilisateur.
167      * @param objectTypeCdIn ObjectType
168      */
169     public void setObjectTypeCd(ObjectType objectTypeCdIn)
170     {
171         this.objectTypeCd = objectTypeCdIn;
172     }
173 
174     private Quser quserId;
175 
176     /**
177      * Liste l'ensemble des agents et utilisateurs du système.
178      * @return this.quserId Quser
179      */
180     public Quser getQuserId()
181     {
182         return this.quserId;
183     }
184 
185     /**
186      * Liste l'ensemble des agents et utilisateurs du système.
187      * @param quserIdIn Quser
188      */
189     public void setQuserId(Quser quserIdIn)
190     {
191         this.quserId = quserIdIn;
192     }
193 
194     /**
195      * Returns <code>true</code> if the argument is an Selection instance and all identifiers for this entity
196      * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
197      */
198     @Override
199     public boolean equals(Object object)
200     {
201         if (this == object)
202         {
203             return true;
204         }
205         if (!(object instanceof Selection))
206         {
207             return false;
208         }
209         final Selection that = (Selection)object;
210         if (this.selId == null || that.getSelId() == null || !this.selId.equals(that.getSelId()))
211         {
212             return false;
213         }
214         return true;
215     }
216 
217     /**
218      * Returns a hash code based on this entity's identifiers.
219      */
220     @Override
221     public int hashCode()
222     {
223         int hashCode = 0;
224         hashCode = 29 * hashCode + (this.selId == null ? 0 : this.selId.hashCode());
225 
226         return hashCode;
227     }
228 
229     /**
230      * Constructs new instances of {@link Selection}.
231      */
232     public static final class Factory
233     {
234         /**
235          * Constructs a new instance of {@link Selection}.
236          * @return new SelectionImpl()
237          */
238         public static Selection newInstance()
239         {
240             return new SelectionImpl();
241         }
242 
243         /**
244          * Constructs a new instance of {@link Selection}, taking all required and/or
245          * read-only properties as arguments, except for identifiers.
246          * @param selSessionId Integer
247          * @return newInstance
248          */
249         public static Selection newInstance(Integer selSessionId)
250         {
251             final Selection entity = new SelectionImpl();
252             entity.setSelSessionId(selSessionId);
253             return entity;
254         }
255 
256         /**
257          * Constructs a new instance of {@link Selection}, taking all possible properties
258          * (except the identifier(s))as arguments.
259          * @param selSessionId Integer
260          * @param selPosition String
261          * @param selItemGeomObjectIds Collection<SelectionItem>
262          * @param objectTypeCd ObjectType
263          * @param quserId Quser
264          * @return newInstance Selection
265          */
266         public static Selection newInstance(Integer selSessionId, String selPosition, Collection<SelectionItem> selItemGeomObjectIds, ObjectType objectTypeCd, Quser quserId)
267         {
268             final Selection entity = new SelectionImpl();
269             entity.setSelSessionId(selSessionId);
270             entity.setSelPosition(selPosition);
271             entity.setSelItemGeomObjectIds(selItemGeomObjectIds);
272             entity.setObjectTypeCd(objectTypeCd);
273             entity.setQuserId(quserId);
274             return entity;
275         }
276     }
277 
278     /**
279      * @see Comparable#compareTo
280      */
281     public int compareTo(Selection o)
282     {
283         int cmp = 0;
284         if (this.getSelId() != null)
285         {
286             cmp = this.getSelId().compareTo(o.getSelId());
287         }
288         else
289         {
290             if (this.getSelSessionId() != null)
291             {
292                 cmp = (cmp != 0 ? cmp : this.getSelSessionId().compareTo(o.getSelSessionId()));
293             }
294             if (this.getSelPosition() != null)
295             {
296                 cmp = (cmp != 0 ? cmp : this.getSelPosition().compareTo(o.getSelPosition()));
297             }
298         }
299         return cmp;
300     }
301 // HibernateEntity.vsl merge-point
302 // Selection.java merge-point
303 }