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 * Précision de la mesure par rapport au seuil de détection de l'instrument d'analyse. Se
039 * trouve-t-on au dessus ou en dessous du seuil de détection ?
040 * Utilisée principalement lors de l'utilisation d'instrument de mesure.
041 * La liste sera la suivante :
042 * - supérieure valeur maximale pouvant être détectée
043 * - inférieure à la valeur minimale pouvant être détectée
044 * @see NumericalPrecision
045 */
046public interface NumericalPrecisionDao
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 NumericalPrecision}
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 NumericalPrecision from the persistent store.
068     * @param id
069     * @return NumericalPrecision
070     */
071    public NumericalPrecision get(Integer id);
072
073    /**
074     * <p>
075     * Does the same thing as {@link #get(Integer)} 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 id 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, Integer id);
088
089    /**
090     * Loads an instance of NumericalPrecision from the persistent store.
091     * @param id
092     * @return NumericalPrecision
093     */
094    public NumericalPrecision load(Integer id);
095
096    /**
097     * <p>
098     * Does the same thing as {@link #load(Integer)} 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 id 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, Integer id);
111
112    /**
113     * Loads all entities of type {@link NumericalPrecision}.
114     *
115     * @return the loaded entities.
116     */
117    public Collection<NumericalPrecision> 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 NumericalPrecision and adds it to the persistent store.
165     * @param numericalPrecision
166     * @return NumericalPrecision
167     */
168    public NumericalPrecision create(NumericalPrecision numericalPrecision);
169
170    /**
171     * <p>
172     * Does the same thing as {@link #create(NumericalPrecision)} 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 numericalPrecision
181     * @return Object
182     */
183    public Object create(int transform, NumericalPrecision numericalPrecision);
184
185    /**
186     * Creates a new instance of NumericalPrecision and adds
187     * from the passed in <code>entities</code> collection
188     *
189     * @param entities the collection of NumericalPrecision
190     * instances to create.
191     *
192     * @return the created instances.
193     */
194    public Collection<NumericalPrecision> create(Collection<NumericalPrecision> entities);
195
196    /**
197     * <p>
198     * Does the same thing as {@link #create(NumericalPrecision)} 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<NumericalPrecision> entities);
210
211    /**
212     * <p>
213     * Creates a new <code>NumericalPrecision</code>
214     * instance from <strong>all</strong> attributes and adds it to
215     * the persistent store.
216     * </p>
217     * @param name 
218     * @param description 
219     * @param updateDate 
220     * @param comments 
221     * @return NumericalPrecision
222     */
223    public NumericalPrecision create(
224        String name,
225        String description,
226        Timestamp updateDate,
227        String comments);
228
229    /**
230     * <p>
231     * Does the same thing as {@link #create(String, String, Timestamp, String)} with an
232     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
233     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
234     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
235     * transform the entity (into a value object for example). By default, transformation does
236     * not occur.
237     * </p>
238     * @param transform
239     * @param name 
240     * @param description 
241     * @param updateDate 
242     * @param comments 
243     * @return NumericalPrecision
244     */
245    public Object create(
246        int transform,
247        String name,
248        String description,
249        Timestamp updateDate,
250        String comments);
251
252    /**
253     * <p>
254     * Creates a new <code>NumericalPrecision</code>
255     * instance from only <strong>required</strong> properties (attributes
256     * and association ends) and adds it to the persistent store.
257     * </p>
258     * @param description
259     * @param name
260     * @param status
261     * @param updateDate
262     * @return NumericalPrecision
263     */
264    public NumericalPrecision create(
265        String description,
266        String name,
267        Status status,
268        Timestamp updateDate);
269
270    /**
271     * <p>
272     * Does the same thing as {@link #create(String, String, Timestamp)} with an
273     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
274     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
275     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
276     * transform the entity (into a value object for example). By default, transformation does
277     * not occur.
278     * </p>
279     * @param transform flag to determine transformation type.
280     * @param description
281     * @param name
282     * @param status
283     * @param updateDate
284     * @return Object
285     */
286    public Object create(
287        int transform,
288        String description,
289        String name,
290        Status status,
291        Timestamp updateDate);
292
293    /**
294     * Updates the <code>numericalPrecision</code> instance in the persistent store.
295     * @param numericalPrecision
296     */
297    public void update(NumericalPrecision numericalPrecision);
298
299    /**
300     * Updates all instances in the <code>entities</code> collection in the persistent store.
301     * @param entities
302     */
303    public void update(Collection<NumericalPrecision> entities);
304
305    /**
306     * Removes the instance of NumericalPrecision from the persistent store.
307     * @param numericalPrecision
308     */
309    public void remove(NumericalPrecision numericalPrecision);
310
311    /**
312     * Removes the instance of NumericalPrecision having the given
313     * <code>identifier</code> from the persistent store.
314     * @param id
315     */
316    public void remove(Integer id);
317
318    /**
319     * Removes all entities in the given <code>entities</code> collection.
320     * @param entities
321     */
322    public void remove(Collection<NumericalPrecision> entities);
323
324
325    /**
326     * Does the same thing as {@link #search(int, Search)} but with an
327     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
328     * limit your data to a specified page number and size.
329     *
330     * @param transform the transformation flag.
331     * @param pageNumber the page number in the data to retrieve
332     * @param pageSize the size of the page to retrieve.
333     * @param search the search object which provides the search parameters and pagination specification.
334     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
335     */
336    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
337
338    /**
339     * Does the same thing as {@link #search(Search)} but with an
340     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
341     * limit your data to a specified page number and size.
342     *
343     * @param pageNumber the page number in the data to retrieve
344     * @param pageSize the size of the page to retrieve.
345     * @param search the search object which provides the search parameters and pagination specification.
346     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
347     */
348    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
349
350    /**
351     * Does the same thing as {@link #search(Search)} but with an
352     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
353     * finder results will <strong>NOT</strong> be transformed during retrieval.
354     * If this flag is any of the other constants defined here
355     * then results <strong>WILL BE</strong> passed through an operation which can optionally
356     * transform the entities (into value objects for example). By default, transformation does
357     * not occur.
358     *
359     * @param transform the transformation flag.
360     * @param search the search object which provides the search parameters and pagination specification.
361     * @return any found results from the search.
362     */
363    public Set<?> search(final int transform, final Search search);
364
365    /**
366     * Performs a search using the parameters specified in the given <code>search</code> object.
367     *
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<NumericalPrecision> search(final Search search);
372
373    /**
374     * Allows transformation of entities into value objects
375     * (or something else for that matter), when the <code>transform</code>
376     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.NumericalPrecisionDao</code>, please note
377     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
378     * will be returned.
379     *
380     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
381     *
382     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.NumericalPrecisionDao}
383     * @param entity an entity that was found
384     * @return the transformed entity (i.e. new value object, etc)
385     * @see #transformEntities(int,Collection)
386     */
387    public Object transformEntity(final int transform, final NumericalPrecision entity);
388
389    /**
390     * Transforms a collection of entities using the
391     * {@link #transformEntity(int,NumericalPrecision)}
392     * method. This method does not instantiate a new collection.
393     * <p>
394     * This method is to be used internally only.
395     *
396     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.NumericalPrecisionDao</code>
397     * @param entities the collection of entities to transform
398     * @see #transformEntity(int,NumericalPrecision)
399     */
400    public void transformEntities(final int transform, final Collection<?> entities);
401
402    // spring-dao merge-point
403}