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