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.referential.monitoringLocation.MonitoringLocation;
30  import fr.ifremer.quadrige3.core.vo.administration.program.MonLocProgVO;
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 lieux surveillés par un programme.
38   * @see MonLocProg
39   */
40  public interface MonLocProgDao
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 MonLocProg}
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 MonLocProgVO}.
67       */
68      public static final int TRANSFORM_MONLOCPROGVO = 1;
69  
70      /**
71       * Copies the fields of the specified entity to the target value object. This method is similar to
72       * toMonLocProgVO(), 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 toMonLocProgVO(
78          MonLocProg source,
79          MonLocProgVO target);
80  
81      /**
82       * Converts this DAO's entity to an object of type {@link MonLocProgVO}.
83       * @param entity
84       * @return MonLocProgVO
85       */
86      public MonLocProgVO toMonLocProgVO(MonLocProg entity);
87  
88      /**
89       * Converts this DAO's entity to a Collection of instances of type {@link MonLocProgVO}.
90       * @param entities
91       */
92      public Collection<MonLocProgVO> toMonLocProgVOCollection(Collection<?> entities);
93  
94      /**
95       * Converts this DAO's entity to an array of instances of type {@link MonLocProgVO}.
96       * @param entities
97       * @return MonLocProgVO[]
98       */
99      public MonLocProgVO[] toMonLocProgVOArray(Collection<?> entities);
100 
101     /**
102      * Copies the fields of {@link MonLocProgVO} 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 monLocProgVOToEntity(
109         MonLocProgVO source,
110         MonLocProg target,
111         boolean copyIfNull);
112 
113     /**
114      * Converts an instance of type {@link MonLocProgVO} to this DAO's entity.
115      * @param monLocProgVO
116      * @return MonLocProg
117      */
118     public MonLocProg monLocProgVOToEntity(MonLocProgVO monLocProgVO);
119 
120     /**
121      * Converts a Collection of instances of type {@link MonLocProgVO} to this
122      * DAO's entity.
123      * @param instances
124      */
125     public void monLocProgVOToEntityCollection(Collection<?> instances);
126 
127     /**
128      * Gets an instance of MonLocProg from the persistent store.
129      * @param monLocProgId
130      * @return MonLocProg
131      */
132     public MonLocProg get(Integer monLocProgId);
133 
134     /**
135      * <p>
136      * Does the same thing as {@link #get(Integer)} 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 monLocProgId 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, Integer monLocProgId);
149 
150     /**
151      * Loads an instance of MonLocProg from the persistent store.
152      * @param monLocProgId
153      * @return MonLocProg
154      */
155     public MonLocProg load(Integer monLocProgId);
156 
157     /**
158      * <p>
159      * Does the same thing as {@link #load(Integer)} 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 monLocProgId 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, Integer monLocProgId);
172 
173     /**
174      * Loads all entities of type {@link MonLocProg}.
175      *
176      * @return the loaded entities.
177      */
178     public Collection<MonLocProg> 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 MonLocProg and adds it to the persistent store.
226      * @param monLocProg
227      * @return MonLocProg
228      */
229     public MonLocProg create(MonLocProg monLocProg);
230 
231     /**
232      * <p>
233      * Does the same thing as {@link #create(MonLocProg)} 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 monLocProg
242      * @return Object
243      */
244     public Object create(int transform, MonLocProg monLocProg);
245 
246     /**
247      * Creates a new instance of MonLocProg and adds
248      * from the passed in <code>entities</code> collection
249      *
250      * @param entities the collection of MonLocProg
251      * instances to create.
252      *
253      * @return the created instances.
254      */
255     public Collection<MonLocProg> create(Collection<MonLocProg> entities);
256 
257     /**
258      * <p>
259      * Does the same thing as {@link #create(MonLocProg)} 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<MonLocProg> entities);
271 
272     /**
273      * <p>
274      * Creates a new <code>MonLocProg</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 MonLocProg
280      */
281     public MonLocProg 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 MonLocProg
296      */
297     public Object create(
298         int transform,
299         Timestamp updateDt);
300 
301     /**
302      * <p>
303      * Creates a new <code>MonLocProg</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 monitoringLocation
308      * @param program
309      * @return MonLocProg
310      */
311     public MonLocProg create(
312         MonitoringLocation monitoringLocation,
313         Program program);
314 
315     /**
316      * <p>
317      * Does the same thing as {@link #create()} with an
318      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
319      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
320      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
321      * transform the entity (into a value object for example). By default, transformation does
322      * not occur.
323      * </p>
324      * @param transform flag to determine transformation type.
325      * @param monitoringLocation
326      * @param program
327      * @return Object
328      */
329     public Object create(
330         int transform,
331         MonitoringLocation monitoringLocation,
332         Program program);
333 
334     /**
335      * Updates the <code>monLocProg</code> instance in the persistent store.
336      * @param monLocProg
337      */
338     public void update(MonLocProg monLocProg);
339 
340     /**
341      * Updates all instances in the <code>entities</code> collection in the persistent store.
342      * @param entities
343      */
344     public void update(Collection<MonLocProg> entities);
345 
346     /**
347      * Removes the instance of MonLocProg from the persistent store.
348      * @param monLocProg
349      */
350     public void remove(MonLocProg monLocProg);
351 
352     /**
353      * Removes the instance of MonLocProg having the given
354      * <code>identifier</code> from the persistent store.
355      * @param monLocProgId
356      */
357     public void remove(Integer monLocProgId);
358 
359     /**
360      * Removes all entities in the given <code>entities</code> collection.
361      * @param entities
362      */
363     public void remove(Collection<MonLocProg> entities);
364 
365 
366     /**
367      * Does the same thing as {@link #search(int, Search)} but with an
368      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
369      * limit your data to a specified page number and size.
370      *
371      * @param transform the transformation flag.
372      * @param pageNumber the page number in the data to retrieve
373      * @param pageSize the size of the page to retrieve.
374      * @param search the search object which provides the search parameters and pagination specification.
375      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
376      */
377     public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
378 
379     /**
380      * Does the same thing as {@link #search(Search)} but with an
381      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
382      * limit your data to a specified page number and size.
383      *
384      * @param pageNumber the page number in the data to retrieve
385      * @param pageSize the size of the page to retrieve.
386      * @param search the search object which provides the search parameters and pagination specification.
387      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
388      */
389     public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
390 
391     /**
392      * Does the same thing as {@link #search(Search)} but with an
393      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
394      * finder results will <strong>NOT</strong> be transformed during retrieval.
395      * If this flag is any of the other constants defined here
396      * then results <strong>WILL BE</strong> passed through an operation which can optionally
397      * transform the entities (into value objects for example). By default, transformation does
398      * not occur.
399      *
400      * @param transform the transformation flag.
401      * @param search the search object which provides the search parameters and pagination specification.
402      * @return any found results from the search.
403      */
404     public Set<?> search(final int transform, final Search search);
405 
406     /**
407      * Performs a search using the parameters specified in the given <code>search</code> object.
408      *
409      * @param search the search object which provides the search parameters and pagination specification.
410      * @return any found results from the search.
411      */
412     public Set<MonLocProg> search(final Search search);
413 
414     /**
415      * Allows transformation of entities into value objects
416      * (or something else for that matter), when the <code>transform</code>
417      * flag is set to one of the constants defined in <code>fr.ifremer.quadrige3.core.dao.administration.program.MonLocProgDao</code>, please note
418      * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
419      * will be returned.
420      * <p>
421      * This method will return instances of these types:
422      * <ul>
423      *   <li>{@link MonLocProg} - {@link #TRANSFORM_NONE}</li>
424      *   <li>{@link MonLocProgVO} - {@link #TRANSFORM_MONLOCPROGVO}</li>
425      * </ul>
426      *
427      * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
428      *
429      * @param transform one of the constants declared in {@link fr.ifremer.quadrige3.core.dao.administration.program.MonLocProgDao}
430      * @param entity an entity that was found
431      * @return the transformed entity (i.e. new value object, etc)
432      * @see #transformEntities(int,Collection)
433      */
434     public Object transformEntity(final int transform, final MonLocProg entity);
435 
436     /**
437      * Transforms a collection of entities using the
438      * {@link #transformEntity(int,MonLocProg)}
439      * method. This method does not instantiate a new collection.
440      * <p>
441      * This method is to be used internally only.
442      *
443      * @param transform one of the constants declared in <code>fr.ifremer.quadrige3.core.dao.administration.program.MonLocProgDao</code>
444      * @param entities the collection of entities to transform
445      * @see #transformEntity(int,MonLocProg)
446      */
447     public void transformEntities(final int transform, final Collection<?> entities);
448 
449     // spring-dao merge-point
450 }