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