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 * Classification d'une hierachie de lieu.
039 * Par exemple :
040 * - lieu territoriaux (Pays, region, port, ...)
041 * - secteurs maritimes (Zone FAO, sous-zone FAO, etc...)
042 * - zone d'effort (B,J,C)
043 * - implantation Ifremer
044 * - laboratoire côtier, ...
045 * @see LocationClassification
046 */
047public interface LocationClassificationDao
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 LocationClassification}
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 LocationClassification from the persistent store.
069     * @param id
070     * @return LocationClassification
071     */
072    public LocationClassification 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 LocationClassification from the persistent store.
092     * @param id
093     * @return LocationClassification
094     */
095    public LocationClassification 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 LocationClassification}.
115     *
116     * @return the loaded entities.
117     */
118    public Collection<LocationClassification> 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 LocationClassification and adds it to the persistent store.
166     * @param locationClassification
167     * @return LocationClassification
168     */
169    public LocationClassification create(LocationClassification locationClassification);
170
171    /**
172     * <p>
173     * Does the same thing as {@link #create(LocationClassification)} 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 locationClassification
182     * @return Object
183     */
184    public Object create(int transform, LocationClassification locationClassification);
185
186    /**
187     * Creates a new instance of LocationClassification and adds
188     * from the passed in <code>entities</code> collection
189     *
190     * @param entities the collection of LocationClassification
191     * instances to create.
192     *
193     * @return the created instances.
194     */
195    public Collection<LocationClassification> create(Collection<LocationClassification> entities);
196
197    /**
198     * <p>
199     * Does the same thing as {@link #create(LocationClassification)} 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<LocationClassification> entities);
211
212    /**
213     * <p>
214     * Creates a new <code>LocationClassification</code>
215     * instance from <strong>all</strong> attributes and adds it to
216     * the persistent store.
217     * </p>
218     * @param id 
219     * @param name 
220     * @param description 
221     * @param comments 
222     * @param updateDate 
223     * @return LocationClassification
224     */
225    public LocationClassification create(
226        Integer id,
227        String name,
228        String description,
229        String comments,
230        Timestamp updateDate);
231
232    /**
233     * <p>
234     * Does the same thing as {@link #create(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 id 
243     * @param name 
244     * @param description 
245     * @param comments 
246     * @param updateDate 
247     * @return LocationClassification
248     */
249    public Object create(
250        int transform,
251        Integer id,
252        String name,
253        String description,
254        String comments,
255        Timestamp updateDate);
256
257
258    /**
259     * Updates the <code>locationClassification</code> instance in the persistent store.
260     * @param locationClassification
261     */
262    public void update(LocationClassification locationClassification);
263
264    /**
265     * Updates all instances in the <code>entities</code> collection in the persistent store.
266     * @param entities
267     */
268    public void update(Collection<LocationClassification> entities);
269
270    /**
271     * Removes the instance of LocationClassification from the persistent store.
272     * @param locationClassification
273     */
274    public void remove(LocationClassification locationClassification);
275
276    /**
277     * Removes the instance of LocationClassification having the given
278     * <code>identifier</code> from the persistent store.
279     * @param id
280     */
281    public void remove(Integer id);
282
283    /**
284     * Removes all entities in the given <code>entities</code> collection.
285     * @param entities
286     */
287    public void remove(Collection<LocationClassification> entities);
288
289
290    /**
291     * Does the same thing as {@link #search(int, Search)} but with an
292     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
293     * limit your data to a specified page number and size.
294     *
295     * @param transform the transformation flag.
296     * @param pageNumber the page number in the data to retrieve
297     * @param pageSize the size of the page to retrieve.
298     * @param search the search object which provides the search parameters and pagination specification.
299     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
300     */
301    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
302
303    /**
304     * Does the same thing as {@link #search(Search)} but with an
305     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
306     * limit your data to a specified page number and size.
307     *
308     * @param pageNumber the page number in the data to retrieve
309     * @param pageSize the size of the page to retrieve.
310     * @param search the search object which provides the search parameters and pagination specification.
311     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
312     */
313    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
314
315    /**
316     * Does the same thing as {@link #search(Search)} but with an
317     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
318     * finder results will <strong>NOT</strong> be transformed during retrieval.
319     * If this flag is any of the other constants defined here
320     * then results <strong>WILL BE</strong> passed through an operation which can optionally
321     * transform the entities (into value objects for example). By default, transformation does
322     * not occur.
323     *
324     * @param transform the transformation flag.
325     * @param search the search object which provides the search parameters and pagination specification.
326     * @return any found results from the search.
327     */
328    public Set<?> search(final int transform, final Search search);
329
330    /**
331     * Performs a search using the parameters specified in the given <code>search</code> object.
332     *
333     * @param search the search object which provides the search parameters and pagination specification.
334     * @return any found results from the search.
335     */
336    public Set<LocationClassification> search(final Search search);
337
338    /**
339     * Allows transformation of entities into value objects
340     * (or something else for that matter), when the <code>transform</code>
341     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.location.LocationClassificationDao</code>, please note
342     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
343     * will be returned.
344     *
345     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
346     *
347     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.location.LocationClassificationDao}
348     * @param entity an entity that was found
349     * @return the transformed entity (i.e. new value object, etc)
350     * @see #transformEntities(int,Collection)
351     */
352    public Object transformEntity(final int transform, final LocationClassification entity);
353
354    /**
355     * Transforms a collection of entities using the
356     * {@link #transformEntity(int,LocationClassification)}
357     * method. This method does not instantiate a new collection.
358     * <p>
359     * This method is to be used internally only.
360     *
361     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.location.LocationClassificationDao</code>
362     * @param entities the collection of entities to transform
363     * @see #transformEntity(int,LocationClassification)
364     */
365    public void transformEntities(final int transform, final Collection<?> entities);
366
367    // spring-dao merge-point
368}