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.extraction;
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.Date;
31
32 /**
33 * Table contenant les informations des tables utilisées pour l'extraction pour pouvoir les
34 * supprimer par un batch
35 */
36 // HibernateEntity.vsl annotations merge-point
37 public abstract class ExtractTable
38 implements Serializable, Comparable<ExtractTable>
39 {
40 /**
41 * The serial version UID of this class. Needed for serialization.
42 */
43 private static final long serialVersionUID = -88638764911295868L;
44
45 // Generate 4 attributes
46 private String extractTableName;
47
48 /**
49 * Nom de la table contenant les données pour l'extraction
50 * @return this.extractTableName String
51 */
52 public String getExtractTableName()
53 {
54 return this.extractTableName;
55 }
56
57 /**
58 * Nom de la table contenant les données pour l'extraction
59 * @param extractTableNameIn String
60 */
61 public void setExtractTableName(String extractTableNameIn)
62 {
63 this.extractTableName = extractTableNameIn;
64 }
65
66 private String extractTableUser;
67
68 /**
69 * Identifiant de l'utilisateur qui a demandé l'extraction
70 * @return this.extractTableUser String
71 */
72 public String getExtractTableUser()
73 {
74 return this.extractTableUser;
75 }
76
77 /**
78 * Identifiant de l'utilisateur qui a demandé l'extraction
79 * @param extractTableUserIn String
80 */
81 public void setExtractTableUser(String extractTableUserIn)
82 {
83 this.extractTableUser = extractTableUserIn;
84 }
85
86 private Date extractTableDate;
87
88 /**
89 * Date de la demande d'extraction
90 * @return this.extractTableDate Date
91 */
92 public Date getExtractTableDate()
93 {
94 return this.extractTableDate;
95 }
96
97 /**
98 * Date de la demande d'extraction
99 * @param extractTableDateIn Date
100 */
101 public void setExtractTableDate(Date extractTableDateIn)
102 {
103 this.extractTableDate = extractTableDateIn;
104 }
105
106 private Integer extractTableId;
107
108 /**
109 *
110 * @return this.extractTableId Integer
111 */
112 public Integer getExtractTableId()
113 {
114 return this.extractTableId;
115 }
116
117 /**
118 *
119 * @param extractTableIdIn Integer
120 */
121 public void setExtractTableId(Integer extractTableIdIn)
122 {
123 this.extractTableId = extractTableIdIn;
124 }
125
126 // Generate 0 associations
127 /**
128 * Returns <code>true</code> if the argument is an ExtractTable instance and all identifiers for this entity
129 * equal the identifiers of the argument entity. Returns <code>false</code> otherwise.
130 */
131 @Override
132 public boolean equals(Object object)
133 {
134 if (this == object)
135 {
136 return true;
137 }
138 if (!(object instanceof ExtractTable))
139 {
140 return false;
141 }
142 final ExtractTable that = (ExtractTable)object;
143 if (this.extractTableId == null || that.getExtractTableId() == null || !this.extractTableId.equals(that.getExtractTableId()))
144 {
145 return false;
146 }
147 return true;
148 }
149
150 /**
151 * Returns a hash code based on this entity's identifiers.
152 */
153 @Override
154 public int hashCode()
155 {
156 int hashCode = 0;
157 hashCode = 29 * hashCode + (this.extractTableId == null ? 0 : this.extractTableId.hashCode());
158
159 return hashCode;
160 }
161
162 /**
163 * Constructs new instances of {@link ExtractTable}.
164 */
165 public static final class Factory
166 {
167 /**
168 * Constructs a new instance of {@link ExtractTable}.
169 * @return new ExtractTableImpl()
170 */
171 public static ExtractTable newInstance()
172 {
173 return new ExtractTableImpl();
174 }
175
176 /**
177 * Constructs a new instance of {@link ExtractTable}, taking all required and/or
178 * read-only properties as arguments, except for identifiers.
179 * @param extractTableName String
180 * @param extractTableUser String
181 * @return newInstance
182 */
183 public static ExtractTable newInstance(String extractTableName, String extractTableUser)
184 {
185 final ExtractTable entity = new ExtractTableImpl();
186 entity.setExtractTableName(extractTableName);
187 entity.setExtractTableUser(extractTableUser);
188 return entity;
189 }
190
191 /**
192 * Constructs a new instance of {@link ExtractTable}, taking all possible properties
193 * (except the identifier(s))as arguments.
194 * @param extractTableName String
195 * @param extractTableUser String
196 * @param extractTableDate Date
197 * @return newInstance ExtractTable
198 */
199 public static ExtractTable newInstance(String extractTableName, String extractTableUser, Date extractTableDate)
200 {
201 final ExtractTable entity = new ExtractTableImpl();
202 entity.setExtractTableName(extractTableName);
203 entity.setExtractTableUser(extractTableUser);
204 entity.setExtractTableDate(extractTableDate);
205 return entity;
206 }
207 }
208
209 /**
210 * @see Comparable#compareTo
211 */
212 public int compareTo(ExtractTable o)
213 {
214 int cmp = 0;
215 if (this.getExtractTableId() != null)
216 {
217 cmp = this.getExtractTableId().compareTo(o.getExtractTableId());
218 }
219 else
220 {
221 if (this.getExtractTableName() != null)
222 {
223 cmp = (cmp != 0 ? cmp : this.getExtractTableName().compareTo(o.getExtractTableName()));
224 }
225 if (this.getExtractTableUser() != null)
226 {
227 cmp = (cmp != 0 ? cmp : this.getExtractTableUser().compareTo(o.getExtractTableUser()));
228 }
229 if (this.getExtractTableDate() != null)
230 {
231 cmp = (cmp != 0 ? cmp : this.getExtractTableDate().compareTo(o.getExtractTableDate()));
232 }
233 }
234 return cmp;
235 }
236 // HibernateEntity.vsl merge-point
237 // ExtractTable.java merge-point
238 }