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;
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 * Type de zone de proximité particulière.
039 * Par exemple :
040 * - DCP (Dispositif de Concentration de Poison)
041 * - Filière aquacole
042 * - ...
043 * (liste non exhaustive)
044 * Nombre de lignes : 10
045 * @see NearbySpecificArea
046 */
047public interface NearbySpecificAreaDao
048{
049    /**
050     * This constant is used as a transformation flag; entities can be converted automatically into value objects
051     * or other types, different methods in a class implementing this interface support this feature: look for
052     * an <code>int</code> parameter called <code>transform</code>.
053     * <p>
054     * This specific flag denotes no transformation will occur.
055     */
056    public static final int TRANSFORM_NONE = 0;
057
058
059    /**
060     * Transforms the given results to a collection of {@link NearbySpecificArea}
061     * instances (this is useful when the returned results contains a row of data and you want just entities only).
062     *
063     * @param results the query results.
064     */
065    public void toEntities(final Collection<?> results);
066
067    /**
068     * Gets an instance of NearbySpecificArea from the persistent store.
069     * @param id
070     * @return NearbySpecificArea
071     */
072    public NearbySpecificArea get(Integer id);
073
074    /**
075     * <p>
076     * Does the same thing as {@link #get(Integer)} with an
077     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
078     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
079     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
080     * optionally transform the entity (into a value object for example). By default, transformation does
081     * not occur.
082     * </p>
083     *
084     * @param transform flag to determine transformation type.
085     * @param id the identifier of the entity to get.
086     * @return either the entity or the object transformed from the entity.
087     */
088    public Object get(int transform, Integer id);
089
090    /**
091     * Loads an instance of NearbySpecificArea from the persistent store.
092     * @param id
093     * @return NearbySpecificArea
094     */
095    public NearbySpecificArea load(Integer id);
096
097    /**
098     * <p>
099     * Does the same thing as {@link #load(Integer)} with an
100     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
101     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
102     * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
103     * optionally transform the entity (into a value object for example). By default, transformation does
104     * not occur.
105     * </p>
106     *
107     * @param transform flag to determine transformation type.
108     * @param id the identifier of the entity to load.
109     * @return either the entity or the object transformed from the entity.
110     */
111    public Object load(int transform, Integer id);
112
113    /**
114     * Loads all entities of type {@link NearbySpecificArea}.
115     *
116     * @return the loaded entities.
117     */
118    public Collection<NearbySpecificArea> loadAll();
119
120    /**
121     * <p>
122     * Does the same thing as {@link #loadAll()} with an
123     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
124     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
125     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
126     * transform the entity (into a value object for example). By default, transformation does
127     * not occur.
128     * </p>
129     *
130     * @param transform the flag indicating what transformation to use.
131     * @return the loaded entities.
132     */
133    public Collection<?> loadAll(final int transform);
134
135    /**
136     * <p>
137     * Does the same thing as {@link #loadAll()} with an
138     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
139     * 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
140     * page retrieved.
141     * </p>
142     *
143     * @param pageNumber the page number to retrieve when paging results.
144     * @param pageSize the size of the page to retrieve when paging results.
145     * @return the loaded entities.
146     */
147    public Collection<?> loadAll(final int pageNumber, final int pageSize);
148
149    /**
150     * <p>
151     * Does the same thing as {@link #loadAll(int)} with an
152     * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
153     * 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
154     * page retrieved.
155     * </p>
156     *
157     * @param transform the flag indicating what transformation to use.
158     * @param pageNumber the page number to retrieve when paging results.
159     * @param pageSize the size of the page to retrieve when paging results.
160     * @return the loaded entities.
161     */
162    public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
163
164    /**
165     * Creates an instance of NearbySpecificArea and adds it to the persistent store.
166     * @param nearbySpecificArea
167     * @return NearbySpecificArea
168     */
169    public NearbySpecificArea create(NearbySpecificArea nearbySpecificArea);
170
171    /**
172     * <p>
173     * Does the same thing as {@link #create(NearbySpecificArea)} with an
174     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
175     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
176     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
177     * transform the entity (into a value object for example). By default, transformation does
178     * not occur.
179     * </p>
180     * @param transform
181     * @param nearbySpecificArea
182     * @return Object
183     */
184    public Object create(int transform, NearbySpecificArea nearbySpecificArea);
185
186    /**
187     * Creates a new instance of NearbySpecificArea and adds
188     * from the passed in <code>entities</code> collection
189     *
190     * @param entities the collection of NearbySpecificArea
191     * instances to create.
192     *
193     * @return the created instances.
194     */
195    public Collection<NearbySpecificArea> create(Collection<NearbySpecificArea> entities);
196
197    /**
198     * <p>
199     * Does the same thing as {@link #create(NearbySpecificArea)} with an
200     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
201     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
202     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
203     * transform the entities (into value objects for example). By default, transformation does
204     * not occur.
205     * </p>
206     * @param transform
207     * @param entities
208     * @return Collection
209     */
210    public Collection<?> create(int transform, Collection<NearbySpecificArea> entities);
211
212    /**
213     * <p>
214     * Creates a new <code>NearbySpecificArea</code>
215     * instance from <strong>all</strong> attributes and adds it to
216     * the persistent store.
217     * </p>
218     * @param comments 
219     * @param label 
220     * @param name 
221     * @param description 
222     * @param updateDate 
223     * @return NearbySpecificArea
224     */
225    public NearbySpecificArea create(
226        String comments,
227        String label,
228        String name,
229        String description,
230        Timestamp updateDate);
231
232    /**
233     * <p>
234     * Does the same thing as {@link #create(String, String, String, String, Timestamp)} with an
235     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
236     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
237     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
238     * transform the entity (into a value object for example). By default, transformation does
239     * not occur.
240     * </p>
241     * @param transform
242     * @param comments 
243     * @param label 
244     * @param name 
245     * @param description 
246     * @param updateDate 
247     * @return NearbySpecificArea
248     */
249    public Object create(
250        int transform,
251        String comments,
252        String label,
253        String name,
254        String description,
255        Timestamp updateDate);
256
257    /**
258     * <p>
259     * Creates a new <code>NearbySpecificArea</code>
260     * instance from only <strong>required</strong> properties (attributes
261     * and association ends) and adds it to the persistent store.
262     * </p>
263     * @param description
264     * @param label
265     * @param name
266     * @param status
267     * @param updateDate
268     * @return NearbySpecificArea
269     */
270    public NearbySpecificArea create(
271        String description,
272        String label,
273        String name,
274        Status status,
275        Timestamp updateDate);
276
277    /**
278     * <p>
279     * Does the same thing as {@link #create(String, String, String, Timestamp)} with an
280     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
281     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
282     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
283     * transform the entity (into a value object for example). By default, transformation does
284     * not occur.
285     * </p>
286     * @param transform flag to determine transformation type.
287     * @param description
288     * @param label
289     * @param name
290     * @param status
291     * @param updateDate
292     * @return Object
293     */
294    public Object create(
295        int transform,
296        String description,
297        String label,
298        String name,
299        Status status,
300        Timestamp updateDate);
301
302    /**
303     * Updates the <code>nearbySpecificArea</code> instance in the persistent store.
304     * @param nearbySpecificArea
305     */
306    public void update(NearbySpecificArea nearbySpecificArea);
307
308    /**
309     * Updates all instances in the <code>entities</code> collection in the persistent store.
310     * @param entities
311     */
312    public void update(Collection<NearbySpecificArea> entities);
313
314    /**
315     * Removes the instance of NearbySpecificArea from the persistent store.
316     * @param nearbySpecificArea
317     */
318    public void remove(NearbySpecificArea nearbySpecificArea);
319
320    /**
321     * Removes the instance of NearbySpecificArea having the given
322     * <code>identifier</code> from the persistent store.
323     * @param id
324     */
325    public void remove(Integer id);
326
327    /**
328     * Removes all entities in the given <code>entities</code> collection.
329     * @param entities
330     */
331    public void remove(Collection<NearbySpecificArea> entities);
332
333
334    /**
335     * Does the same thing as {@link #search(int, Search)} but with an
336     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
337     * limit your data to a specified page number and size.
338     *
339     * @param transform the transformation flag.
340     * @param pageNumber the page number in the data to retrieve
341     * @param pageSize the size of the page to retrieve.
342     * @param search the search object which provides the search parameters and pagination specification.
343     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
344     */
345    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
346
347    /**
348     * Does the same thing as {@link #search(Search)} but with an
349     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
350     * limit your data to a specified page number and size.
351     *
352     * @param pageNumber the page number in the data to retrieve
353     * @param pageSize the size of the page to retrieve.
354     * @param search the search object which provides the search parameters and pagination specification.
355     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
356     */
357    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
358
359    /**
360     * Does the same thing as {@link #search(Search)} but with an
361     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
362     * finder results will <strong>NOT</strong> be transformed during retrieval.
363     * If this flag is any of the other constants defined here
364     * then results <strong>WILL BE</strong> passed through an operation which can optionally
365     * transform the entities (into value objects for example). By default, transformation does
366     * not occur.
367     *
368     * @param transform the transformation flag.
369     * @param search the search object which provides the search parameters and pagination specification.
370     * @return any found results from the search.
371     */
372    public Set<?> search(final int transform, final Search search);
373
374    /**
375     * Performs a search using the parameters specified in the given <code>search</code> object.
376     *
377     * @param search the search object which provides the search parameters and pagination specification.
378     * @return any found results from the search.
379     */
380    public Set<NearbySpecificArea> search(final Search search);
381
382    /**
383     * Allows transformation of entities into value objects
384     * (or something else for that matter), when the <code>transform</code>
385     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.NearbySpecificAreaDao</code>, please note
386     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
387     * will be returned.
388     *
389     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
390     *
391     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.NearbySpecificAreaDao}
392     * @param entity an entity that was found
393     * @return the transformed entity (i.e. new value object, etc)
394     * @see #transformEntities(int,Collection)
395     */
396    public Object transformEntity(final int transform, final NearbySpecificArea entity);
397
398    /**
399     * Transforms a collection of entities using the
400     * {@link #transformEntity(int,NearbySpecificArea)}
401     * method. This method does not instantiate a new collection.
402     * <p>
403     * This method is to be used internally only.
404     *
405     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.NearbySpecificAreaDao</code>
406     * @param entities the collection of entities to transform
407     * @see #transformEntity(int,NearbySpecificArea)
408     */
409    public void transformEntities(final int transform, final Collection<?> entities);
410
411    // spring-dao merge-point
412}