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.program;
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.Quser;
30  import fr.ifremer.quadrige3.core.vo.administration.program.ProgQuserProgPrivVO;
31  import java.sql.Timestamp;
32  import java.util.Collection;
33  import java.util.Set;
34  import org.andromda.spring.PaginationResult;
35  
36  /**
37   * Liste des droits d'un utilisateur pour un programme particulier.
38   * @see ProgQuserProgPriv
39   */
40  public interface ProgQuserProgPrivDao
41  {
42      /**
43       * This constant is used as a transformation flag; entities can be converted automatically into value objects
44       * or other types, different methods in a class implementing this interface support this feature: look for
45       * an <code>int</code> parameter called <code>transform</code>.
46       * <p>
47       * This specific flag denotes no transformation will occur.
48       */
49      public static final int TRANSFORM_NONE = 0;
50  
51  
52      /**
53       * Transforms the given results to a collection of {@link ProgQuserProgPriv}
54       * instances (this is useful when the returned results contains a row of data and you want just entities only).
55       *
56       * @param results the query results.
57       */
58      public void toEntities(final Collection<?> results);
59  
60      /**
61       * This constant is used as a transformation flag; entities can be converted automatically into value objects
62       * or other types, different methods in a class implementing this interface support this feature: look for
63       * an <code>int</code> parameter called <code>transform</code>.
64       * <p>
65       * This specific flag denotes entities must be transformed into objects of type
66       * {@link ProgQuserProgPrivVO}.
67       */
68      public static final int TRANSFORM_PROGQUSERPROGPRIVVO = 1;
69  
70      /**
71       * Copies the fields of the specified entity to the target value object. This method is similar to
72       * toProgQuserProgPrivVO(), but it does not handle any attributes in the target
73       * value object that are "read-only" (as those do not have setter methods exposed).
74       * @param source
75       * @param target
76       */
77      public void toProgQuserProgPrivVO(
78          ProgQuserProgPriv source,
79          ProgQuserProgPrivVO target);
80  
81      /**
82       * Converts this DAO's entity to an object of type {@link ProgQuserProgPrivVO}.
83       * @param entity
84       * @return ProgQuserProgPrivVO
85       */
86      public ProgQuserProgPrivVO toProgQuserProgPrivVO(ProgQuserProgPriv entity);
87  
88      /**
89       * Converts this DAO's entity to a Collection of instances of type {@link ProgQuserProgPrivVO}.
90       * @param entities
91       */
92      public Collection<ProgQuserProgPrivVO> toProgQuserProgPrivVOCollection(Collection<?> entities);
93  
94      /**
95       * Converts this DAO's entity to an array of instances of type {@link ProgQuserProgPrivVO}.
96       * @param entities
97       * @return ProgQuserProgPrivVO[]
98       */
99      public ProgQuserProgPrivVO[] toProgQuserProgPrivVOArray(Collection<?> entities);
100 
101     /**
102      * Copies the fields of {@link ProgQuserProgPrivVO} to the specified entity.
103      * @param source
104      * @param target
105      * @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE,
106      * it will be copied regardless of its value.
107      */
108     public void progQuserProgPrivVOToEntity(
109         ProgQuserProgPrivVO source,
110         ProgQuserProgPriv target,
111         boolean copyIfNull);
112 
113     /**
114      * Converts an instance of type {@link ProgQuserProgPrivVO} to this DAO's entity.
115      * @param progQuserProgPrivVO
116      * @return ProgQuserProgPriv
117      */
118     public ProgQuserProgPriv progQuserProgPrivVOToEntity(ProgQuserProgPrivVO progQuserProgPrivVO);
119 
120     /**
121      * Converts a Collection of instances of type {@link ProgQuserProgPrivVO} to this
122      * DAO's entity.
123      * @param instances
124      */
125     public void progQuserProgPrivVOToEntityCollection(Collection<?> instances);
126 
127     /**
128      * Gets an instance of ProgQuserProgPriv from the persistent store.
129      * @param progQuserProgPrivPk
130      * @return ProgQuserProgPriv
131      */
132     public ProgQuserProgPriv get(ProgQuserProgPrivPK progQuserProgPrivPk);
133 
134     /**
135      * <p>
136      * Does the same thing as {@link #get(ProgQuserProgPrivPK)} with an
137      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
138      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
139      * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
140      * optionally transform the entity (into a value object for example). By default, transformation does
141      * not occur.
142      * </p>
143      *
144      * @param transform flag to determine transformation type.
145      * @param progQuserProgPrivPk the identifier of the entity to get.
146      * @return either the entity or the object transformed from the entity.
147      */
148     public Object get(int transform, ProgQuserProgPrivPK progQuserProgPrivPk);
149 
150     /**
151      * Loads an instance of ProgQuserProgPriv from the persistent store.
152      * @param progQuserProgPrivPk
153      * @return ProgQuserProgPriv
154      */
155     public ProgQuserProgPriv load(ProgQuserProgPrivPK progQuserProgPrivPk);
156 
157     /**
158      * <p>
159      * Does the same thing as {@link #load(ProgQuserProgPrivPK)} with an
160      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
161      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
162      * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
163      * optionally transform the entity (into a value object for example). By default, transformation does
164      * not occur.
165      * </p>
166      *
167      * @param transform flag to determine transformation type.
168      * @param progQuserProgPrivPk the identifier of the entity to load.
169      * @return either the entity or the object transformed from the entity.
170      */
171     public Object load(int transform, ProgQuserProgPrivPK progQuserProgPrivPk);
172 
173     /**
174      * Loads all entities of type {@link ProgQuserProgPriv}.
175      *
176      * @return the loaded entities.
177      */
178     public Collection<ProgQuserProgPriv> loadAll();
179 
180     /**
181      * <p>
182      * Does the same thing as {@link #loadAll()} with an
183      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
184      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
185      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
186      * transform the entity (into a value object for example). By default, transformation does
187      * not occur.
188      * </p>
189      *
190      * @param transform the flag indicating what transformation to use.
191      * @return the loaded entities.
192      */
193     public Collection<?> loadAll(final int transform);
194 
195     /**
196      * <p>
197      * Does the same thing as {@link #loadAll()} with an
198      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
199      * 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
200      * page retrieved.
201      * </p>
202      *
203      * @param pageNumber the page number to retrieve when paging results.
204      * @param pageSize the size of the page to retrieve when paging results.
205      * @return the loaded entities.
206      */
207     public Collection<?> loadAll(final int pageNumber, final int pageSize);
208 
209     /**
210      * <p>
211      * Does the same thing as {@link #loadAll(int)} with an
212      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
213      * 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
214      * page retrieved.
215      * </p>
216      *
217      * @param transform the flag indicating what transformation to use.
218      * @param pageNumber the page number to retrieve when paging results.
219      * @param pageSize the size of the page to retrieve when paging results.
220      * @return the loaded entities.
221      */
222     public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
223 
224     /**
225      * Creates an instance of ProgQuserProgPriv and adds it to the persistent store.
226      * @param progQuserProgPriv
227      * @return ProgQuserProgPriv
228      */
229     public ProgQuserProgPriv create(ProgQuserProgPriv progQuserProgPriv);
230 
231     /**
232      * <p>
233      * Does the same thing as {@link #create(ProgQuserProgPriv)} with an
234      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
235      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
236      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
237      * transform the entity (into a value object for example). By default, transformation does
238      * not occur.
239      * </p>
240      * @param transform
241      * @param progQuserProgPriv
242      * @return Object
243      */
244     public Object create(int transform, ProgQuserProgPriv progQuserProgPriv);
245 
246     /**
247      * Creates a new instance of ProgQuserProgPriv and adds
248      * from the passed in <code>entities</code> collection
249      *
250      * @param entities the collection of ProgQuserProgPriv
251      * instances to create.
252      *
253      * @return the created instances.
254      */
255     public Collection<ProgQuserProgPriv> create(Collection<ProgQuserProgPriv> entities);
256 
257     /**
258      * <p>
259      * Does the same thing as {@link #create(ProgQuserProgPriv)} with an
260      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
261      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
262      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
263      * transform the entities (into value objects for example). By default, transformation does
264      * not occur.
265      * </p>
266      * @param transform
267      * @param entities
268      * @return Collection
269      */
270     public Collection<?> create(int transform, Collection<ProgQuserProgPriv> entities);
271 
272     /**
273      * <p>
274      * Creates a new <code>ProgQuserProgPriv</code>
275      * instance from <strong>all</strong> attributes and adds it to
276      * the persistent store.
277      * </p>
278      * @param updateDt Date de modification de l'objet, mise à jour par le système
279      * @return ProgQuserProgPriv
280      */
281     public ProgQuserProgPriv create(
282         Timestamp updateDt);
283 
284     /**
285      * <p>
286      * Does the same thing as {@link #create(Timestamp)} with an
287      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
288      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
289      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
290      * transform the entity (into a value object for example). By default, transformation does
291      * not occur.
292      * </p>
293      * @param transform
294      * @param updateDt Date de modification de l'objet, mise à jour par le système
295      * @return ProgQuserProgPriv
296      */
297     public Object create(
298         int transform,
299         Timestamp updateDt);
300 
301     /**
302      * <p>
303      * Creates a new <code>ProgQuserProgPriv</code>
304      * instance from only <strong>required</strong> properties (attributes
305      * and association ends) and adds it to the persistent store.
306      * </p>
307      * @param programPrivilege
308      * @param program
309      * @param quser
310      * @return ProgQuserProgPriv
311      */
312     public ProgQuserProgPriv create(
313         ProgramPrivilege programPrivilege,
314         Program program,
315         Quser quser);
316 
317     /**
318      * <p>
319      * Does the same thing as {@link #create()} with an
320      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
321      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
322      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
323      * transform the entity (into a value object for example). By default, transformation does
324      * not occur.
325      * </p>
326      * @param transform flag to determine transformation type.
327      * @param programPrivilege
328      * @param program
329      * @param quser
330      * @return Object
331      */
332     public Object create(
333         int transform,
334         ProgramPrivilege programPrivilege,
335         Program program,
336         Quser quser);
337 
338     /**
339      * Updates the <code>progQuserProgPriv</code> instance in the persistent store.
340      * @param progQuserProgPriv
341      */
342     public void update(ProgQuserProgPriv progQuserProgPriv);
343 
344     /**
345      * Updates all instances in the <code>entities</code> collection in the persistent store.
346      * @param entities
347      */
348     public void update(Collection<ProgQuserProgPriv> entities);
349 
350     /**
351      * Removes the instance of ProgQuserProgPriv from the persistent store.
352      * @param progQuserProgPriv
353      */
354     public void remove(ProgQuserProgPriv progQuserProgPriv);
355 
356     /**
357      * Removes the instance of ProgQuserProgPriv having the given
358      * <code>identifier</code> from the persistent store.
359      * @param progQuserProgPrivPk
360      */
361     public void remove(ProgQuserProgPrivPK progQuserProgPrivPk);
362 
363     /**
364      * Removes all entities in the given <code>entities</code> collection.
365      * @param entities
366      */
367     public void remove(Collection<ProgQuserProgPriv> entities);
368 
369 
370     /**
371      * Does the same thing as {@link #search(int, Search)} but with an
372      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
373      * limit your data to a specified page number and size.
374      *
375      * @param transform the transformation flag.
376      * @param pageNumber the page number in the data to retrieve
377      * @param pageSize the size of the page to retrieve.
378      * @param search the search object which provides the search parameters and pagination specification.
379      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
380      */
381     public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
382 
383     /**
384      * Does the same thing as {@link #search(Search)} but with an
385      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
386      * limit your data to a specified page number and size.
387      *
388      * @param pageNumber the page number in the data to retrieve
389      * @param pageSize the size of the page to retrieve.
390      * @param search the search object which provides the search parameters and pagination specification.
391      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
392      */
393     public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
394 
395     /**
396      * Does the same thing as {@link #search(Search)} but with an
397      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
398      * finder results will <strong>NOT</strong> be transformed during retrieval.
399      * If this flag is any of the other constants defined here
400      * then results <strong>WILL BE</strong> passed through an operation which can optionally
401      * transform the entities (into value objects for example). By default, transformation does
402      * not occur.
403      *
404      * @param transform the transformation flag.
405      * @param search the search object which provides the search parameters and pagination specification.
406      * @return any found results from the search.
407      */
408     public Set<?> search(final int transform, final Search search);
409 
410     /**
411      * Performs a search using the parameters specified in the given <code>search</code> object.
412      *
413      * @param search the search object which provides the search parameters and pagination specification.
414      * @return any found results from the search.
415      */
416     public Set<ProgQuserProgPriv> search(final Search search);
417 
418     /**
419      * Allows transformation of entities into value objects
420      * (or something else for that matter), when the <code>transform</code>
421      * flag is set to one of the constants defined in <code>fr.ifremer.quadrige3.core.dao.administration.program.ProgQuserProgPrivDao</code>, please note
422      * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
423      * will be returned.
424      * <p>
425      * This method will return instances of these types:
426      * <ul>
427      *   <li>{@link ProgQuserProgPriv} - {@link #TRANSFORM_NONE}</li>
428      *   <li>{@link ProgQuserProgPrivVO} - {@link #TRANSFORM_PROGQUSERPROGPRIVVO}</li>
429      * </ul>
430      *
431      * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
432      *
433      * @param transform one of the constants declared in {@link fr.ifremer.quadrige3.core.dao.administration.program.ProgQuserProgPrivDao}
434      * @param entity an entity that was found
435      * @return the transformed entity (i.e. new value object, etc)
436      * @see #transformEntities(int,Collection)
437      */
438     public Object transformEntity(final int transform, final ProgQuserProgPriv entity);
439 
440     /**
441      * Transforms a collection of entities using the
442      * {@link #transformEntity(int,ProgQuserProgPriv)}
443      * method. This method does not instantiate a new collection.
444      * <p>
445      * This method is to be used internally only.
446      *
447      * @param transform one of the constants declared in <code>fr.ifremer.quadrige3.core.dao.administration.program.ProgQuserProgPrivDao</code>
448      * @param entities the collection of entities to transform
449      * @see #transformEntity(int,ProgQuserProgPriv)
450      */
451     public void transformEntities(final int transform, final Collection<?> entities);
452 
453     // spring-dao merge-point
454 }