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