001// license-header java merge-point
002//
003// Attention: Generated code! Do not modify by hand!
004// Generated by: SpringDao.vsl in andromda-spring-cartridge.
005//
006package fr.ifremer.adagio.core.dao.referential.pmfm;
007
008/*
009 * #%L
010 * SIH-Adagio :: Core
011 * $Id:$
012 * $HeadURL:$
013 * %%
014 * Copyright (C) 2012 - 2014 Ifremer
015 * %%
016 * This program is free software: you can redistribute it and/or modify
017 * it under the terms of the GNU Affero General Public License as published by
018 * the Free Software Foundation, either version 3 of the License, or
019 * (at your option) any later version.
020 * 
021 * This program is distributed in the hope that it will be useful,
022 * but WITHOUT ANY WARRANTY; without even the implied warranty of
023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
024 * GNU General Public License for more details.
025 * 
026 * You should have received a copy of the GNU Affero General Public License
027 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
028 * #L%
029 */
030
031import fr.ifremer.adagio.core.dao.Search;
032import fr.ifremer.adagio.core.dao.referential.Status;
033import java.sql.Timestamp;
034import java.util.Collection;
035import java.util.Date;
036import java.util.Set;
037import org.andromda.spring.PaginationResult;
038
039/**
040 * Le support est un composant du milieu sur lequel porte l'investigation. Les supports sont, par
041 * exemple :
042 * - un engin,
043 * - la mer (ou autre environnement),
044 * - bivalve (moule, huître, coque...)
045 * - crustacé (crevette...)
046 * - poisson (merlu, sardine...)
047 * - gastéropode (bigorneau, littorine...)
048 * - echinoderme    (oursin...)
049 * - masse d'eau, eau brute
050 * - eau filtrée
051 * - ...
052 * Le support ne correspond pas au support réellement analysé. En effet, il peut s'agir d'une
053 * analyse sur une fraction du support (par exemple, pour le poisson, l'otolite,… ou pour un engin,
054 * le bras).
055 * Nombre de lignes : 20
056 * @see Matrix
057 */
058public interface MatrixDao
059{
060    /**
061     * This constant is used as a transformation flag; entities can be converted automatically into value objects
062     * or other types, different methods in a class implementing this interface support this feature: look for
063     * an <code>int</code> parameter called <code>transform</code>.
064     * <p>
065     * This specific flag denotes no transformation will occur.
066     */
067    public static final int TRANSFORM_NONE = 0;
068
069
070    /**
071     * Transforms the given results to a collection of {@link Matrix}
072     * instances (this is useful when the returned results contains a row of data and you want just entities only).
073     *
074     * @param results the query results.
075     */
076    public void toEntities(final Collection<?> results);
077
078    /**
079     * Gets an instance of Matrix from the persistent store.
080     * @param id
081     * @return Matrix
082     */
083    public Matrix get(Integer id);
084
085    /**
086     * <p>
087     * Does the same thing as {@link #get(Integer)} with an
088     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
089     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
090     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
091     * optionally transform the entity (into a value object for example). By default, transformation does
092     * not occur.
093     * </p>
094     *
095     * @param transform flag to determine transformation type.
096     * @param id the identifier of the entity to get.
097     * @return either the entity or the object transformed from the entity.
098     */
099    public Object get(int transform, Integer id);
100
101    /**
102     * Loads an instance of Matrix from the persistent store.
103     * @param id
104     * @return Matrix
105     */
106    public Matrix load(Integer id);
107
108    /**
109     * <p>
110     * Does the same thing as {@link #load(Integer)} with an
111     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
112     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
113     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
114     * optionally transform the entity (into a value object for example). By default, transformation does
115     * not occur.
116     * </p>
117     *
118     * @param transform flag to determine transformation type.
119     * @param id the identifier of the entity to load.
120     * @return either the entity or the object transformed from the entity.
121     */
122    public Object load(int transform, Integer id);
123
124    /**
125     * Loads all entities of type {@link Matrix}.
126     *
127     * @return the loaded entities.
128     */
129    public Collection<Matrix> loadAll();
130
131    /**
132     * <p>
133     * Does the same thing as {@link #loadAll()} with an
134     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
135     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
136     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
137     * transform the entity (into a value object for example). By default, transformation does
138     * not occur.
139     * </p>
140     *
141     * @param transform the flag indicating what transformation to use.
142     * @return the loaded entities.
143     */
144    public Collection<?> loadAll(final int transform);
145
146    /**
147     * <p>
148     * Does the same thing as {@link #loadAll()} with an
149     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
150     * 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
151     * page retrieved.
152     * </p>
153     *
154     * @param pageNumber the page number to retrieve when paging results.
155     * @param pageSize the size of the page to retrieve when paging results.
156     * @return the loaded entities.
157     */
158    public Collection<?> loadAll(final int pageNumber, final int pageSize);
159
160    /**
161     * <p>
162     * Does the same thing as {@link #loadAll(int)} with an
163     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
164     * 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
165     * page retrieved.
166     * </p>
167     *
168     * @param transform the flag indicating what transformation to use.
169     * @param pageNumber the page number to retrieve when paging results.
170     * @param pageSize the size of the page to retrieve when paging results.
171     * @return the loaded entities.
172     */
173    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
174
175    /**
176     * Creates an instance of Matrix and adds it to the persistent store.
177     * @param matrix
178     * @return Matrix
179     */
180    public Matrix create(Matrix matrix);
181
182    /**
183     * <p>
184     * Does the same thing as {@link #create(Matrix)} with an
185     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
186     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
187     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
188     * transform the entity (into a value object for example). By default, transformation does
189     * not occur.
190     * </p>
191     * @param transform
192     * @param matrix
193     * @return Object
194     */
195    public Object create(int transform, Matrix matrix);
196
197    /**
198     * Creates a new instance of Matrix and adds
199     * from the passed in <code>entities</code> collection
200     *
201     * @param entities the collection of Matrix
202     * instances to create.
203     *
204     * @return the created instances.
205     */
206    public Collection<Matrix> create(Collection<Matrix> entities);
207
208    /**
209     * <p>
210     * Does the same thing as {@link #create(Matrix)} with an
211     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
212     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
213     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
214     * transform the entities (into value objects for example). By default, transformation does
215     * not occur.
216     * </p>
217     * @param transform
218     * @param entities
219     * @return Collection
220     */
221    public Collection<?> create(int transform, Collection<Matrix> entities);
222
223    /**
224     * <p>
225     * Creates a new <code>Matrix</code>
226     * instance from <strong>all</strong> attributes and adds it to
227     * the persistent store.
228     * </p>
229     * @param name Description courte du support.
230     * @param description Description longue du support.
231     * @param creationDate Date de création système du support. Cette date est renseignée automatiquement.
232     * @param comments 
233     * @param updateDate Date de mise à jour système du support. Cette date est renseignée automatiquement.
234     * @return Matrix
235     */
236    public Matrix create(
237        String name,
238        String description,
239        Date creationDate,
240        String comments,
241        Timestamp updateDate);
242
243    /**
244     * <p>
245     * Does the same thing as {@link #create(String, String, Date, String, Timestamp)} with an
246     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
247     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
248     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
249     * transform the entity (into a value object for example). By default, transformation does
250     * not occur.
251     * </p>
252     * @param transform
253     * @param name Description courte du support.
254     * @param description Description longue du support.
255     * @param creationDate Date de création système du support. Cette date est renseignée automatiquement.
256     * @param comments 
257     * @param updateDate Date de mise à jour système du support. Cette date est renseignée automatiquement.
258     * @return Matrix
259     */
260    public Object create(
261        int transform,
262        String name,
263        String description,
264        Date creationDate,
265        String comments,
266        Timestamp updateDate);
267
268    /**
269     * <p>
270     * Creates a new <code>Matrix</code>
271     * instance from only <strong>required</strong> properties (attributes
272     * and association ends) and adds it to the persistent store.
273     * </p>
274     * @param creationDate
275     * @param fractions
276     * @param name
277     * @param status
278     * @param updateDate
279     * @return Matrix
280     */
281    public Matrix create(
282        Date creationDate,
283        Collection<Fraction> fractions,
284        String name,
285        Status status,
286        Timestamp updateDate);
287
288    /**
289     * <p>
290     * Does the same thing as {@link #create(String, Date, Timestamp)} with an
291     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
292     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
293     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
294     * transform the entity (into a value object for example). By default, transformation does
295     * not occur.
296     * </p>
297     * @param transform flag to determine transformation type.
298     * @param creationDate
299     * @param fractions
300     * @param name
301     * @param status
302     * @param updateDate
303     * @return Object
304     */
305    public Object create(
306        int transform,
307        Date creationDate,
308        Collection<Fraction> fractions,
309        String name,
310        Status status,
311        Timestamp updateDate);
312
313    /**
314     * Updates the <code>matrix</code> instance in the persistent store.
315     * @param matrix
316     */
317    public void update(Matrix matrix);
318
319    /**
320     * Updates all instances in the <code>entities</code> collection in the persistent store.
321     * @param entities
322     */
323    public void update(Collection<Matrix> entities);
324
325    /**
326     * Removes the instance of Matrix from the persistent store.
327     * @param matrix
328     */
329    public void remove(Matrix matrix);
330
331    /**
332     * Removes the instance of Matrix having the given
333     * <code>identifier</code> from the persistent store.
334     * @param id
335     */
336    public void remove(Integer id);
337
338    /**
339     * Removes all entities in the given <code>entities</code> collection.
340     * @param entities
341     */
342    public void remove(Collection<Matrix> entities);
343
344
345    /**
346     * Does the same thing as {@link #search(int, Search)} but with an
347     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
348     * limit your data to a specified page number and size.
349     *
350     * @param transform the transformation flag.
351     * @param pageNumber the page number in the data to retrieve
352     * @param pageSize the size of the page to retrieve.
353     * @param search the search object which provides the search parameters and pagination specification.
354     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
355     */
356    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
357
358    /**
359     * Does the same thing as {@link #search(Search)} but with an
360     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
361     * limit your data to a specified page number and size.
362     *
363     * @param pageNumber the page number in the data to retrieve
364     * @param pageSize the size of the page to retrieve.
365     * @param search the search object which provides the search parameters and pagination specification.
366     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
367     */
368    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
369
370    /**
371     * Does the same thing as {@link #search(Search)} but with an
372     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
373     * finder results will <strong>NOT</strong> be transformed during retrieval.
374     * If this flag is any of the other constants defined here
375     * then results <strong>WILL BE</strong> passed through an operation which can optionally
376     * transform the entities (into value objects for example). By default, transformation does
377     * not occur.
378     *
379     * @param transform the transformation flag.
380     * @param search the search object which provides the search parameters and pagination specification.
381     * @return any found results from the search.
382     */
383    public Set<?> search(final int transform, final Search search);
384
385    /**
386     * Performs a search using the parameters specified in the given <code>search</code> object.
387     *
388     * @param search the search object which provides the search parameters and pagination specification.
389     * @return any found results from the search.
390     */
391    public Set<Matrix> search(final Search search);
392
393    /**
394     * Allows transformation of entities into value objects
395     * (or something else for that matter), when the <code>transform</code>
396     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.pmfm.MatrixDao</code>, please note
397     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
398     * will be returned.
399     *
400     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
401     *
402     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.pmfm.MatrixDao}
403     * @param entity an entity that was found
404     * @return the transformed entity (i.e. new value object, etc)
405     * @see #transformEntities(int,Collection)
406     */
407    public Object transformEntity(final int transform, final Matrix entity);
408
409    /**
410     * Transforms a collection of entities using the
411     * {@link #transformEntity(int,Matrix)}
412     * method. This method does not instantiate a new collection.
413     * <p>
414     * This method is to be used internally only.
415     *
416     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.pmfm.MatrixDao</code>
417     * @param entities the collection of entities to transform
418     * @see #transformEntity(int,Matrix)
419     */
420    public void transformEntities(final int transform, final Collection<?> entities);
421
422    // spring-dao merge-point
423}