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.system;
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.sql.Timestamp;
31  
32  /**
33   * Liste des objets sélectionnés dans la vue cartographique.
34   */
35  // HibernateEntity.vsl annotations merge-point
36  public abstract class SelectionItem
37      implements Serializable, Comparable<SelectionItem>
38  {
39      /**
40       * The serial version UID of this class. Needed for serialization.
41       */
42      private static final long serialVersionUID = -5330828572312530497L;
43  
44      // Generate 3 attributes
45      private Integer selItemGeomObjectId;
46  
47      /**
48       * Identifiant de l'objet sélectionné (pour le type d'objet)
49       * @return this.selItemGeomObjectId Integer
50       */
51      public Integer getSelItemGeomObjectId()
52      {
53          return this.selItemGeomObjectId;
54      }
55  
56      /**
57       * Identifiant de l'objet sélectionné (pour le type d'objet)
58       * @param selItemGeomObjectIdIn Integer
59       */
60      public void setSelItemGeomObjectId(Integer selItemGeomObjectIdIn)
61      {
62          this.selItemGeomObjectId = selItemGeomObjectIdIn;
63      }
64  
65      private Timestamp updateDt;
66  
67      /**
68       * Date de modification de l'objet, mise à jour par le système
69       * @return this.updateDt Timestamp
70       */
71      public Timestamp getUpdateDt()
72      {
73          return this.updateDt;
74      }
75  
76      /**
77       * Date de modification de l'objet, mise à jour par le système
78       * @param updateDtIn Timestamp
79       */
80      public void setUpdateDt(Timestamp updateDtIn)
81      {
82          this.updateDt = updateDtIn;
83      }
84  
85      private Integer selectionItemId;
86  
87      /**
88       * 
89       * @return this.selectionItemId Integer
90       */
91      public Integer getSelectionItemId()
92      {
93          return this.selectionItemId;
94      }
95  
96      /**
97       * 
98       * @param selectionItemIdIn Integer
99       */
100     public void setSelectionItemId(Integer selectionItemIdIn)
101     {
102         this.selectionItemId = selectionItemIdIn;
103     }
104 
105     // Generate 1 associations
106     private Selection selId;
107 
108     /**
109      * Liste des sélections cartographique.
110      * @return this.selId Selection
111      */
112     public Selection getSelId()
113     {
114         return this.selId;
115     }
116 
117     /**
118      * Liste des sélections cartographique.
119      * @param selIdIn Selection
120      */
121     public void setSelId(Selection selIdIn)
122     {
123         this.selId = selIdIn;
124     }
125 
126     /**
127      * Returns <code>true</code> if the argument is an SelectionItem 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 SelectionItem))
138         {
139             return false;
140         }
141         final SelectionItem that = (SelectionItem)object;
142         if (this.selectionItemId == null || that.getSelectionItemId() == null || !this.selectionItemId.equals(that.getSelectionItemId()))
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.selectionItemId == null ? 0 : this.selectionItemId.hashCode());
157 
158         return hashCode;
159     }
160 
161     /**
162      * Constructs new instances of {@link SelectionItem}.
163      */
164     public static final class Factory
165     {
166         /**
167          * Constructs a new instance of {@link SelectionItem}.
168          * @return new SelectionItemImpl()
169          */
170         public static SelectionItem newInstance()
171         {
172             return new SelectionItemImpl();
173         }
174 
175 
176         /**
177          * Constructs a new instance of {@link SelectionItem}, taking all possible properties
178          * (except the identifier(s))as arguments.
179          * @param selItemGeomObjectId Integer
180          * @param updateDt Timestamp
181          * @param selId Selection
182          * @return newInstance SelectionItem
183          */
184         public static SelectionItem newInstance(Integer selItemGeomObjectId, Timestamp updateDt, Selection selId)
185         {
186             final SelectionItem entity = new SelectionItemImpl();
187             entity.setSelItemGeomObjectId(selItemGeomObjectId);
188             entity.setUpdateDt(updateDt);
189             entity.setSelId(selId);
190             return entity;
191         }
192     }
193 
194     /**
195      * @see Comparable#compareTo
196      */
197     public int compareTo(SelectionItem o)
198     {
199         int cmp = 0;
200         if (this.getSelectionItemId() != null)
201         {
202             cmp = this.getSelectionItemId().compareTo(o.getSelectionItemId());
203         }
204         else
205         {
206             if (this.getSelItemGeomObjectId() != null)
207             {
208                 cmp = (cmp != 0 ? cmp : this.getSelItemGeomObjectId().compareTo(o.getSelItemGeomObjectId()));
209             }
210             if (this.getUpdateDt() != null)
211             {
212                 cmp = (cmp != 0 ? cmp : this.getUpdateDt().compareTo(o.getUpdateDt()));
213             }
214         }
215         return cmp;
216     }
217 // HibernateEntity.vsl merge-point
218 // SelectionItem.java merge-point
219 }