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.AppliedPeriodVO;
30 import java.sql.Timestamp;
31 import java.util.Collection;
32 import java.util.Date;
33 import java.util.Set;
34 import org.andromda.spring.PaginationResult;
35
36 /**
37 * Liste des périodes durant lesquels une stratégie est appliquée en un lieu.
38 * @see AppliedPeriod
39 */
40 public interface AppliedPeriodDao
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 AppliedPeriod}
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 AppliedPeriodVO}.
67 */
68 public static final int TRANSFORM_APPLIEDPERIODVO = 1;
69
70 /**
71 * Copies the fields of the specified entity to the target value object. This method is similar to
72 * toAppliedPeriodVO(), 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 toAppliedPeriodVO(
78 AppliedPeriod source,
79 AppliedPeriodVO target);
80
81 /**
82 * Converts this DAO's entity to an object of type {@link AppliedPeriodVO}.
83 * @param entity
84 * @return AppliedPeriodVO
85 */
86 public AppliedPeriodVO toAppliedPeriodVO(AppliedPeriod entity);
87
88 /**
89 * Converts this DAO's entity to a Collection of instances of type {@link AppliedPeriodVO}.
90 * @param entities
91 */
92 public Collection<AppliedPeriodVO> toAppliedPeriodVOCollection(Collection<?> entities);
93
94 /**
95 * Converts this DAO's entity to an array of instances of type {@link AppliedPeriodVO}.
96 * @param entities
97 * @return AppliedPeriodVO[]
98 */
99 public AppliedPeriodVO[] toAppliedPeriodVOArray(Collection<?> entities);
100
101 /**
102 * Copies the fields of {@link AppliedPeriodVO} 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 appliedPeriodVOToEntity(
109 AppliedPeriodVO source,
110 AppliedPeriod target,
111 boolean copyIfNull);
112
113 /**
114 * Converts an instance of type {@link AppliedPeriodVO} to this DAO's entity.
115 * @param appliedPeriodVO
116 * @return AppliedPeriod
117 */
118 public AppliedPeriod appliedPeriodVOToEntity(AppliedPeriodVO appliedPeriodVO);
119
120 /**
121 * Converts a Collection of instances of type {@link AppliedPeriodVO} to this
122 * DAO's entity.
123 * @param instances
124 */
125 public void appliedPeriodVOToEntityCollection(Collection<?> instances);
126
127 /**
128 * Gets an instance of AppliedPeriod from the persistent store.
129 * @param appliedPeriodPk
130 * @return AppliedPeriod
131 */
132 public AppliedPeriod get(AppliedPeriodPK appliedPeriodPk);
133
134 /**
135 * <p>
136 * Does the same thing as {@link #get(AppliedPeriodPK)} 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 appliedPeriodPk 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, AppliedPeriodPK appliedPeriodPk);
149
150 /**
151 * Loads an instance of AppliedPeriod from the persistent store.
152 * @param appliedPeriodPk
153 * @return AppliedPeriod
154 */
155 public AppliedPeriod load(AppliedPeriodPK appliedPeriodPk);
156
157 /**
158 * <p>
159 * Does the same thing as {@link #load(AppliedPeriodPK)} 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 appliedPeriodPk 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, AppliedPeriodPK appliedPeriodPk);
172
173 /**
174 * Loads all entities of type {@link AppliedPeriod}.
175 *
176 * @return the loaded entities.
177 */
178 public Collection<AppliedPeriod> 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 AppliedPeriod and adds it to the persistent store.
226 * @param appliedPeriod
227 * @return AppliedPeriod
228 */
229 public AppliedPeriod create(AppliedPeriod appliedPeriod);
230
231 /**
232 * <p>
233 * Does the same thing as {@link #create(AppliedPeriod)} 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 appliedPeriod
242 * @return Object
243 */
244 public Object create(int transform, AppliedPeriod appliedPeriod);
245
246 /**
247 * Creates a new instance of AppliedPeriod and adds
248 * from the passed in <code>entities</code> collection
249 *
250 * @param entities the collection of AppliedPeriod
251 * instances to create.
252 *
253 * @return the created instances.
254 */
255 public Collection<AppliedPeriod> create(Collection<AppliedPeriod> entities);
256
257 /**
258 * <p>
259 * Does the same thing as {@link #create(AppliedPeriod)} 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<AppliedPeriod> entities);
271
272 /**
273 * <p>
274 * Creates a new <code>AppliedPeriod</code>
275 * instance from <strong>all</strong> attributes and adds it to
276 * the persistent store.
277 * </p>
278 * @param appliedPeriodEndDt Date de fin de la période applicable. Si elle n'est pas définie, la période est en cours.
279 * @param updateDt Date de modification de l'objet, mise à jour par le système
280 * @return AppliedPeriod
281 */
282 public AppliedPeriod create(
283 Date appliedPeriodEndDt,
284 Timestamp updateDt);
285
286 /**
287 * <p>
288 * Does the same thing as {@link #create(Date, Timestamp)} with an
289 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
290 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
291 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
292 * transform the entity (into a value object for example). By default, transformation does
293 * not occur.
294 * </p>
295 * @param transform
296 * @param appliedPeriodEndDt Date de fin de la période applicable. Si elle n'est pas définie, la période est en cours.
297 * @param updateDt Date de modification de l'objet, mise à jour par le système
298 * @return AppliedPeriod
299 */
300 public Object create(
301 int transform,
302 Date appliedPeriodEndDt,
303 Timestamp updateDt);
304
305 /**
306 * <p>
307 * Creates a new <code>AppliedPeriod</code>
308 * instance from only <strong>required</strong> properties (attributes
309 * and association ends) and adds it to the persistent store.
310 * </p>
311 * @param appliedPeriodEndDt
312 * @param appliedStrategy
313 * @return AppliedPeriod
314 */
315 public AppliedPeriod create(
316 Date appliedPeriodEndDt,
317 AppliedStrategy appliedStrategy);
318
319 /**
320 * <p>
321 * Does the same thing as {@link #create(Date)} with an
322 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
323 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
324 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
325 * transform the entity (into a value object for example). By default, transformation does
326 * not occur.
327 * </p>
328 * @param transform flag to determine transformation type.
329 * @param appliedPeriodEndDt
330 * @param appliedStrategy
331 * @return Object
332 */
333 public Object create(
334 int transform,
335 Date appliedPeriodEndDt,
336 AppliedStrategy appliedStrategy);
337
338 /**
339 * Updates the <code>appliedPeriod</code> instance in the persistent store.
340 * @param appliedPeriod
341 */
342 public void update(AppliedPeriod appliedPeriod);
343
344 /**
345 * Updates all instances in the <code>entities</code> collection in the persistent store.
346 * @param entities
347 */
348 public void update(Collection<AppliedPeriod> entities);
349
350 /**
351 * Removes the instance of AppliedPeriod from the persistent store.
352 * @param appliedPeriod
353 */
354 public void remove(AppliedPeriod appliedPeriod);
355
356 /**
357 * Removes the instance of AppliedPeriod having the given
358 * <code>identifier</code> from the persistent store.
359 * @param appliedPeriodPk
360 */
361 public void remove(AppliedPeriodPK appliedPeriodPk);
362
363 /**
364 * Removes all entities in the given <code>entities</code> collection.
365 * @param entities
366 */
367 public void remove(Collection<AppliedPeriod> entities);
368
369 /**
370 *
371 * @param appliedPeriod
372 * @param updateDt
373 * @return AppliedPeriodVO
374 */
375 public AppliedPeriodVO save(AppliedPeriodVO appliedPeriod, Timestamp updateDt);
376
377 /**
378 *
379 * @param appliedStratId
380 * @param progCd
381 * @param monLocId
382 * @param startDate
383 * @param endDate
384 * @return void
385 */
386 public void checkCanRemove(Integer appliedStratId, String progCd, Integer monLocId, Date startDate, Date endDate);
387
388
389 /**
390 * Does the same thing as {@link #search(int, Search)} but with an
391 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
392 * limit your data to a specified page number and size.
393 *
394 * @param transform the transformation flag.
395 * @param pageNumber the page number in the data to retrieve
396 * @param pageSize the size of the page to retrieve.
397 * @param search the search object which provides the search parameters and pagination specification.
398 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
399 */
400 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
401
402 /**
403 * Does the same thing as {@link #search(Search)} but with an
404 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
405 * limit your data to a specified page number and size.
406 *
407 * @param pageNumber the page number in the data to retrieve
408 * @param pageSize the size of the page to retrieve.
409 * @param search the search object which provides the search parameters and pagination specification.
410 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
411 */
412 public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
413
414 /**
415 * Does the same thing as {@link #search(Search)} but with an
416 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
417 * finder results will <strong>NOT</strong> be transformed during retrieval.
418 * If this flag is any of the other constants defined here
419 * then results <strong>WILL BE</strong> passed through an operation which can optionally
420 * transform the entities (into value objects for example). By default, transformation does
421 * not occur.
422 *
423 * @param transform the transformation flag.
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<?> search(final int transform, final Search search);
428
429 /**
430 * Performs a search using the parameters specified in the given <code>search</code> object.
431 *
432 * @param search the search object which provides the search parameters and pagination specification.
433 * @return any found results from the search.
434 */
435 public Set<AppliedPeriod> search(final Search search);
436
437 /**
438 * Allows transformation of entities into value objects
439 * (or something else for that matter), when the <code>transform</code>
440 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige3.core.dao.administration.strategy.AppliedPeriodDao</code>, please note
441 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
442 * will be returned.
443 * <p>
444 * This method will return instances of these types:
445 * <ul>
446 * <li>{@link AppliedPeriod} - {@link #TRANSFORM_NONE}</li>
447 * <li>{@link AppliedPeriodVO} - {@link #TRANSFORM_APPLIEDPERIODVO}</li>
448 * </ul>
449 *
450 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
451 *
452 * @param transform one of the constants declared in {@link fr.ifremer.quadrige3.core.dao.administration.strategy.AppliedPeriodDao}
453 * @param entity an entity that was found
454 * @return the transformed entity (i.e. new value object, etc)
455 * @see #transformEntities(int,Collection)
456 */
457 public Object transformEntity(final int transform, final AppliedPeriod entity);
458
459 /**
460 * Transforms a collection of entities using the
461 * {@link #transformEntity(int,AppliedPeriod)}
462 * method. This method does not instantiate a new collection.
463 * <p>
464 * This method is to be used internally only.
465 *
466 * @param transform one of the constants declared in <code>fr.ifremer.quadrige3.core.dao.administration.strategy.AppliedPeriodDao</code>
467 * @param entities the collection of entities to transform
468 * @see #transformEntity(int,AppliedPeriod)
469 */
470 public void transformEntities(final int transform, final Collection<?> entities);
471
472 // spring-dao merge-point
473 }