View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: Generated code! Do not modify by hand!
4   // Generated by: SpringDao.vsl in andromda-spring-cartridge.
5   //
6   package fr.ifremer.quadrige3.core.dao.system.rule;
7   
8   /*-
9    * #%L
10   * Quadrige3 Core :: Client API
11   * %%
12   * Copyright (C) 2017 - 2024 Ifremer
13   * %%
14   * This program is free software: you can redistribute it and/or modify
15   * it under the terms of the GNU Affero General Public License as published by
16   * the Free Software Foundation, either version 3 of the License, or
17   * (at your option) any later version.
18   * 
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Affero General Public License
25   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26   * #L%
27   */
28  import fr.ifremer.quadrige3.core.dao.Search;
29  import fr.ifremer.quadrige3.core.dao.referential.pmfm.Parameter;
30  import fr.ifremer.quadrige3.core.vo.system.rule.RulePmfmVO;
31  import java.sql.Timestamp;
32  import java.util.Collection;
33  import java.util.Set;
34  import org.andromda.spring.PaginationResult;
35  
36  /**
37   * Cette table permet de conserver les PMFM concernés par une règle de contrôle
38   * @see RulePmfm
39   */
40  public interface RulePmfmDao
41  {
42      /**
43       * This constant is used as a transformation flag; entities can be converted automatically into value objects
44       * or other types, different methods in a class implementing this interface support this feature: look for
45       * an <code>int</code> parameter called <code>transform</code>.
46       * <p>
47       * This specific flag denotes no transformation will occur.
48       */
49      public static final int TRANSFORM_NONE = 0;
50  
51  
52      /**
53       * Transforms the given results to a collection of {@link RulePmfm}
54       * instances (this is useful when the returned results contains a row of data and you want just entities only).
55       *
56       * @param results the query results.
57       */
58      public void toEntities(final Collection<?> results);
59  
60      /**
61       * This constant is used as a transformation flag; entities can be converted automatically into value objects
62       * or other types, different methods in a class implementing this interface support this feature: look for
63       * an <code>int</code> parameter called <code>transform</code>.
64       * <p>
65       * This specific flag denotes entities must be transformed into objects of type
66       * {@link RulePmfmVO}.
67       */
68      public static final int TRANSFORM_RULEPMFMVO = 1;
69  
70      /**
71       * Copies the fields of the specified entity to the target value object. This method is similar to
72       * toRulePmfmVO(), but it does not handle any attributes in the target
73       * value object that are "read-only" (as those do not have setter methods exposed).
74       * @param source
75       * @param target
76       */
77      public void toRulePmfmVO(
78          RulePmfm source,
79          RulePmfmVO target);
80  
81      /**
82       * Converts this DAO's entity to an object of type {@link RulePmfmVO}.
83       * @param entity
84       * @return RulePmfmVO
85       */
86      public RulePmfmVO toRulePmfmVO(RulePmfm entity);
87  
88      /**
89       * Converts this DAO's entity to a Collection of instances of type {@link RulePmfmVO}.
90       * @param entities
91       */
92      public Collection<RulePmfmVO> toRulePmfmVOCollection(Collection<?> entities);
93  
94      /**
95       * Converts this DAO's entity to an array of instances of type {@link RulePmfmVO}.
96       * @param entities
97       * @return RulePmfmVO[]
98       */
99      public RulePmfmVO[] toRulePmfmVOArray(Collection<?> entities);
100 
101     /**
102      * Copies the fields of {@link RulePmfmVO} to the specified entity.
103      * @param source
104      * @param target
105      * @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE,
106      * it will be copied regardless of its value.
107      */
108     public void rulePmfmVOToEntity(
109         RulePmfmVO source,
110         RulePmfm target,
111         boolean copyIfNull);
112 
113     /**
114      * Converts an instance of type {@link RulePmfmVO} to this DAO's entity.
115      * @param rulePmfmVO
116      * @return RulePmfm
117      */
118     public RulePmfm rulePmfmVOToEntity(RulePmfmVO rulePmfmVO);
119 
120     /**
121      * Converts a Collection of instances of type {@link RulePmfmVO} to this
122      * DAO's entity.
123      * @param instances
124      */
125     public void rulePmfmVOToEntityCollection(Collection<?> instances);
126 
127     /**
128      * Gets an instance of RulePmfm from the persistent store.
129      * @param rulePmfmId
130      * @return RulePmfm
131      */
132     public RulePmfm get(Integer rulePmfmId);
133 
134     /**
135      * <p>
136      * Does the same thing as {@link #get(Integer)} with an
137      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
138      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
139      * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
140      * optionally transform the entity (into a value object for example). By default, transformation does
141      * not occur.
142      * </p>
143      *
144      * @param transform flag to determine transformation type.
145      * @param rulePmfmId the identifier of the entity to get.
146      * @return either the entity or the object transformed from the entity.
147      */
148     public Object get(int transform, Integer rulePmfmId);
149 
150     /**
151      * Loads an instance of RulePmfm from the persistent store.
152      * @param rulePmfmId
153      * @return RulePmfm
154      */
155     public RulePmfm load(Integer rulePmfmId);
156 
157     /**
158      * <p>
159      * Does the same thing as {@link #load(Integer)} with an
160      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
161      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
162      * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
163      * optionally transform the entity (into a value object for example). By default, transformation does
164      * not occur.
165      * </p>
166      *
167      * @param transform flag to determine transformation type.
168      * @param rulePmfmId the identifier of the entity to load.
169      * @return either the entity or the object transformed from the entity.
170      */
171     public Object load(int transform, Integer rulePmfmId);
172 
173     /**
174      * Loads all entities of type {@link RulePmfm}.
175      *
176      * @return the loaded entities.
177      */
178     public Collection<RulePmfm> loadAll();
179 
180     /**
181      * <p>
182      * Does the same thing as {@link #loadAll()} with an
183      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
184      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
185      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
186      * transform the entity (into a value object for example). By default, transformation does
187      * not occur.
188      * </p>
189      *
190      * @param transform the flag indicating what transformation to use.
191      * @return the loaded entities.
192      */
193     public Collection<?> loadAll(final int transform);
194 
195     /**
196      * <p>
197      * Does the same thing as {@link #loadAll()} with an
198      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
199      * 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
200      * page retrieved.
201      * </p>
202      *
203      * @param pageNumber the page number to retrieve when paging results.
204      * @param pageSize the size of the page to retrieve when paging results.
205      * @return the loaded entities.
206      */
207     public Collection<?> loadAll(final int pageNumber, final int pageSize);
208 
209     /**
210      * <p>
211      * Does the same thing as {@link #loadAll(int)} with an
212      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
213      * 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
214      * page retrieved.
215      * </p>
216      *
217      * @param transform the flag indicating what transformation to use.
218      * @param pageNumber the page number to retrieve when paging results.
219      * @param pageSize the size of the page to retrieve when paging results.
220      * @return the loaded entities.
221      */
222     public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
223 
224     /**
225      * Creates an instance of RulePmfm and adds it to the persistent store.
226      * @param rulePmfm
227      * @return RulePmfm
228      */
229     public RulePmfm create(RulePmfm rulePmfm);
230 
231     /**
232      * <p>
233      * Does the same thing as {@link #create(RulePmfm)} with an
234      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
235      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
236      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
237      * transform the entity (into a value object for example). By default, transformation does
238      * not occur.
239      * </p>
240      * @param transform
241      * @param rulePmfm
242      * @return Object
243      */
244     public Object create(int transform, RulePmfm rulePmfm);
245 
246     /**
247      * Creates a new instance of RulePmfm and adds
248      * from the passed in <code>entities</code> collection
249      *
250      * @param entities the collection of RulePmfm
251      * instances to create.
252      *
253      * @return the created instances.
254      */
255     public Collection<RulePmfm> create(Collection<RulePmfm> entities);
256 
257     /**
258      * <p>
259      * Does the same thing as {@link #create(RulePmfm)} with an
260      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
261      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
262      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
263      * transform the entities (into value objects for example). By default, transformation does
264      * not occur.
265      * </p>
266      * @param transform
267      * @param entities
268      * @return Collection
269      */
270     public Collection<?> create(int transform, Collection<RulePmfm> entities);
271 
272     /**
273      * <p>
274      * Creates a new <code>RulePmfm</code>
275      * instance from <strong>all</strong> attributes and adds it to
276      * the persistent store.
277      * </p>
278      * @param updateDt Date de modification de l'objet, mise à jour par le système
279      * @return RulePmfm
280      */
281     public RulePmfm create(
282         Timestamp updateDt);
283 
284     /**
285      * <p>
286      * Does the same thing as {@link #create(Timestamp)} with an
287      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
288      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
289      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
290      * transform the entity (into a value object for example). By default, transformation does
291      * not occur.
292      * </p>
293      * @param transform
294      * @param updateDt Date de modification de l'objet, mise à jour par le système
295      * @return RulePmfm
296      */
297     public Object create(
298         int transform,
299         Timestamp updateDt);
300 
301     /**
302      * <p>
303      * Creates a new <code>RulePmfm</code>
304      * instance from only <strong>required</strong> properties (attributes
305      * and association ends) and adds it to the persistent store.
306      * </p>
307      * @param parameter
308      * @param rule
309      * @return RulePmfm
310      */
311     public RulePmfm create(
312         Parameter parameter,
313         Rule rule);
314 
315     /**
316      * <p>
317      * Does the same thing as {@link #create()} with an
318      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
319      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
320      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
321      * transform the entity (into a value object for example). By default, transformation does
322      * not occur.
323      * </p>
324      * @param transform flag to determine transformation type.
325      * @param parameter
326      * @param rule
327      * @return Object
328      */
329     public Object create(
330         int transform,
331         Parameter parameter,
332         Rule rule);
333 
334     /**
335      * Updates the <code>rulePmfm</code> instance in the persistent store.
336      * @param rulePmfm
337      */
338     public void update(RulePmfm rulePmfm);
339 
340     /**
341      * Updates all instances in the <code>entities</code> collection in the persistent store.
342      * @param entities
343      */
344     public void update(Collection<RulePmfm> entities);
345 
346     /**
347      * Removes the instance of RulePmfm from the persistent store.
348      * @param rulePmfm
349      */
350     public void remove(RulePmfm rulePmfm);
351 
352     /**
353      * Removes the instance of RulePmfm having the given
354      * <code>identifier</code> from the persistent store.
355      * @param rulePmfmId
356      */
357     public void remove(Integer rulePmfmId);
358 
359     /**
360      * Removes all entities in the given <code>entities</code> collection.
361      * @param entities
362      */
363     public void remove(Collection<RulePmfm> entities);
364 
365     /**
366      * 
367      * @param rulePmfm 
368      * @param updateDt 
369      * @return RulePmfmVO
370      */
371     public RulePmfmVO save(RulePmfmVO rulePmfm, Timestamp updateDt);
372 
373     /**
374      * 
375      * @param rulePmfmIds 
376      * @return void
377      */
378     public void removeByIds(Collection<Integer> rulePmfmIds);
379 
380 
381     /**
382      * Does the same thing as {@link #search(int, Search)} but with an
383      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
384      * limit your data to a specified page number and size.
385      *
386      * @param transform the transformation flag.
387      * @param pageNumber the page number in the data to retrieve
388      * @param pageSize the size of the page to retrieve.
389      * @param search the search object which provides the search parameters and pagination specification.
390      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
391      */
392     public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
393 
394     /**
395      * Does the same thing as {@link #search(Search)} but with an
396      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
397      * limit your data to a specified page number and size.
398      *
399      * @param pageNumber the page number in the data to retrieve
400      * @param pageSize the size of the page to retrieve.
401      * @param search the search object which provides the search parameters and pagination specification.
402      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
403      */
404     public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
405 
406     /**
407      * Does the same thing as {@link #search(Search)} but with an
408      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
409      * finder results will <strong>NOT</strong> be transformed during retrieval.
410      * If this flag is any of the other constants defined here
411      * then results <strong>WILL BE</strong> passed through an operation which can optionally
412      * transform the entities (into value objects for example). By default, transformation does
413      * not occur.
414      *
415      * @param transform the transformation flag.
416      * @param search the search object which provides the search parameters and pagination specification.
417      * @return any found results from the search.
418      */
419     public Set<?> search(final int transform, final Search search);
420 
421     /**
422      * Performs a search using the parameters specified in the given <code>search</code> object.
423      *
424      * @param search the search object which provides the search parameters and pagination specification.
425      * @return any found results from the search.
426      */
427     public Set<RulePmfm> search(final Search search);
428 
429     /**
430      * Allows transformation of entities into value objects
431      * (or something else for that matter), when the <code>transform</code>
432      * flag is set to one of the constants defined in <code>fr.ifremer.quadrige3.core.dao.system.rule.RulePmfmDao</code>, please note
433      * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
434      * will be returned.
435      * <p>
436      * This method will return instances of these types:
437      * <ul>
438      *   <li>{@link RulePmfm} - {@link #TRANSFORM_NONE}</li>
439      *   <li>{@link RulePmfmVO} - {@link #TRANSFORM_RULEPMFMVO}</li>
440      * </ul>
441      *
442      * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
443      *
444      * @param transform one of the constants declared in {@link fr.ifremer.quadrige3.core.dao.system.rule.RulePmfmDao}
445      * @param entity an entity that was found
446      * @return the transformed entity (i.e. new value object, etc)
447      * @see #transformEntities(int,Collection)
448      */
449     public Object transformEntity(final int transform, final RulePmfm entity);
450 
451     /**
452      * Transforms a collection of entities using the
453      * {@link #transformEntity(int,RulePmfm)}
454      * method. This method does not instantiate a new collection.
455      * <p>
456      * This method is to be used internally only.
457      *
458      * @param transform one of the constants declared in <code>fr.ifremer.quadrige3.core.dao.system.rule.RulePmfmDao</code>
459      * @param entities the collection of entities to transform
460      * @see #transformEntity(int,RulePmfm)
461      */
462     public void transformEntities(final int transform, final Collection<?> entities);
463 
464     // spring-dao merge-point
465 }