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