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.data.aquaculture;
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.QualityFlag;
30  import fr.ifremer.quadrige3.core.dao.referential.taxon.ReferenceTaxon;
31  import java.sql.Timestamp;
32  import java.util.Collection;
33  import java.util.Date;
34  import java.util.Set;
35  import org.andromda.spring.PaginationResult;
36  
37  /**
38   * Pour les données aquacoles de nombreuses études consiste à voir les évolutions de plusieurs
39   * paramètres sur une même population de mollusques répartis en lots sur le littoral français. Cela
40   * permet de comparer les évolutions liées seulement au site. On part d'un ensemble de mollusques,
41   * que l'on appelle population initiale, au niveau national et l'on repartit cet ensemble en lots
42   * sur différents lieux de mesures.
43   * @see InitialPopulation
44   */
45  public interface InitialPopulationDao
46  {
47      /**
48       * This constant is used as a transformation flag; entities can be converted automatically into value objects
49       * or other types, different methods in a class implementing this interface support this feature: look for
50       * an <code>int</code> parameter called <code>transform</code>.
51       * <p>
52       * This specific flag denotes no transformation will occur.
53       */
54      public static final int TRANSFORM_NONE = 0;
55  
56  
57      /**
58       * Transforms the given results to a collection of {@link InitialPopulation}
59       * instances (this is useful when the returned results contains a row of data and you want just entities only).
60       *
61       * @param results the query results.
62       */
63      public void toEntities(final Collection<?> results);
64  
65      /**
66       * Gets an instance of InitialPopulation from the persistent store.
67       * @param initPopId
68       * @return InitialPopulation
69       */
70      public InitialPopulation get(Integer initPopId);
71  
72      /**
73       * <p>
74       * Does the same thing as {@link #get(Integer)} with an
75       * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
76       * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
77       * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
78       * optionally transform the entity (into a value object for example). By default, transformation does
79       * not occur.
80       * </p>
81       *
82       * @param transform flag to determine transformation type.
83       * @param initPopId the identifier of the entity to get.
84       * @return either the entity or the object transformed from the entity.
85       */
86      public Object get(int transform, Integer initPopId);
87  
88      /**
89       * Loads an instance of InitialPopulation from the persistent store.
90       * @param initPopId
91       * @return InitialPopulation
92       */
93      public InitialPopulation load(Integer initPopId);
94  
95      /**
96       * <p>
97       * Does the same thing as {@link #load(Integer)} with an
98       * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
99       * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
100      * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
101      * optionally transform the entity (into a value object for example). By default, transformation does
102      * not occur.
103      * </p>
104      *
105      * @param transform flag to determine transformation type.
106      * @param initPopId the identifier of the entity to load.
107      * @return either the entity or the object transformed from the entity.
108      */
109     public Object load(int transform, Integer initPopId);
110 
111     /**
112      * Loads all entities of type {@link InitialPopulation}.
113      *
114      * @return the loaded entities.
115      */
116     public Collection<InitialPopulation> loadAll();
117 
118     /**
119      * <p>
120      * Does the same thing as {@link #loadAll()} with an
121      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
122      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
123      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
124      * transform the entity (into a value object for example). By default, transformation does
125      * not occur.
126      * </p>
127      *
128      * @param transform the flag indicating what transformation to use.
129      * @return the loaded entities.
130      */
131     public Collection<?> loadAll(final int transform);
132 
133     /**
134      * <p>
135      * Does the same thing as {@link #loadAll()} with an
136      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
137      * 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
138      * page retrieved.
139      * </p>
140      *
141      * @param pageNumber the page number to retrieve when paging results.
142      * @param pageSize the size of the page to retrieve when paging results.
143      * @return the loaded entities.
144      */
145     public Collection<?> loadAll(final int pageNumber, final int pageSize);
146 
147     /**
148      * <p>
149      * Does the same thing as {@link #loadAll(int)} with an
150      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
151      * 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
152      * page retrieved.
153      * </p>
154      *
155      * @param transform the flag indicating what transformation to use.
156      * @param pageNumber the page number to retrieve when paging results.
157      * @param pageSize the size of the page to retrieve when paging results.
158      * @return the loaded entities.
159      */
160     public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
161 
162     /**
163      * Creates an instance of InitialPopulation and adds it to the persistent store.
164      * @param initialPopulation
165      * @return InitialPopulation
166      */
167     public InitialPopulation create(InitialPopulation initialPopulation);
168 
169     /**
170      * <p>
171      * Does the same thing as {@link #create(InitialPopulation)} with an
172      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
173      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
174      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
175      * transform the entity (into a value object for example). By default, transformation does
176      * not occur.
177      * </p>
178      * @param transform
179      * @param initialPopulation
180      * @return Object
181      */
182     public Object create(int transform, InitialPopulation initialPopulation);
183 
184     /**
185      * Creates a new instance of InitialPopulation and adds
186      * from the passed in <code>entities</code> collection
187      *
188      * @param entities the collection of InitialPopulation
189      * instances to create.
190      *
191      * @return the created instances.
192      */
193     public Collection<InitialPopulation> create(Collection<InitialPopulation> entities);
194 
195     /**
196      * <p>
197      * Does the same thing as {@link #create(InitialPopulation)} with an
198      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
199      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
200      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
201      * transform the entities (into value objects for example). By default, transformation does
202      * not occur.
203      * </p>
204      * @param transform
205      * @param entities
206      * @return Collection
207      */
208     public Collection<?> create(int transform, Collection<InitialPopulation> entities);
209 
210     /**
211      * <p>
212      * Creates a new <code>InitialPopulation</code>
213      * instance from <strong>all</strong> attributes and adds it to
214      * the persistent store.
215      * </p>
216      * @param initPopNm Libellé de la population initiale
217      * @param initPopLb Mnémonique de la population initiale
218      * @param initPopCm Commentaire sur la population initiale
219      * @param initPopQualifDt Date de qualification de la population initiale
220      * @param initPopQualifCm Commentaire de qualification de la population initiale
221      * @param initPopValidDt Date de validation de la population initiale
222      * @param initPopControlDt Date de controle de la population initiale
223      * @param initPopStartDt Date de mise à disposition de la population initiale
224      * @param initPopBiometricIndivNb Nombre d'individus pour les mesures de biométrie
225      * @param updateDt Date de maj
226      * @param remoteId 
227      * @return InitialPopulation
228      */
229     public InitialPopulation create(
230         String initPopNm,
231         String initPopLb,
232         String initPopCm,
233         Date initPopQualifDt,
234         String initPopQualifCm,
235         Date initPopValidDt,
236         Date initPopControlDt,
237         Date initPopStartDt,
238         Integer initPopBiometricIndivNb,
239         Timestamp updateDt,
240         Integer remoteId);
241 
242     /**
243      * <p>
244      * Does the same thing as {@link #create(String, String, String, Date, String, Date, Date, Date, Integer, Timestamp, Integer)} with an
245      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
246      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
247      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
248      * transform the entity (into a value object for example). By default, transformation does
249      * not occur.
250      * </p>
251      * @param transform
252      * @param initPopNm Libellé de la population initiale
253      * @param initPopLb Mnémonique de la population initiale
254      * @param initPopCm Commentaire sur la population initiale
255      * @param initPopQualifDt Date de qualification de la population initiale
256      * @param initPopQualifCm Commentaire de qualification de la population initiale
257      * @param initPopValidDt Date de validation de la population initiale
258      * @param initPopControlDt Date de controle de la population initiale
259      * @param initPopStartDt Date de mise à disposition de la population initiale
260      * @param initPopBiometricIndivNb Nombre d'individus pour les mesures de biométrie
261      * @param updateDt Date de maj
262      * @param remoteId 
263      * @return InitialPopulation
264      */
265     public Object create(
266         int transform,
267         String initPopNm,
268         String initPopLb,
269         String initPopCm,
270         Date initPopQualifDt,
271         String initPopQualifCm,
272         Date initPopValidDt,
273         Date initPopControlDt,
274         Date initPopStartDt,
275         Integer initPopBiometricIndivNb,
276         Timestamp updateDt,
277         Integer remoteId);
278 
279     /**
280      * <p>
281      * Creates a new <code>InitialPopulation</code>
282      * instance from only <strong>required</strong> properties (attributes
283      * and association ends) and adds it to the persistent store.
284      * </p>
285      * @param initPopBiometricIndivNb
286      * @param initPopLb
287      * @param initPopNm
288      * @param initPopStartDt
289      * @param ageGroup
290      * @param qualityFlag
291      * @param referenceTaxon
292      * @return InitialPopulation
293      */
294     public InitialPopulation create(
295         Integer initPopBiometricIndivNb,
296         String initPopLb,
297         String initPopNm,
298         Date initPopStartDt,
299         AgeGroup ageGroup,
300         QualityFlag qualityFlag,
301         ReferenceTaxon referenceTaxon);
302 
303     /**
304      * <p>
305      * Does the same thing as {@link #create(String, String, Date, Integer)} with an
306      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
307      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
308      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
309      * transform the entity (into a value object for example). By default, transformation does
310      * not occur.
311      * </p>
312      * @param transform flag to determine transformation type.
313      * @param initPopBiometricIndivNb
314      * @param initPopLb
315      * @param initPopNm
316      * @param initPopStartDt
317      * @param ageGroup
318      * @param qualityFlag
319      * @param referenceTaxon
320      * @return Object
321      */
322     public Object create(
323         int transform,
324         Integer initPopBiometricIndivNb,
325         String initPopLb,
326         String initPopNm,
327         Date initPopStartDt,
328         AgeGroup ageGroup,
329         QualityFlag qualityFlag,
330         ReferenceTaxon referenceTaxon);
331 
332     /**
333      * Updates the <code>initialPopulation</code> instance in the persistent store.
334      * @param initialPopulation
335      */
336     public void update(InitialPopulation initialPopulation);
337 
338     /**
339      * Updates all instances in the <code>entities</code> collection in the persistent store.
340      * @param entities
341      */
342     public void update(Collection<InitialPopulation> entities);
343 
344     /**
345      * Removes the instance of InitialPopulation from the persistent store.
346      * @param initialPopulation
347      */
348     public void remove(InitialPopulation initialPopulation);
349 
350     /**
351      * Removes the instance of InitialPopulation having the given
352      * <code>identifier</code> from the persistent store.
353      * @param initPopId
354      */
355     public void remove(Integer initPopId);
356 
357     /**
358      * Removes all entities in the given <code>entities</code> collection.
359      * @param entities
360      */
361     public void remove(Collection<InitialPopulation> entities);
362 
363 
364     /**
365      * Does the same thing as {@link #search(int, Search)} but with an
366      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
367      * limit your data to a specified page number and size.
368      *
369      * @param transform the transformation flag.
370      * @param pageNumber the page number in the data to retrieve
371      * @param pageSize the size of the page to retrieve.
372      * @param search the search object which provides the search parameters and pagination specification.
373      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
374      */
375     public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
376 
377     /**
378      * Does the same thing as {@link #search(Search)} but with an
379      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
380      * limit your data to a specified page number and size.
381      *
382      * @param pageNumber the page number in the data to retrieve
383      * @param pageSize the size of the page to retrieve.
384      * @param search the search object which provides the search parameters and pagination specification.
385      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
386      */
387     public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
388 
389     /**
390      * Does the same thing as {@link #search(Search)} but with an
391      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
392      * finder results will <strong>NOT</strong> be transformed during retrieval.
393      * If this flag is any of the other constants defined here
394      * then results <strong>WILL BE</strong> passed through an operation which can optionally
395      * transform the entities (into value objects for example). By default, transformation does
396      * not occur.
397      *
398      * @param transform the transformation flag.
399      * @param search the search object which provides the search parameters and pagination specification.
400      * @return any found results from the search.
401      */
402     public Set<?> search(final int transform, final Search search);
403 
404     /**
405      * Performs a search using the parameters specified in the given <code>search</code> object.
406      *
407      * @param search the search object which provides the search parameters and pagination specification.
408      * @return any found results from the search.
409      */
410     public Set<InitialPopulation> search(final Search search);
411 
412     /**
413      * Allows transformation of entities into value objects
414      * (or something else for that matter), when the <code>transform</code>
415      * flag is set to one of the constants defined in <code>fr.ifremer.quadrige3.core.dao.data.aquaculture.InitialPopulationDao</code>, please note
416      * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
417      * will be returned.
418      *
419      * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
420      *
421      * @param transform one of the constants declared in {@link fr.ifremer.quadrige3.core.dao.data.aquaculture.InitialPopulationDao}
422      * @param entity an entity that was found
423      * @return the transformed entity (i.e. new value object, etc)
424      * @see #transformEntities(int,Collection)
425      */
426     public Object transformEntity(final int transform, final InitialPopulation entity);
427 
428     /**
429      * Transforms a collection of entities using the
430      * {@link #transformEntity(int,InitialPopulation)}
431      * method. This method does not instantiate a new collection.
432      * <p>
433      * This method is to be used internally only.
434      *
435      * @param transform one of the constants declared in <code>fr.ifremer.quadrige3.core.dao.data.aquaculture.InitialPopulationDao</code>
436      * @param entities the collection of entities to transform
437      * @see #transformEntity(int,InitialPopulation)
438      */
439     public void transformEntities(final int transform, final Collection<?> entities);
440 
441     // spring-dao merge-point
442 }