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