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.vessel;
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.administration.programStrategy.Program;
033import fr.ifremer.adagio.core.dao.referential.Status;
034import fr.ifremer.adagio.core.dao.referential.VesselType;
035import java.sql.Timestamp;
036import java.util.Collection;
037import java.util.Set;
038import org.andromda.spring.PaginationResult;
039
040/**
041 * Navire, ou plus généralement un usager de la ressource.
042 * Peut etre un navire de peche professionnel ou non, un navire scientifique, un pêcheur à pied, un
043 * groupement de navires, etc.
044 * @see Vessel
045 */
046public interface VesselDao
047{
048    /**
049     * This constant is used as a transformation flag; entities can be converted automatically into value objects
050     * or other types, different methods in a class implementing this interface support this feature: look for
051     * an <code>int</code> parameter called <code>transform</code>.
052     * <p>
053     * This specific flag denotes no transformation will occur.
054     */
055    public static final int TRANSFORM_NONE = 0;
056
057
058    /**
059     * Transforms the given results to a collection of {@link Vessel}
060     * instances (this is useful when the returned results contains a row of data and you want just entities only).
061     *
062     * @param results the query results.
063     */
064    public void toEntities(final Collection<?> results);
065
066    /**
067     * Gets an instance of Vessel from the persistent store.
068     * @param code
069     * @return Vessel
070     */
071    public Vessel get(String code);
072
073    /**
074     * <p>
075     * Does the same thing as {@link #get(String)} with an
076     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
077     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
078     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
079     * optionally transform the entity (into a value object for example). By default, transformation does
080     * not occur.
081     * </p>
082     *
083     * @param transform flag to determine transformation type.
084     * @param code the identifier of the entity to get.
085     * @return either the entity or the object transformed from the entity.
086     */
087    public Object get(int transform, String code);
088
089    /**
090     * Loads an instance of Vessel from the persistent store.
091     * @param code
092     * @return Vessel
093     */
094    public Vessel load(String code);
095
096    /**
097     * <p>
098     * Does the same thing as {@link #load(String)} with an
099     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
100     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
101     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
102     * optionally transform the entity (into a value object for example). By default, transformation does
103     * not occur.
104     * </p>
105     *
106     * @param transform flag to determine transformation type.
107     * @param code the identifier of the entity to load.
108     * @return either the entity or the object transformed from the entity.
109     */
110    public Object load(int transform, String code);
111
112    /**
113     * Loads all entities of type {@link Vessel}.
114     *
115     * @return the loaded entities.
116     */
117    public Collection<Vessel> loadAll();
118
119    /**
120     * <p>
121     * Does the same thing as {@link #loadAll()} with an
122     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
123     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
124     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
125     * transform the entity (into a value object for example). By default, transformation does
126     * not occur.
127     * </p>
128     *
129     * @param transform the flag indicating what transformation to use.
130     * @return the loaded entities.
131     */
132    public Collection<?> loadAll(final int transform);
133
134    /**
135     * <p>
136     * Does the same thing as {@link #loadAll()} with an
137     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
138     * 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
139     * page retrieved.
140     * </p>
141     *
142     * @param pageNumber the page number to retrieve when paging results.
143     * @param pageSize the size of the page to retrieve when paging results.
144     * @return the loaded entities.
145     */
146    public Collection<?> loadAll(final int pageNumber, final int pageSize);
147
148    /**
149     * <p>
150     * Does the same thing as {@link #loadAll(int)} with an
151     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
152     * 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
153     * page retrieved.
154     * </p>
155     *
156     * @param transform the flag indicating what transformation to use.
157     * @param pageNumber the page number to retrieve when paging results.
158     * @param pageSize the size of the page to retrieve when paging results.
159     * @return the loaded entities.
160     */
161    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
162
163    /**
164     * Creates an instance of Vessel and adds it to the persistent store.
165     * @param vessel
166     * @return Vessel
167     */
168    public Vessel create(Vessel vessel);
169
170    /**
171     * <p>
172     * Does the same thing as {@link #create(Vessel)} with an
173     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
174     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
175     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
176     * transform the entity (into a value object for example). By default, transformation does
177     * not occur.
178     * </p>
179     * @param transform
180     * @param vessel
181     * @return Object
182     */
183    public Object create(int transform, Vessel vessel);
184
185    /**
186     * Creates a new instance of Vessel and adds
187     * from the passed in <code>entities</code> collection
188     *
189     * @param entities the collection of Vessel
190     * instances to create.
191     *
192     * @return the created instances.
193     */
194    public Collection<Vessel> create(Collection<Vessel> entities);
195
196    /**
197     * <p>
198     * Does the same thing as {@link #create(Vessel)} with an
199     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
200     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
201     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
202     * transform the entities (into value objects for example). By default, transformation does
203     * not occur.
204     * </p>
205     * @param transform
206     * @param entities
207     * @return Collection
208     */
209    public Collection<?> create(int transform, Collection<Vessel> entities);
210
211    /**
212     * <p>
213     * Creates a new <code>Vessel</code>
214     * instance from <strong>all</strong> attributes and adds it to
215     * the persistent store.
216     * </p>
217     * @param code <html>
218<head>
219<style>
220p {padding:0px; margin:0px;}
221</style>
222</head>
223<body>
224<p>
225Code du navire, c'est à dire son identifiant interne unique. Son
226identifiant interne ne change jamais, quelque soit son immatriculation,
227son lieu d'immatriculation, etc.
228</p>
229<p>
230</p>
231<p>
232Le code est sur 12 caractères pour permettre de stocker les 6 caractères
233du code Harmonie (+ dans Allegro un prefixe en base locale : &quot;#TEMP¿&quot;).
234</p>
235<p>
236</p>
237<p>
238=&gt; <b><u>Depuis le modèle V3.1.3</u></b>, une séquence
239VESSEL_CODE_SEQ permet de générer un identifiant unique, à convertir
240ensuite en alphanumérique.
241</p>
242</body>
243</html>
244     * @param updateDate 
245     * @return Vessel
246     */
247    public Vessel create(
248        String code,
249        Timestamp updateDate);
250
251    /**
252     * <p>
253     * Does the same thing as {@link #create(Timestamp)} with an
254     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
255     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
256     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
257     * transform the entity (into a value object for example). By default, transformation does
258     * not occur.
259     * </p>
260     * @param transform
261     * @param code <html>
262<head>
263<style>
264p {padding:0px; margin:0px;}
265</style>
266</head>
267<body>
268<p>
269Code du navire, c'est à dire son identifiant interne unique. Son
270identifiant interne ne change jamais, quelque soit son immatriculation,
271son lieu d'immatriculation, etc.
272</p>
273<p>
274</p>
275<p>
276Le code est sur 12 caractères pour permettre de stocker les 6 caractères
277du code Harmonie (+ dans Allegro un prefixe en base locale : &quot;#TEMP¿&quot;).
278</p>
279<p>
280</p>
281<p>
282=&gt; <b><u>Depuis le modèle V3.1.3</u></b>, une séquence
283VESSEL_CODE_SEQ permet de générer un identifiant unique, à convertir
284ensuite en alphanumérique.
285</p>
286</body>
287</html>
288     * @param updateDate 
289     * @return Vessel
290     */
291    public Object create(
292        int transform,
293        String code,
294        Timestamp updateDate);
295
296    /**
297     * <p>
298     * Creates a new <code>Vessel</code>
299     * instance from only <strong>required</strong> properties (attributes
300     * and association ends) and adds it to the persistent store.
301     * </p>
302     * @param program
303     * @param status
304     * @param updateDate
305     * @param vesselType
306     * @return Vessel
307     */
308    public Vessel create(
309        Program program,
310        Status status,
311        Timestamp updateDate,
312        VesselType vesselType);
313
314    /**
315     * <p>
316     * Does the same thing as {@link #create(Timestamp)} with an
317     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
318     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
319     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
320     * transform the entity (into a value object for example). By default, transformation does
321     * not occur.
322     * </p>
323     * @param transform flag to determine transformation type.
324     * @param program
325     * @param status
326     * @param updateDate
327     * @param vesselType
328     * @return Object
329     */
330    public Object create(
331        int transform,
332        Program program,
333        Status status,
334        Timestamp updateDate,
335        VesselType vesselType);
336
337    /**
338     * Updates the <code>vessel</code> instance in the persistent store.
339     * @param vessel
340     */
341    public void update(Vessel vessel);
342
343    /**
344     * Updates all instances in the <code>entities</code> collection in the persistent store.
345     * @param entities
346     */
347    public void update(Collection<Vessel> entities);
348
349    /**
350     * Removes the instance of Vessel from the persistent store.
351     * @param vessel
352     */
353    public void remove(Vessel vessel);
354
355    /**
356     * Removes the instance of Vessel having the given
357     * <code>identifier</code> from the persistent store.
358     * @param code
359     */
360    public void remove(String code);
361
362    /**
363     * Removes all entities in the given <code>entities</code> collection.
364     * @param entities
365     */
366    public void remove(Collection<Vessel> entities);
367
368
369    /**
370     * Does the same thing as {@link #search(int, Search)} but with an
371     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
372     * limit your data to a specified page number and size.
373     *
374     * @param transform the transformation flag.
375     * @param pageNumber the page number in the data to retrieve
376     * @param pageSize the size of the page to retrieve.
377     * @param search the search object which provides the search parameters and pagination specification.
378     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
379     */
380    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
381
382    /**
383     * Does the same thing as {@link #search(Search)} but with an
384     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
385     * limit your data to a specified page number and size.
386     *
387     * @param pageNumber the page number in the data to retrieve
388     * @param pageSize the size of the page to retrieve.
389     * @param search the search object which provides the search parameters and pagination specification.
390     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
391     */
392    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
393
394    /**
395     * Does the same thing as {@link #search(Search)} but with an
396     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
397     * finder results will <strong>NOT</strong> be transformed during retrieval.
398     * If this flag is any of the other constants defined here
399     * then results <strong>WILL BE</strong> passed through an operation which can optionally
400     * transform the entities (into value objects for example). By default, transformation does
401     * not occur.
402     *
403     * @param transform the transformation flag.
404     * @param search the search object which provides the search parameters and pagination specification.
405     * @return any found results from the search.
406     */
407    public Set<?> search(final int transform, final Search search);
408
409    /**
410     * Performs a search using the parameters specified in the given <code>search</code> object.
411     *
412     * @param search the search object which provides the search parameters and pagination specification.
413     * @return any found results from the search.
414     */
415    public Set<Vessel> search(final Search search);
416
417    /**
418     * Allows transformation of entities into value objects
419     * (or something else for that matter), when the <code>transform</code>
420     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.data.vessel.VesselDao</code>, please note
421     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
422     * will be returned.
423     *
424     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
425     *
426     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.data.vessel.VesselDao}
427     * @param entity an entity that was found
428     * @return the transformed entity (i.e. new value object, etc)
429     * @see #transformEntities(int,Collection)
430     */
431    public Object transformEntity(final int transform, final Vessel entity);
432
433    /**
434     * Transforms a collection of entities using the
435     * {@link #transformEntity(int,Vessel)}
436     * method. This method does not instantiate a new collection.
437     * <p>
438     * This method is to be used internally only.
439     *
440     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.data.vessel.VesselDao</code>
441     * @param entities the collection of entities to transform
442     * @see #transformEntity(int,Vessel)
443     */
444    public void transformEntities(final int transform, final Collection<?> entities);
445
446    // spring-dao merge-point
447}