1 // license-header java merge-point
2 //
3 // Attention: Generated code! Do not modify by hand!
4 // Generated by: SpringDao.vsl in andromda-spring-cartridge.
5 //
6 package fr.ifremer.quadrige2.core.dao.data.survey;
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 fr.ifremer.quadrige2.core.dao.Search;
30 import fr.ifremer.quadrige2.core.dao.administration.user.Department;
31 import fr.ifremer.quadrige2.core.dao.referential.QualityFlag;
32 import fr.ifremer.quadrige2.core.dao.referential.monitoringLocation.MonitoringLocation;
33 import java.sql.Timestamp;
34 import java.util.Collection;
35 import java.util.Date;
36 import java.util.Set;
37 import org.andromda.spring.PaginationResult;
38
39 /**
40 * Liste les différents passages effectués sur un lieu de surveillance.
41 * Liste les différents passages effectués sur un lieu de surveillance.
42 * @see Survey
43 */
44 public interface SurveyDao
45 {
46 /**
47 * This constant is used as a transformation flag; entities can be converted automatically into value objects
48 * or other types, different methods in a class implementing this interface support this feature: look for
49 * an <code>int</code> parameter called <code>transform</code>.
50 * <p>
51 * This specific flag denotes no transformation will occur.
52 */
53 public static final int TRANSFORM_NONE = 0;
54
55
56 /**
57 * Transforms the given results to a collection of {@link Survey}
58 * instances (this is useful when the returned results contains a row of data and you want just entities only).
59 *
60 * @param results the query results.
61 */
62 public void toEntities(final Collection<?> results);
63
64 /**
65 * Gets an instance of Survey from the persistent store.
66 * @param surveyId
67 * @return Survey
68 */
69 public Survey get(Integer surveyId);
70
71 /**
72 * <p>
73 * Does the same thing as {@link #get(Integer)} with an
74 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
75 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
76 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
77 * optionally transform the entity (into a value object for example). By default, transformation does
78 * not occur.
79 * </p>
80 *
81 * @param transform flag to determine transformation type.
82 * @param surveyId the identifier of the entity to get.
83 * @return either the entity or the object transformed from the entity.
84 */
85 public Object get(int transform, Integer surveyId);
86
87 /**
88 * Loads an instance of Survey from the persistent store.
89 * @param surveyId
90 * @return Survey
91 */
92 public Survey load(Integer surveyId);
93
94 /**
95 * <p>
96 * Does the same thing as {@link #load(Integer)} with an
97 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
98 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
99 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
100 * optionally transform the entity (into a value object for example). By default, transformation does
101 * not occur.
102 * </p>
103 *
104 * @param transform flag to determine transformation type.
105 * @param surveyId the identifier of the entity to load.
106 * @return either the entity or the object transformed from the entity.
107 */
108 public Object load(int transform, Integer surveyId);
109
110 /**
111 * Loads all entities of type {@link Survey}.
112 *
113 * @return the loaded entities.
114 */
115 public Collection<Survey> loadAll();
116
117 /**
118 * <p>
119 * Does the same thing as {@link #loadAll()} with an
120 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
121 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
122 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
123 * transform the entity (into a value object for example). By default, transformation does
124 * not occur.
125 * </p>
126 *
127 * @param transform the flag indicating what transformation to use.
128 * @return the loaded entities.
129 */
130 public Collection<?> loadAll(final int transform);
131
132 /**
133 * <p>
134 * Does the same thing as {@link #loadAll()} with an
135 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
136 * argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the
137 * page retrieved.
138 * </p>
139 *
140 * @param pageNumber the page number to retrieve when paging results.
141 * @param pageSize the size of the page to retrieve when paging results.
142 * @return the loaded entities.
143 */
144 public Collection<?> loadAll(final int pageNumber, final int pageSize);
145
146 /**
147 * <p>
148 * Does the same thing as {@link #loadAll(int)} with an
149 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
150 * argument allows you to specify the page number when you are paging the results and the pageSize allows you to specify the size of the
151 * page retrieved.
152 * </p>
153 *
154 * @param transform the flag indicating what transformation to use.
155 * @param pageNumber the page number to retrieve when paging results.
156 * @param pageSize the size of the page to retrieve when paging results.
157 * @return the loaded entities.
158 */
159 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
160
161 /**
162 * Creates an instance of Survey and adds it to the persistent store.
163 * @param survey
164 * @return Survey
165 */
166 public Survey create(Survey survey);
167
168 /**
169 * <p>
170 * Does the same thing as {@link #create(Survey)} with an
171 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
172 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
173 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
174 * transform the entity (into a value object for example). By default, transformation does
175 * not occur.
176 * </p>
177 * @param transform
178 * @param survey
179 * @return Object
180 */
181 public Object create(int transform, Survey survey);
182
183 /**
184 * Creates a new instance of Survey and adds
185 * from the passed in <code>entities</code> collection
186 *
187 * @param entities the collection of Survey
188 * instances to create.
189 *
190 * @return the created instances.
191 */
192 public Collection<Survey> create(Collection<Survey> entities);
193
194 /**
195 * <p>
196 * Does the same thing as {@link #create(Survey)} with an
197 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
198 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
199 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
200 * transform the entities (into value objects for example). By default, transformation does
201 * not occur.
202 * </p>
203 * @param transform
204 * @param entities
205 * @return Collection
206 */
207 public Collection<?> create(int transform, Collection<Survey> entities);
208
209 /**
210 * <p>
211 * Creates a new <code>Survey</code>
212 * instance from <strong>all</strong> attributes and adds it to
213 * the persistent store.
214 * </p>
215 * @param surveyDt Date du passage
216 Cette date ne comprend pas les heures, minutes, secondes du passage qui sont renseignés séparément.
217 * @param surveyTime Heure du passage.
218 Cette heure est indépendante de la date, car elle n'est pas obligatoire et il faut être capable de
219 séparer un passage à minuit et une heure non renseignée.
220 L'heure renseignée par l'utilisateur est l'heure locale, ie UT+1 ou UT+2
221 * @param surveyNumberIndiv Nombre d¿¿individus sur le passage
222 * @param surveyBottomDepth Valeur de la sonde à l'endroit du passage.
223 Cette valeur n'a de sens que lorsque le passage est de type ponctuel.
224 Elle n'est pas obligatoire, car il il y a des passages à terre (rebent intertidal)
225 * @param surveyLb Chaine de caractères contenant une suite de mots clefs connus de l'utilisateur et servant à
226 identifier le passage (lors d'une sélection par exemple?)
227 * @param surveyCm Commentaire sur le passage. (les commentaires en général ne servent pas à décrire mais à donner des
228 informations diverses et variées, et surtout accessoires, pas capitales).
229 * @param surveyUtFormat Format UT de l'heure pour le passage [-12;12]
230 * @param surveyControlDt Date des contrôles les caractéristiques du passage
231 Cette date ainsi que celle de qualification, et validation ne sont pas renseignées par
232 l'utilisateur, mais par les fonctions associées.
233 * @param surveyValidDt Date de validation de la données
234 * @param surveyValidCm
235 * @param surveyQualifDt Date de qualification de la données
236 * @param surveyQualifCm Commentaires sur la qualification du passage. Ces commentaires sont obligatoires si le niveau de
237 qualification est douteux ou faux. On peut par exemple noter dans le commentaire que l¿engin
238 d¿analyse utilisé était déficient.
239 * @param surveyActualPosition Vrai si la géométrie est définie par l'utilisateur, faux si elle est héritée du lieu.
240 Cette information est renseignée par le système et permet par la suite une thématique d'affichage.
241 * @param surveyPositionCm Commentaire associé à la localisation
242 * @param surveyGeometryValidDt Date de validation de la géométrie de l'objet
243 * @param surveyScope Vrai si l'étape de qualification est globale, faux si des éléments fils ou résultats n'ont pas la
244 même étape
245 * @param surveyHasMeas Vrai si l'élément a des résultats de mesure, dénombrement ou fichier
246 * @param updateDt Date de modification de l'objet, mise à jour par le système
247 * @param synchronizationStatus
248 * @return Survey
249 */
250 public Survey create(
251 Date surveyDt,
252 Double surveyTime,
253 Double surveyNumberIndiv,
254 Float surveyBottomDepth,
255 String surveyLb,
256 String surveyCm,
257 Double surveyUtFormat,
258 Date surveyControlDt,
259 Date surveyValidDt,
260 String surveyValidCm,
261 Date surveyQualifDt,
262 String surveyQualifCm,
263 String surveyActualPosition,
264 String surveyPositionCm,
265 Date surveyGeometryValidDt,
266 String surveyScope,
267 String surveyHasMeas,
268 Timestamp updateDt);
269
270 /**
271 * <p>
272 * Does the same thing as {@link #create(Date, Double, Double, Float, String, String, Double, Date, Date, String, Date, String, String, String, Date, String, String, Timestamp, String)} with an
273 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
274 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
275 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
276 * transform the entity (into a value object for example). By default, transformation does
277 * not occur.
278 * </p>
279 * @param transform
280 * @param surveyDt Date du passage
281 Cette date ne comprend pas les heures, minutes, secondes du passage qui sont renseignés séparément.
282 * @param surveyTime Heure du passage.
283 Cette heure est indépendante de la date, car elle n'est pas obligatoire et il faut être capable de
284 séparer un passage à minuit et une heure non renseignée.
285 L'heure renseignée par l'utilisateur est l'heure locale, ie UT+1 ou UT+2
286 * @param surveyNumberIndiv Nombre d¿¿individus sur le passage
287 * @param surveyBottomDepth Valeur de la sonde à l'endroit du passage.
288 Cette valeur n'a de sens que lorsque le passage est de type ponctuel.
289 Elle n'est pas obligatoire, car il il y a des passages à terre (rebent intertidal)
290 * @param surveyLb Chaine de caractères contenant une suite de mots clefs connus de l'utilisateur et servant à
291 identifier le passage (lors d'une sélection par exemple?)
292 * @param surveyCm Commentaire sur le passage. (les commentaires en général ne servent pas à décrire mais à donner des
293 informations diverses et variées, et surtout accessoires, pas capitales).
294 * @param surveyUtFormat Format UT de l'heure pour le passage [-12;12]
295 * @param surveyControlDt Date des contrôles les caractéristiques du passage
296 Cette date ainsi que celle de qualification, et validation ne sont pas renseignées par
297 l'utilisateur, mais par les fonctions associées.
298 * @param surveyValidDt Date de validation de la données
299 * @param surveyValidCm
300 * @param surveyQualifDt Date de qualification de la données
301 * @param surveyQualifCm Commentaires sur la qualification du passage. Ces commentaires sont obligatoires si le niveau de
302 qualification est douteux ou faux. On peut par exemple noter dans le commentaire que l¿engin
303 d¿analyse utilisé était déficient.
304 * @param surveyActualPosition Vrai si la géométrie est définie par l'utilisateur, faux si elle est héritée du lieu.
305 Cette information est renseignée par le système et permet par la suite une thématique d'affichage.
306 * @param surveyPositionCm Commentaire associé à la localisation
307 * @param surveyGeometryValidDt Date de validation de la géométrie de l'objet
308 * @param surveyScope Vrai si l'étape de qualification est globale, faux si des éléments fils ou résultats n'ont pas la
309 même étape
310 * @param surveyHasMeas Vrai si l'élément a des résultats de mesure, dénombrement ou fichier
311 * @param updateDt Date de modification de l'objet, mise à jour par le système
312 * @param synchronizationStatus
313 * @return Survey
314 */
315 public Object create(
316 int transform,
317 Date surveyDt,
318 Double surveyTime,
319 Double surveyNumberIndiv,
320 Float surveyBottomDepth,
321 String surveyLb,
322 String surveyCm,
323 Double surveyUtFormat,
324 Date surveyControlDt,
325 Date surveyValidDt,
326 String surveyValidCm,
327 Date surveyQualifDt,
328 String surveyQualifCm,
329 String surveyActualPosition,
330 String surveyPositionCm,
331 Date surveyGeometryValidDt,
332 String surveyScope,
333 String surveyHasMeas,
334 Timestamp updateDt);
335
336 /**
337 * <p>
338 * Creates a new <code>Survey</code>
339 * instance from only <strong>required</strong> properties (attributes
340 * and association ends) and adds it to the persistent store.
341 * </p>
342 * @param surveyDt
343 * @param synchronizationStatus
344 * @param updateDt
345 * @param recorderDepartment
346 * @param monitoringLocation
347 * @param qualityFlag
348 * @return Survey
349 */
350 public Survey create(
351 Date surveyDt,
352
353 Timestamp updateDt,
354 Department recorderDepartment,
355 MonitoringLocation monitoringLocation,
356 QualityFlag qualityFlag);
357
358 /**
359 * <p>
360 * Does the same thing as {@link #create(Date, Timestamp, String)} with an
361 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
362 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
363 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
364 * transform the entity (into a value object for example). By default, transformation does
365 * not occur.
366 * </p>
367 * @param transform flag to determine transformation type.
368 * @param surveyDt
369 * @param synchronizationStatus
370 * @param updateDt
371 * @param recorderDepartment
372 * @param monitoringLocation
373 * @param qualityFlag
374 * @return Object
375 */
376 public Object create(
377 int transform,
378 Date surveyDt,
379
380 Timestamp updateDt,
381 Department recorderDepartment,
382 MonitoringLocation monitoringLocation,
383 QualityFlag qualityFlag);
384
385 /**
386 * Updates the <code>survey</code> instance in the persistent store.
387 * @param survey
388 */
389 public void update(Survey survey);
390
391 /**
392 * Updates all instances in the <code>entities</code> collection in the persistent store.
393 * @param entities
394 */
395 public void update(Collection<Survey> entities);
396
397 /**
398 * Removes the instance of Survey from the persistent store.
399 * @param survey
400 */
401 public void remove(Survey survey);
402
403 /**
404 * Removes the instance of Survey having the given
405 * <code>identifier</code> from the persistent store.
406 * @param surveyId
407 */
408 public void remove(Integer surveyId);
409
410 /**
411 * Removes all entities in the given <code>entities</code> collection.
412 * @param entities
413 */
414 public void remove(Collection<Survey> entities);
415
416
417 /**
418 * Does the same thing as {@link #search(int, Search)} but with an
419 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
420 * limit your data to a specified page number and size.
421 *
422 * @param transform the transformation flag.
423 * @param pageNumber the page number in the data to retrieve
424 * @param pageSize the size of the page to retrieve.
425 * @param search the search object which provides the search parameters and pagination specification.
426 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
427 */
428 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
429
430 /**
431 * Does the same thing as {@link #search(Search)} but with an
432 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
433 * limit your data to a specified page number and size.
434 *
435 * @param pageNumber the page number in the data to retrieve
436 * @param pageSize the size of the page to retrieve.
437 * @param search the search object which provides the search parameters and pagination specification.
438 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
439 */
440 public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
441
442 /**
443 * Does the same thing as {@link #search(Search)} but with an
444 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
445 * finder results will <strong>NOT</strong> be transformed during retrieval.
446 * If this flag is any of the other constants defined here
447 * then results <strong>WILL BE</strong> passed through an operation which can optionally
448 * transform the entities (into value objects for example). By default, transformation does
449 * not occur.
450 *
451 * @param transform the transformation flag.
452 * @param search the search object which provides the search parameters and pagination specification.
453 * @return any found results from the search.
454 */
455 public Set<?> search(final int transform, final Search search);
456
457 /**
458 * Performs a search using the parameters specified in the given <code>search</code> object.
459 *
460 * @param search the search object which provides the search parameters and pagination specification.
461 * @return any found results from the search.
462 */
463 public Set<Survey> search(final Search search);
464
465 /**
466 * Allows transformation of entities into value objects
467 * (or something else for that matter), when the <code>transform</code>
468 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.data.survey.SurveyDao</code>, please note
469 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
470 * will be returned.
471 *
472 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
473 *
474 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.data.survey.SurveyDao}
475 * @param entity an entity that was found
476 * @return the transformed entity (i.e. new value object, etc)
477 * @see #transformEntities(int,Collection)
478 */
479 public Object transformEntity(final int transform, final Survey entity);
480
481 /**
482 * Transforms a collection of entities using the
483 * {@link #transformEntity(int,Survey)}
484 * method. This method does not instantiate a new collection.
485 * <p>
486 * This method is to be used internally only.
487 *
488 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.data.survey.SurveyDao</code>
489 * @param entities the collection of entities to transform
490 * @see #transformEntity(int,Survey)
491 */
492 public void transformEntities(final int transform, final Collection<?> entities);
493
494 // spring-dao merge-point
495 }