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.administration.user;
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.util.Collection;
033import java.util.Date;
034import java.util.Set;
035import org.andromda.spring.PaginationResult;
036
037/**
038 * @deprecated Use Program2person instead
039 * ATTENTION : NE PLUS UTILISER les portefeuilles dans les nouveaux développements (utiliser à la
040 * place les privilèves sur les programmes)
041 * Cette entité contient les informations indiquant qu'un portefeuille a les mêmes droit qu'un
042 * autre. Cette information est utilisée pour la saisie pour que des données saisies par un service
043 * puissent toujours être gérées lorsque le service n'existe plus et que ses agents se retrouvent
044 * dans d'autres services
045 * @see ManagedDataTransfer
046 */
047public interface ManagedDataTransferDao
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 ManagedDataTransfer}
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 ManagedDataTransfer from the persistent store.
069     * @param managedDataTransferPk
070     * @return ManagedDataTransfer
071     */
072    public ManagedDataTransfer get(ManagedDataTransferPK managedDataTransferPk);
073
074    /**
075     * <p>
076     * Does the same thing as {@link #get(ManagedDataTransferPK)} 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 managedDataTransferPk 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, ManagedDataTransferPK managedDataTransferPk);
089
090    /**
091     * Loads an instance of ManagedDataTransfer from the persistent store.
092     * @param managedDataTransferPk
093     * @return ManagedDataTransfer
094     */
095    public ManagedDataTransfer load(ManagedDataTransferPK managedDataTransferPk);
096
097    /**
098     * <p>
099     * Does the same thing as {@link #load(ManagedDataTransferPK)} 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 managedDataTransferPk 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, ManagedDataTransferPK managedDataTransferPk);
112
113    /**
114     * Loads all entities of type {@link ManagedDataTransfer}.
115     *
116     * @return the loaded entities.
117     */
118    public Collection<ManagedDataTransfer> 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 ManagedDataTransfer and adds it to the persistent store.
166     * @param managedDataTransfer
167     * @return ManagedDataTransfer
168     */
169    public ManagedDataTransfer create(ManagedDataTransfer managedDataTransfer);
170
171    /**
172     * <p>
173     * Does the same thing as {@link #create(ManagedDataTransfer)} 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 managedDataTransfer
182     * @return Object
183     */
184    public Object create(int transform, ManagedDataTransfer managedDataTransfer);
185
186    /**
187     * Creates a new instance of ManagedDataTransfer and adds
188     * from the passed in <code>entities</code> collection
189     *
190     * @param entities the collection of ManagedDataTransfer
191     * instances to create.
192     *
193     * @return the created instances.
194     */
195    public Collection<ManagedDataTransfer> create(Collection<ManagedDataTransfer> entities);
196
197    /**
198     * <p>
199     * Does the same thing as {@link #create(ManagedDataTransfer)} 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<ManagedDataTransfer> entities);
211
212    /**
213     * <p>
214     * Creates a new <code>ManagedDataTransfer</code>
215     * instance from <strong>all</strong> attributes and adds it to
216     * the persistent store.
217     * </p>
218     * @param transferDate Date à partir de laquelle le transfert s'applique.
219Cette date doit etre comparée à la date de la saisie, et non à la date de la donnée et elle meme.
220Exemple :
221- Si transfert d'un portefeuille à compté du 1 mars de l'année N.
222- dès le 1er mars, le nouveau propriétaire de la donnée pourra saisir sur le protefeuille, par
223exemple des enquete sur l'année N-1.
224     * @return ManagedDataTransfer
225     */
226    public ManagedDataTransfer create(
227        Date transferDate);
228
229    /**
230     * <p>
231     * Does the same thing as {@link #create(Date)} 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 transferDate Date à partir de laquelle le transfert s'applique.
240Cette date doit etre comparée à la date de la saisie, et non à la date de la donnée et elle meme.
241Exemple :
242- Si transfert d'un portefeuille à compté du 1 mars de l'année N.
243- dès le 1er mars, le nouveau propriétaire de la donnée pourra saisir sur le protefeuille, par
244exemple des enquete sur l'année N-1.
245     * @return ManagedDataTransfer
246     */
247    public Object create(
248        int transform,
249        Date transferDate);
250
251    /**
252     * <p>
253     * Creates a new <code>ManagedDataTransfer</code>
254     * instance from only <strong>required</strong> properties (attributes
255     * and association ends) and adds it to the persistent store.
256     * </p>
257     * @param managedData
258     * @param newManagerUser
259     * @param transferDate
260     * @return ManagedDataTransfer
261     */
262    public ManagedDataTransfer create(
263        ManagedData managedData,
264        Person newManagerUser,
265        Date transferDate);
266
267    /**
268     * <p>
269     * Does the same thing as {@link #create(Date)} with an
270     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
271     * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
272     * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
273     * transform the entity (into a value object for example). By default, transformation does
274     * not occur.
275     * </p>
276     * @param transform flag to determine transformation type.
277     * @param managedData
278     * @param newManagerUser
279     * @param transferDate
280     * @return Object
281     */
282    public Object create(
283        int transform,
284        ManagedData managedData,
285        Person newManagerUser,
286        Date transferDate);
287
288    /**
289     * Updates the <code>managedDataTransfer</code> instance in the persistent store.
290     * @param managedDataTransfer
291     */
292    public void update(ManagedDataTransfer managedDataTransfer);
293
294    /**
295     * Updates all instances in the <code>entities</code> collection in the persistent store.
296     * @param entities
297     */
298    public void update(Collection<ManagedDataTransfer> entities);
299
300    /**
301     * Removes the instance of ManagedDataTransfer from the persistent store.
302     * @param managedDataTransfer
303     */
304    public void remove(ManagedDataTransfer managedDataTransfer);
305
306    /**
307     * Removes the instance of ManagedDataTransfer having the given
308     * <code>identifier</code> from the persistent store.
309     * @param managedDataTransferPk
310     */
311    public void remove(ManagedDataTransferPK managedDataTransferPk);
312
313    /**
314     * Removes all entities in the given <code>entities</code> collection.
315     * @param entities
316     */
317    public void remove(Collection<ManagedDataTransfer> entities);
318
319
320    /**
321     * Does the same thing as {@link #search(int, Search)} but with an
322     * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
323     * limit your data to a specified page number and size.
324     *
325     * @param transform the transformation flag.
326     * @param pageNumber the page number in the data to retrieve
327     * @param pageSize the size of the page to retrieve.
328     * @param search the search object which provides the search parameters and pagination specification.
329     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
330     */
331    public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
332
333    /**
334     * Does the same thing as {@link #search(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 pageNumber the page number in the data to retrieve
339     * @param pageSize the size of the page to retrieve.
340     * @param search the search object which provides the search parameters and pagination specification.
341     * @return any found results from the search wrapped in a {@link PaginationResult} instance.
342     */
343    public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
344
345    /**
346     * Does the same thing as {@link #search(Search)} but with an
347     * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
348     * finder results will <strong>NOT</strong> be transformed during retrieval.
349     * If this flag is any of the other constants defined here
350     * then results <strong>WILL BE</strong> passed through an operation which can optionally
351     * transform the entities (into value objects for example). By default, transformation does
352     * not occur.
353     *
354     * @param transform the transformation flag.
355     * @param search the search object which provides the search parameters and pagination specification.
356     * @return any found results from the search.
357     */
358    public Set<?> search(final int transform, final Search search);
359
360    /**
361     * Performs a search using the parameters specified in the given <code>search</code> object.
362     *
363     * @param search the search object which provides the search parameters and pagination specification.
364     * @return any found results from the search.
365     */
366    public Set<ManagedDataTransfer> search(final Search search);
367
368    /**
369     * Allows transformation of entities into value objects
370     * (or something else for that matter), when the <code>transform</code>
371     * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.administration.user.ManagedDataTransferDao</code>, please note
372     * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
373     * will be returned.
374     *
375     * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
376     *
377     * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.administration.user.ManagedDataTransferDao}
378     * @param entity an entity that was found
379     * @return the transformed entity (i.e. new value object, etc)
380     * @see #transformEntities(int,Collection)
381     */
382    public Object transformEntity(final int transform, final ManagedDataTransfer entity);
383
384    /**
385     * Transforms a collection of entities using the
386     * {@link #transformEntity(int,ManagedDataTransfer)}
387     * method. This method does not instantiate a new collection.
388     * <p>
389     * This method is to be used internally only.
390     *
391     * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.administration.user.ManagedDataTransferDao</code>
392     * @param entities the collection of entities to transform
393     * @see #transformEntity(int,ManagedDataTransfer)
394     */
395    public void transformEntities(final int transform, final Collection<?> entities);
396
397    // spring-dao merge-point
398}