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.location;
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 java.sql.Timestamp;
033import java.util.Collection;
034import java.util.Set;
035import org.andromda.spring.PaginationResult;
036
037/**
038 * Niveau de lieu, ou catégorie. Il s'agit d'un regroupement de haut niveau d'un ensemble de lieux
039 * de meme nature géographique.
040 * Par exemple, pour la classification de lieu "Secteur maritime", on aura :
041 * - Zone FAO,
042 * - Sous-Zone FAO,
043 * - Division CIEM,
044 * - Sous-division CIEM
045 * - etc.
046 * Pour la classification de lieu "lieux territoriaux", on aura :
047 * - Pays
048 * - Region,
049 * - Département,
050 * - Quartier Maritme,
051 * - Port
052 * - ...
053 * On pourra trouver d'autre niveau de lieu, comme :
054 * - implantation Ifremer
055 * - laboratoire côtier, ...
056 * @see LocationLevel
057 */
058public interface LocationLevelDao
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 LocationLevel}
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 LocationLevel from the persistent store.
080     * @param id
081     * @return LocationLevel
082     */
083    public LocationLevel 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 LocationLevel from the persistent store.
103     * @param id
104     * @return LocationLevel
105     */
106    public LocationLevel 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 LocationLevel}.
126     *
127     * @return the loaded entities.
128     */
129    public Collection<LocationLevel> 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 LocationLevel and adds it to the persistent store.
177     * @param locationLevel
178     * @return LocationLevel
179     */
180    public LocationLevel create(LocationLevel locationLevel);
181
182    /**
183     * <p>
184     * Does the same thing as {@link #create(LocationLevel)} 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 locationLevel
193     * @return Object
194     */
195    public Object create(int transform, LocationLevel locationLevel);
196
197    /**
198     * Creates a new instance of LocationLevel and adds
199     * from the passed in <code>entities</code> collection
200     *
201     * @param entities the collection of LocationLevel
202     * instances to create.
203     *
204     * @return the created instances.
205     */
206    public Collection<LocationLevel> create(Collection<LocationLevel> entities);
207
208    /**
209     * <p>
210     * Does the same thing as {@link #create(LocationLevel)} 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<LocationLevel> entities);
222
223    /**
224     * <p>
225     * Creates a new <code>LocationLevel</code>
226     * instance from <strong>all</strong> attributes and adds it to
227     * the persistent store.
228     * </p>
229     * @param name 
230     * @param description 
231     * @param comments 
232     * @param updateDate 
233     * @return LocationLevel
234     */
235    public LocationLevel create(
236        String name,
237        String description,
238        String comments,
239        Timestamp updateDate);
240
241    /**
242     * <p>
243     * Does the same thing as {@link #create(String, String, String, Timestamp)} with an
244     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
245     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
246     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
247     * transform the entity (into a value object for example). By default, transformation does
248     * not occur.
249     * </p>
250     * @param transform
251     * @param name 
252     * @param description 
253     * @param comments 
254     * @param updateDate 
255     * @return LocationLevel
256     */
257    public Object create(
258        int transform,
259        String name,
260        String description,
261        String comments,
262        Timestamp updateDate);
263
264    /**
265     * <p>
266     * Creates a new <code>LocationLevel</code>
267     * instance from only <strong>required</strong> properties (attributes
268     * and association ends) and adds it to the persistent store.
269     * </p>
270     * @param locationClassification
271     * @param name
272     * @param updateDate
273     * @return LocationLevel
274     */
275    public LocationLevel create(
276        LocationClassification locationClassification,
277        String name,
278        Timestamp updateDate);
279
280    /**
281     * <p>
282     * Does the same thing as {@link #create(String, Timestamp)} with an
283     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
284     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
285     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
286     * transform the entity (into a value object for example). By default, transformation does
287     * not occur.
288     * </p>
289     * @param transform flag to determine transformation type.
290     * @param locationClassification
291     * @param name
292     * @param updateDate
293     * @return Object
294     */
295    public Object create(
296        int transform,
297        LocationClassification locationClassification,
298        String name,
299        Timestamp updateDate);
300
301    /**
302     * Updates the <code>locationLevel</code> instance in the persistent store.
303     * @param locationLevel
304     */
305    public void update(LocationLevel locationLevel);
306
307    /**
308     * Updates all instances in the <code>entities</code> collection in the persistent store.
309     * @param entities
310     */
311    public void update(Collection<LocationLevel> entities);
312
313    /**
314     * Removes the instance of LocationLevel from the persistent store.
315     * @param locationLevel
316     */
317    public void remove(LocationLevel locationLevel);
318
319    /**
320     * Removes the instance of LocationLevel having the given
321     * <code>identifier</code> from the persistent store.
322     * @param id
323     */
324    public void remove(Integer id);
325
326    /**
327     * Removes all entities in the given <code>entities</code> collection.
328     * @param entities
329     */
330    public void remove(Collection<LocationLevel> entities);
331
332
333    /**
334     * Does the same thing as {@link #search(int, Search)} but with an
335     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
336     * limit your data to a specified page number and size.
337     *
338     * @param transform the transformation flag.
339     * @param pageNumber the page number in the data to retrieve
340     * @param pageSize the size of the page to retrieve.
341     * @param search the search object which provides the search parameters and pagination specification.
342     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
343     */
344    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
345
346    /**
347     * Does the same thing as {@link #search(Search)} but with an
348     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
349     * limit your data to a specified page number and size.
350     *
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 pageNumber, final int pageSize, final Search search);
357
358    /**
359     * Does the same thing as {@link #search(Search)} but with an
360     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
361     * finder results will <strong>NOT</strong> be transformed during retrieval.
362     * If this flag is any of the other constants defined here
363     * then results <strong>WILL BE</strong> passed through an operation which can optionally
364     * transform the entities (into value objects for example). By default, transformation does
365     * not occur.
366     *
367     * @param transform the transformation flag.
368     * @param search the search object which provides the search parameters and pagination specification.
369     * @return any found results from the search.
370     */
371    public Set<?> search(final int transform, final Search search);
372
373    /**
374     * Performs a search using the parameters specified in the given <code>search</code> object.
375     *
376     * @param search the search object which provides the search parameters and pagination specification.
377     * @return any found results from the search.
378     */
379    public Set<LocationLevel> search(final Search search);
380
381    /**
382     * Allows transformation of entities into value objects
383     * (or something else for that matter), when the <code>transform</code>
384     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.location.LocationLevelDao</code>, please note
385     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
386     * will be returned.
387     *
388     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
389     *
390     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.location.LocationLevelDao}
391     * @param entity an entity that was found
392     * @return the transformed entity (i.e. new value object, etc)
393     * @see #transformEntities(int,Collection)
394     */
395    public Object transformEntity(final int transform, final LocationLevel entity);
396
397    /**
398     * Transforms a collection of entities using the
399     * {@link #transformEntity(int,LocationLevel)}
400     * method. This method does not instantiate a new collection.
401     * <p>
402     * This method is to be used internally only.
403     *
404     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.location.LocationLevelDao</code>
405     * @param entities the collection of entities to transform
406     * @see #transformEntity(int,LocationLevel)
407     */
408    public void transformEntities(final int transform, final Collection<?> entities);
409
410    // spring-dao merge-point
411}