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.data.transshipment;
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 com.vividsolutions.jts.geom.Point;
032import fr.ifremer.adagio.core.dao.Search;
033import fr.ifremer.adagio.core.dao.administration.programStrategy.Program;
034import fr.ifremer.adagio.core.dao.administration.user.Department;
035import fr.ifremer.adagio.core.dao.data.vessel.Vessel;
036import fr.ifremer.adagio.core.dao.referential.QualityFlag;
037import java.sql.Timestamp;
038import java.util.Collection;
039import java.util.Date;
040import java.util.Set;
041import org.andromda.spring.PaginationResult;
042
043/**
044 * Transbordement d'un produit (capturé) d'un navire à l'autre.
045 * Pour connaitre le navire d'origine des produits (celui qui les possédait avant le
046 * transbordement), il faut utiliser les liens vers FishingTrip ou MetaFishingTrip, qui possèdent un
047 * lien vers Vessel.
048 * @see Transshipment
049 */
050public interface TransshipmentDao
051{
052    /**
053     * This constant is used as a transformation flag; entities can be converted automatically into value objects
054     * or other types, different methods in a class implementing this interface support this feature: look for
055     * an <code>int</code> parameter called <code>transform</code>.
056     * <p>
057     * This specific flag denotes no transformation will occur.
058     */
059    public static final int TRANSFORM_NONE = 0;
060
061
062    /**
063     * Transforms the given results to a collection of {@link Transshipment}
064     * instances (this is useful when the returned results contains a row of data and you want just entities only).
065     *
066     * @param results the query results.
067     */
068    public void toEntities(final Collection<?> results);
069
070    /**
071     * Gets an instance of Transshipment from the persistent store.
072     * @param id
073     * @return Transshipment
074     */
075    public Transshipment get(Integer id);
076
077    /**
078     * <p>
079     * Does the same thing as {@link #get(Integer)} with an
080     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
081     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
082     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
083     * optionally transform the entity (into a value object for example). By default, transformation does
084     * not occur.
085     * </p>
086     *
087     * @param transform flag to determine transformation type.
088     * @param id the identifier of the entity to get.
089     * @return either the entity or the object transformed from the entity.
090     */
091    public Object get(int transform, Integer id);
092
093    /**
094     * Loads an instance of Transshipment from the persistent store.
095     * @param id
096     * @return Transshipment
097     */
098    public Transshipment load(Integer id);
099
100    /**
101     * <p>
102     * Does the same thing as {@link #load(Integer)} with an
103     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
104     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
105     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
106     * optionally transform the entity (into a value object for example). By default, transformation does
107     * not occur.
108     * </p>
109     *
110     * @param transform flag to determine transformation type.
111     * @param id the identifier of the entity to load.
112     * @return either the entity or the object transformed from the entity.
113     */
114    public Object load(int transform, Integer id);
115
116    /**
117     * Loads all entities of type {@link Transshipment}.
118     *
119     * @return the loaded entities.
120     */
121    public Collection<Transshipment> loadAll();
122
123    /**
124     * <p>
125     * Does the same thing as {@link #loadAll()} with an
126     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
127     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
128     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
129     * transform the entity (into a value object for example). By default, transformation does
130     * not occur.
131     * </p>
132     *
133     * @param transform the flag indicating what transformation to use.
134     * @return the loaded entities.
135     */
136    public Collection<?> loadAll(final int transform);
137
138    /**
139     * <p>
140     * Does the same thing as {@link #loadAll()} with an
141     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
142     * 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
143     * page retrieved.
144     * </p>
145     *
146     * @param pageNumber the page number to retrieve when paging results.
147     * @param pageSize the size of the page to retrieve when paging results.
148     * @return the loaded entities.
149     */
150    public Collection<?> loadAll(final int pageNumber, final int pageSize);
151
152    /**
153     * <p>
154     * Does the same thing as {@link #loadAll(int)} with an
155     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
156     * 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
157     * page retrieved.
158     * </p>
159     *
160     * @param transform the flag indicating what transformation to use.
161     * @param pageNumber the page number to retrieve when paging results.
162     * @param pageSize the size of the page to retrieve when paging results.
163     * @return the loaded entities.
164     */
165    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
166
167    /**
168     * Creates an instance of Transshipment and adds it to the persistent store.
169     * @param transshipment
170     * @return Transshipment
171     */
172    public Transshipment create(Transshipment transshipment);
173
174    /**
175     * <p>
176     * Does the same thing as {@link #create(Transshipment)} with an
177     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
178     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
179     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
180     * transform the entity (into a value object for example). By default, transformation does
181     * not occur.
182     * </p>
183     * @param transform
184     * @param transshipment
185     * @return Object
186     */
187    public Object create(int transform, Transshipment transshipment);
188
189    /**
190     * Creates a new instance of Transshipment and adds
191     * from the passed in <code>entities</code> collection
192     *
193     * @param entities the collection of Transshipment
194     * instances to create.
195     *
196     * @return the created instances.
197     */
198    public Collection<Transshipment> create(Collection<Transshipment> entities);
199
200    /**
201     * <p>
202     * Does the same thing as {@link #create(Transshipment)} with an
203     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
204     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
205     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
206     * transform the entities (into value objects for example). By default, transformation does
207     * not occur.
208     * </p>
209     * @param transform
210     * @param entities
211     * @return Collection
212     */
213    public Collection<?> create(int transform, Collection<Transshipment> entities);
214
215    /**
216     * <p>
217     * Creates a new <code>Transshipment</code>
218     * instance from <strong>all</strong> attributes and adds it to
219     * the persistent store.
220     * </p>
221     * @param transshipmentDateTime Rang du transbordement, utilisé quand plusieurs transbordements ont eu lieu le meme jour pour une
222meme navire, et que l'heure de landingDateTime ne permet pas de distinguer les transbordements entre
223eux.
224Utiliser pour SACAPT : l'ordre es alors celui de présence dans le fichier d'origine.
225     * @param rankOrder <html>
226<head>
227</head>
228<body>
229<p>
230Rang du transbordement, utilis&#233; quand plusieurs transbordements ont
231eu lieu le meme jour pour une meme navire, et que l'heure de <i>landingDateTime</i>
232ne permet pas de distinguer les d&#233;barquement entre eux.<br><br>Utiliser
233pour SACAPT : l'ordre es alors celui de pr&#233;sence dans le fichier
234d'origine.
235</p>
236</body>
237</html>
238     * @param comments 
239     * @param creationDate 
240     * @param controlDate 
241     * @param qualificationDate 
242     * @param qualificationComments 
243     * @param updateDate 
244     * @param position Geometry of the transshipment (Point)
245     * @return Transshipment
246     */
247    public Transshipment create(
248        Date transshipmentDateTime,
249        Short rankOrder,
250        String comments,
251        Date creationDate,
252        Date controlDate,
253        Date qualificationDate,
254        String qualificationComments,
255        Timestamp updateDate,
256        Point position);
257
258    /**
259     * <p>
260     * Does the same thing as {@link #create(Date, Short, String, Date, Date, Date, String, Timestamp, Point)} with an
261     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
262     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
263     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
264     * transform the entity (into a value object for example). By default, transformation does
265     * not occur.
266     * </p>
267     * @param transform
268     * @param transshipmentDateTime Rang du transbordement, utilisé quand plusieurs transbordements ont eu lieu le meme jour pour une
269meme navire, et que l'heure de landingDateTime ne permet pas de distinguer les transbordements entre
270eux.
271Utiliser pour SACAPT : l'ordre es alors celui de présence dans le fichier d'origine.
272     * @param rankOrder <html>
273<head>
274</head>
275<body>
276<p>
277Rang du transbordement, utilis&#233; quand plusieurs transbordements ont
278eu lieu le meme jour pour une meme navire, et que l'heure de <i>landingDateTime</i>
279ne permet pas de distinguer les d&#233;barquement entre eux.<br><br>Utiliser
280pour SACAPT : l'ordre es alors celui de pr&#233;sence dans le fichier
281d'origine.
282</p>
283</body>
284</html>
285     * @param comments 
286     * @param creationDate 
287     * @param controlDate 
288     * @param qualificationDate 
289     * @param qualificationComments 
290     * @param updateDate 
291     * @param position Geometry of the transshipment (Point)
292     * @return Transshipment
293     */
294    public Object create(
295        int transform,
296        Date transshipmentDateTime,
297        Short rankOrder,
298        String comments,
299        Date creationDate,
300        Date controlDate,
301        Date qualificationDate,
302        String qualificationComments,
303        Timestamp updateDate,
304        Point position);
305
306    /**
307     * <p>
308     * Creates a new <code>Transshipment</code>
309     * instance from only <strong>required</strong> properties (attributes
310     * and association ends) and adds it to the persistent store.
311     * </p>
312     * @param creationDate
313     * @param fromVessel
314     * @param program
315     * @param qualityFlag
316     * @param recorderDepartment
317     * @param toVessel
318     * @param transshipmentDateTime
319     * @param updateDate
320     * @return Transshipment
321     */
322    public Transshipment create(
323        Date creationDate,
324        Vessel fromVessel,
325        Program program,
326        QualityFlag qualityFlag,
327        Department recorderDepartment,
328        Vessel toVessel,
329        Date transshipmentDateTime,
330        Timestamp updateDate);
331
332    /**
333     * <p>
334     * Does the same thing as {@link #create(Date, Date, Timestamp)} with an
335     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
336     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
337     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
338     * transform the entity (into a value object for example). By default, transformation does
339     * not occur.
340     * </p>
341     * @param transform flag to determine transformation type.
342     * @param creationDate
343     * @param fromVessel
344     * @param program
345     * @param qualityFlag
346     * @param recorderDepartment
347     * @param toVessel
348     * @param transshipmentDateTime
349     * @param updateDate
350     * @return Object
351     */
352    public Object create(
353        int transform,
354        Date creationDate,
355        Vessel fromVessel,
356        Program program,
357        QualityFlag qualityFlag,
358        Department recorderDepartment,
359        Vessel toVessel,
360        Date transshipmentDateTime,
361        Timestamp updateDate);
362
363    /**
364     * Updates the <code>transshipment</code> instance in the persistent store.
365     * @param transshipment
366     */
367    public void update(Transshipment transshipment);
368
369    /**
370     * Updates all instances in the <code>entities</code> collection in the persistent store.
371     * @param entities
372     */
373    public void update(Collection<Transshipment> entities);
374
375    /**
376     * Removes the instance of Transshipment from the persistent store.
377     * @param transshipment
378     */
379    public void remove(Transshipment transshipment);
380
381    /**
382     * Removes the instance of Transshipment having the given
383     * <code>identifier</code> from the persistent store.
384     * @param id
385     */
386    public void remove(Integer id);
387
388    /**
389     * Removes all entities in the given <code>entities</code> collection.
390     * @param entities
391     */
392    public void remove(Collection<Transshipment> entities);
393
394
395    /**
396     * Does the same thing as {@link #search(int, Search)} but with an
397     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
398     * limit your data to a specified page number and size.
399     *
400     * @param transform the transformation flag.
401     * @param pageNumber the page number in the data to retrieve
402     * @param pageSize the size of the page to retrieve.
403     * @param search the search object which provides the search parameters and pagination specification.
404     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
405     */
406    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
407
408    /**
409     * Does the same thing as {@link #search(Search)} but with an
410     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
411     * limit your data to a specified page number and size.
412     *
413     * @param pageNumber the page number in the data to retrieve
414     * @param pageSize the size of the page to retrieve.
415     * @param search the search object which provides the search parameters and pagination specification.
416     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
417     */
418    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
419
420    /**
421     * Does the same thing as {@link #search(Search)} but with an
422     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
423     * finder results will <strong>NOT</strong> be transformed during retrieval.
424     * If this flag is any of the other constants defined here
425     * then results <strong>WILL BE</strong> passed through an operation which can optionally
426     * transform the entities (into value objects for example). By default, transformation does
427     * not occur.
428     *
429     * @param transform the transformation flag.
430     * @param search the search object which provides the search parameters and pagination specification.
431     * @return any found results from the search.
432     */
433    public Set<?> search(final int transform, final Search search);
434
435    /**
436     * Performs a search using the parameters specified in the given <code>search</code> object.
437     *
438     * @param search the search object which provides the search parameters and pagination specification.
439     * @return any found results from the search.
440     */
441    public Set<Transshipment> search(final Search search);
442
443    /**
444     * Allows transformation of entities into value objects
445     * (or something else for that matter), when the <code>transform</code>
446     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.data.transshipment.TransshipmentDao</code>, please note
447     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
448     * will be returned.
449     *
450     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
451     *
452     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.data.transshipment.TransshipmentDao}
453     * @param entity an entity that was found
454     * @return the transformed entity (i.e. new value object, etc)
455     * @see #transformEntities(int,Collection)
456     */
457    public Object transformEntity(final int transform, final Transshipment entity);
458
459    /**
460     * Transforms a collection of entities using the
461     * {@link #transformEntity(int,Transshipment)}
462     * method. This method does not instantiate a new collection.
463     * <p>
464     * This method is to be used internally only.
465     *
466     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.data.transshipment.TransshipmentDao</code>
467     * @param entities the collection of entities to transform
468     * @see #transformEntity(int,Transshipment)
469     */
470    public void transformEntities(final int transform, final Collection<?> entities);
471
472    // spring-dao merge-point
473}