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.administration.user;
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.referential.Status;
31 import fr.ifremer.quadrige2.core.vo.administration.user.LightQuserVO;
32 import fr.ifremer.quadrige2.core.vo.administration.user.QuserVO;
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 l'ensemble des agents et utilisateurs du système.
41 * @see Quser
42 */
43 public interface QuserDao
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 Quser}
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 * This constant is used as a transformation flag; entities can be converted automatically into value objects
65 * or other types, different methods in a class implementing this interface support this feature: look for
66 * an <code>int</code> parameter called <code>transform</code>.
67 * <p>
68 * This specific flag denotes entities must be transformed into objects of type
69 * {@link QuserVO}.
70 */
71 public static final int TRANSFORM_QUSERVO = 1;
72
73 /**
74 * Copies the fields of the specified entity to the target value object. This method is similar to
75 * toQuserVO(), but it does not handle any attributes in the target
76 * value object that are "read-only" (as those do not have setter methods exposed).
77 * @param source
78 * @param target
79 */
80 public void toQuserVO(
81 Quser source,
82 QuserVO target);
83
84 /**
85 * Converts this DAO's entity to an object of type {@link QuserVO}.
86 * @param entity
87 * @return QuserVO
88 */
89 public QuserVO toQuserVO(Quser entity);
90
91 /**
92 * Converts this DAO's entity to a Collection of instances of type {@link QuserVO}.
93 * @param entities
94 */
95 public Collection<QuserVO> toQuserVOCollection(Collection<?> entities);
96
97 /**
98 * Converts this DAO's entity to an array of instances of type {@link QuserVO}.
99 * @param entities
100 * @return QuserVO[]
101 */
102 public QuserVO[] toQuserVOArray(Collection<?> entities);
103
104 /**
105 * Copies the fields of {@link QuserVO} to the specified entity.
106 * @param source
107 * @param target
108 * @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE,
109 * it will be copied regardless of its value.
110 */
111 public void quserVOToEntity(
112 QuserVO source,
113 Quser target,
114 boolean copyIfNull);
115
116 /**
117 * Converts an instance of type {@link QuserVO} to this DAO's entity.
118 * @param quserVO
119 * @return Quser
120 */
121 public Quser quserVOToEntity(QuserVO quserVO);
122
123 /**
124 * Converts a Collection of instances of type {@link QuserVO} to this
125 * DAO's entity.
126 * @param instances
127 */
128 public void quserVOToEntityCollection(Collection<?> instances);
129
130 /**
131 * This constant is used as a transformation flag; entities can be converted automatically into value objects
132 * or other types, different methods in a class implementing this interface support this feature: look for
133 * an <code>int</code> parameter called <code>transform</code>.
134 * <p>
135 * This specific flag denotes entities must be transformed into objects of type
136 * {@link LightQuserVO}.
137 */
138 public static final int TRANSFORM_LIGHTQUSERVO = 2;
139
140 /**
141 * Copies the fields of the specified entity to the target value object. This method is similar to
142 * toLightQuserVO(), but it does not handle any attributes in the target
143 * value object that are "read-only" (as those do not have setter methods exposed).
144 * @param source
145 * @param target
146 */
147 public void toLightQuserVO(
148 Quser source,
149 LightQuserVO target);
150
151 /**
152 * Converts this DAO's entity to an object of type {@link LightQuserVO}.
153 * @param entity
154 * @return LightQuserVO
155 */
156 public LightQuserVO toLightQuserVO(Quser entity);
157
158 /**
159 * Converts this DAO's entity to a Collection of instances of type {@link LightQuserVO}.
160 * @param entities
161 */
162 public Collection<LightQuserVO> toLightQuserVOCollection(Collection<?> entities);
163
164 /**
165 * Converts this DAO's entity to an array of instances of type {@link LightQuserVO}.
166 * @param entities
167 * @return LightQuserVO[]
168 */
169 public LightQuserVO[] toLightQuserVOArray(Collection<?> entities);
170
171 /**
172 * Copies the fields of {@link LightQuserVO} to the specified entity.
173 * @param source
174 * @param target
175 * @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE,
176 * it will be copied regardless of its value.
177 */
178 public void lightQuserVOToEntity(
179 LightQuserVO source,
180 Quser target,
181 boolean copyIfNull);
182
183 /**
184 * Converts an instance of type {@link LightQuserVO} to this DAO's entity.
185 * @param lightQuserVO
186 * @return Quser
187 */
188 public Quser lightQuserVOToEntity(LightQuserVO lightQuserVO);
189
190 /**
191 * Converts a Collection of instances of type {@link LightQuserVO} to this
192 * DAO's entity.
193 * @param instances
194 */
195 public void lightQuserVOToEntityCollection(Collection<?> instances);
196
197 /**
198 * Gets an instance of Quser from the persistent store.
199 * @param quserId
200 * @return Quser
201 */
202 public Quser get(Integer quserId);
203
204 /**
205 * <p>
206 * Does the same thing as {@link #get(Integer)} with an
207 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
208 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
209 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
210 * optionally transform the entity (into a value object for example). By default, transformation does
211 * not occur.
212 * </p>
213 *
214 * @param transform flag to determine transformation type.
215 * @param quserId the identifier of the entity to get.
216 * @return either the entity or the object transformed from the entity.
217 */
218 public Object get(int transform, Integer quserId);
219
220 /**
221 * Loads an instance of Quser from the persistent store.
222 * @param quserId
223 * @return Quser
224 */
225 public Quser load(Integer quserId);
226
227 /**
228 * <p>
229 * Does the same thing as {@link #load(Integer)} with an
230 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
231 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
232 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
233 * optionally transform the entity (into a value object for example). By default, transformation does
234 * not occur.
235 * </p>
236 *
237 * @param transform flag to determine transformation type.
238 * @param quserId the identifier of the entity to load.
239 * @return either the entity or the object transformed from the entity.
240 */
241 public Object load(int transform, Integer quserId);
242
243 /**
244 * Loads all entities of type {@link Quser}.
245 *
246 * @return the loaded entities.
247 */
248 public Collection<Quser> loadAll();
249
250 /**
251 * <p>
252 * Does the same thing as {@link #loadAll()} with an
253 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
254 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
255 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
256 * transform the entity (into a value object for example). By default, transformation does
257 * not occur.
258 * </p>
259 *
260 * @param transform the flag indicating what transformation to use.
261 * @return the loaded entities.
262 */
263 public Collection<?> loadAll(final int transform);
264
265 /**
266 * <p>
267 * Does the same thing as {@link #loadAll()} with an
268 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
269 * 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
270 * page retrieved.
271 * </p>
272 *
273 * @param pageNumber the page number to retrieve when paging results.
274 * @param pageSize the size of the page to retrieve when paging results.
275 * @return the loaded entities.
276 */
277 public Collection<?> loadAll(final int pageNumber, final int pageSize);
278
279 /**
280 * <p>
281 * Does the same thing as {@link #loadAll(int)} with an
282 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
283 * 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
284 * page retrieved.
285 * </p>
286 *
287 * @param transform the flag indicating what transformation to use.
288 * @param pageNumber the page number to retrieve when paging results.
289 * @param pageSize the size of the page to retrieve when paging results.
290 * @return the loaded entities.
291 */
292 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
293
294 /**
295 * Creates an instance of Quser and adds it to the persistent store.
296 * @param quser
297 * @return Quser
298 */
299 public Quser create(Quser quser);
300
301 /**
302 * <p>
303 * Does the same thing as {@link #create(Quser)} with an
304 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
305 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
306 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
307 * transform the entity (into a value object for example). By default, transformation does
308 * not occur.
309 * </p>
310 * @param transform
311 * @param quser
312 * @return Object
313 */
314 public Object create(int transform, Quser quser);
315
316 /**
317 * Creates a new instance of Quser and adds
318 * from the passed in <code>entities</code> collection
319 *
320 * @param entities the collection of Quser
321 * instances to create.
322 *
323 * @return the created instances.
324 */
325 public Collection<Quser> create(Collection<Quser> entities);
326
327 /**
328 * <p>
329 * Does the same thing as {@link #create(Quser)} with an
330 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
331 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
332 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
333 * transform the entities (into value objects for example). By default, transformation does
334 * not occur.
335 * </p>
336 * @param transform
337 * @param entities
338 * @return Collection
339 */
340 public Collection<?> create(int transform, Collection<Quser> entities);
341
342 /**
343 * <p>
344 * Creates a new <code>Quser</code>
345 * instance from <strong>all</strong> attributes and adds it to
346 * the persistent store.
347 * </p>
348 * @param quserCd Matricule : identifie de manière unique une personne dans LDAP, attribut obligatoire dans LDAP
349 * @param quserLastNm Nom de l'agent, obligatoire
350 * @param quserFirstNm Prénom de l'agent
351 * @param quserIntranetLg UID du LDAP intranet de l'agent s'il existe
352 * @param quserExtranetLg UID du LDAP extranet de l'agent s'il existe
353 * @param quserEMail Adresse électronique de la personne
354 * @param quserAddress Adresse du site dans le LDAP, ou informations sur l'adresse de l'utilisateur.
355 * @param quserPhone Liste des téléphones de la personnes
356 * @param quserOrgan Organisme dont dépend la personne (voir avec service)!!!
357 * @param quserAdminCenter Centre administratif dont dépend la personne (voir avec service) !!
358 * @param quserSite Site auquel est affectée la personne
359 * @param quserLdapPresent Oui, si l'utilisateur est présent dans le LDAP (code renseigné).
360 * @param quserCryptPassword Crypt password, for local DB only (e.g. ReefDb)
361 * @param quserCreationDt Date de création de l'objet
362 * @param updateDt Date de modification de l'objet
363 * @return Quser
364 */
365 public Quser create(
366 String quserCd,
367 String quserLastNm,
368 String quserFirstNm,
369 String quserIntranetLg,
370 String quserExtranetLg,
371 String quserEMail,
372 String quserAddress,
373 String quserPhone,
374 String quserOrgan,
375 String quserAdminCenter,
376 String quserSite,
377 String quserLdapPresent,
378 String quserCryptPassword,
379 Date quserCreationDt,
380 Timestamp updateDt);
381
382 /**
383 * <p>
384 * Does the same thing as {@link #create(String, String, String, String, String, String, String, String, String, String, String, String, String, Date, Timestamp)} with an
385 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
386 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
387 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
388 * transform the entity (into a value object for example). By default, transformation does
389 * not occur.
390 * </p>
391 * @param transform
392 * @param quserCd Matricule : identifie de manière unique une personne dans LDAP, attribut obligatoire dans LDAP
393 * @param quserLastNm Nom de l'agent, obligatoire
394 * @param quserFirstNm Prénom de l'agent
395 * @param quserIntranetLg UID du LDAP intranet de l'agent s'il existe
396 * @param quserExtranetLg UID du LDAP extranet de l'agent s'il existe
397 * @param quserEMail Adresse électronique de la personne
398 * @param quserAddress Adresse du site dans le LDAP, ou informations sur l'adresse de l'utilisateur.
399 * @param quserPhone Liste des téléphones de la personnes
400 * @param quserOrgan Organisme dont dépend la personne (voir avec service)!!!
401 * @param quserAdminCenter Centre administratif dont dépend la personne (voir avec service) !!
402 * @param quserSite Site auquel est affectée la personne
403 * @param quserLdapPresent Oui, si l'utilisateur est présent dans le LDAP (code renseigné).
404 * @param quserCryptPassword Crypt password, for local DB only (e.g. ReefDb)
405 * @param quserCreationDt Date de création de l'objet
406 * @param updateDt Date de modification de l'objet
407 * @return Quser
408 */
409 public Object create(
410 int transform,
411 String quserCd,
412 String quserLastNm,
413 String quserFirstNm,
414 String quserIntranetLg,
415 String quserExtranetLg,
416 String quserEMail,
417 String quserAddress,
418 String quserPhone,
419 String quserOrgan,
420 String quserAdminCenter,
421 String quserSite,
422 String quserLdapPresent,
423 String quserCryptPassword,
424 Date quserCreationDt,
425 Timestamp updateDt);
426
427 /**
428 * <p>
429 * Creates a new <code>Quser</code>
430 * instance from only <strong>required</strong> properties (attributes
431 * and association ends) and adds it to the persistent store.
432 * </p>
433 * @param quserFirstNm
434 * @param quserIntranetLg
435 * @param quserLastNm
436 * @param updateDt
437 * @param department
438 * @param status
439 * @return Quser
440 */
441 public Quser create(
442 String quserFirstNm,
443 String quserIntranetLg,
444 String quserLastNm,
445 Timestamp updateDt,
446 Department department,
447 Status status);
448
449 /**
450 * <p>
451 * Does the same thing as {@link #create(String, String, String, Timestamp)} with an
452 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
453 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
454 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
455 * transform the entity (into a value object for example). By default, transformation does
456 * not occur.
457 * </p>
458 * @param transform flag to determine transformation type.
459 * @param quserFirstNm
460 * @param quserIntranetLg
461 * @param quserLastNm
462 * @param updateDt
463 * @param department
464 * @param status
465 * @return Object
466 */
467 public Object create(
468 int transform,
469 String quserFirstNm,
470 String quserIntranetLg,
471 String quserLastNm,
472 Timestamp updateDt,
473 Department department,
474 Status status);
475
476 /**
477 * Updates the <code>quser</code> instance in the persistent store.
478 * @param quser
479 */
480 public void update(Quser quser);
481
482 /**
483 * Updates all instances in the <code>entities</code> collection in the persistent store.
484 * @param entities
485 */
486 public void update(Collection<Quser> entities);
487
488 /**
489 * Removes the instance of Quser from the persistent store.
490 * @param quser
491 */
492 public void remove(Quser quser);
493
494 /**
495 * Removes the instance of Quser having the given
496 * <code>identifier</code> from the persistent store.
497 * @param quserId
498 */
499 public void remove(Integer quserId);
500
501 /**
502 * Removes all entities in the given <code>entities</code> collection.
503 * @param entities
504 */
505 public void remove(Collection<Quser> entities);
506
507
508 /**
509 * Does the same thing as {@link #search(int, Search)} but with an
510 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
511 * limit your data to a specified page number and size.
512 *
513 * @param transform the transformation flag.
514 * @param pageNumber the page number in the data to retrieve
515 * @param pageSize the size of the page to retrieve.
516 * @param search the search object which provides the search parameters and pagination specification.
517 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
518 */
519 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
520
521 /**
522 * Does the same thing as {@link #search(Search)} but with an
523 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
524 * limit your data to a specified page number and size.
525 *
526 * @param pageNumber the page number in the data to retrieve
527 * @param pageSize the size of the page to retrieve.
528 * @param search the search object which provides the search parameters and pagination specification.
529 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
530 */
531 public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
532
533 /**
534 * Does the same thing as {@link #search(Search)} but with an
535 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
536 * finder results will <strong>NOT</strong> be transformed during retrieval.
537 * If this flag is any of the other constants defined here
538 * then results <strong>WILL BE</strong> passed through an operation which can optionally
539 * transform the entities (into value objects for example). By default, transformation does
540 * not occur.
541 *
542 * @param transform the transformation flag.
543 * @param search the search object which provides the search parameters and pagination specification.
544 * @return any found results from the search.
545 */
546 public Set<?> search(final int transform, final Search search);
547
548 /**
549 * Performs a search using the parameters specified in the given <code>search</code> object.
550 *
551 * @param search the search object which provides the search parameters and pagination specification.
552 * @return any found results from the search.
553 */
554 public Set<Quser> search(final Search search);
555
556 /**
557 * Allows transformation of entities into value objects
558 * (or something else for that matter), when the <code>transform</code>
559 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.administration.user.QuserDao</code>, please note
560 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
561 * will be returned.
562 * <p>
563 * This method will return instances of these types:
564 * <ul>
565 * <li>{@link Quser} - {@link #TRANSFORM_NONE}</li>
566 * <li>{@link QuserVO} - {@link #TRANSFORM_QUSERVO}</li>
567 * <li>{@link LightQuserVO} - {@link #TRANSFORM_LIGHTQUSERVO}</li>
568 * </ul>
569 *
570 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
571 *
572 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.administration.user.QuserDao}
573 * @param entity an entity that was found
574 * @return the transformed entity (i.e. new value object, etc)
575 * @see #transformEntities(int,Collection)
576 */
577 public Object transformEntity(final int transform, final Quser entity);
578
579 /**
580 * Transforms a collection of entities using the
581 * {@link #transformEntity(int,Quser)}
582 * method. This method does not instantiate a new collection.
583 * <p>
584 * This method is to be used internally only.
585 *
586 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.administration.user.QuserDao</code>
587 * @param entities the collection of entities to transform
588 * @see #transformEntity(int,Quser)
589 */
590 public void transformEntities(final int transform, final Collection<?> entities);
591
592 // spring-dao merge-point
593 }