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.quadrige2.core.dao.administration.program;
7
8 /*-
9 * #%L
10 * Quadrige2 Core :: Server API
11 * %%
12 * Copyright (C) 2017 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
29 import fr.ifremer.quadrige2.core.dao.Search;
30 import java.sql.Timestamp;
31 import java.util.Collection;
32 import java.util.Set;
33 import org.andromda.spring.PaginationResult;
34
35 /**
36 * types de privilège applicables sur un programme (responsable, consultation intégrale, saisisseur)
37 * @see ProgramPrivilege
38 */
39 public interface ProgramPrivilegeDao
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 ProgramPrivilege}
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 ProgramPrivilegeIds}.
66 */
67 public static final int TRANSFORM_PROGRAMPRIVILEGEIDS = 1;
68
69 /**
70 * Copies the fields of the specified entity to the target value object. This method is similar to
71 * toProgramPrivilegeIds(), 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 toProgramPrivilegeIds(
77 ProgramPrivilege source,
78 ProgramPrivilegeIds target);
79
80 /**
81 * Converts this DAO's entity to an object of type {@link ProgramPrivilegeIds}.
82 * @param entity
83 * @return ProgramPrivilegeIds
84 */
85 public ProgramPrivilegeIds toProgramPrivilegeIds(ProgramPrivilege entity);
86
87 /**
88 * Converts this DAO's entity to a Collection of instances of type {@link ProgramPrivilegeIds}.
89 * @param entities
90 */
91 public Collection<ProgramPrivilegeIds> toProgramPrivilegeIdsCollection(Collection<?> entities);
92
93 /**
94 * Converts this DAO's entity to an array of instances of type {@link ProgramPrivilegeIds}.
95 * @param entities
96 * @return ProgramPrivilegeIds[]
97 */
98 public ProgramPrivilegeIds[] toProgramPrivilegeIdsArray(Collection<?> entities);
99
100 /**
101 * Copies the fields of {@link ProgramPrivilegeIds} 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 programPrivilegeIdsToEntity(
108 ProgramPrivilegeIds source,
109 ProgramPrivilege target,
110 boolean copyIfNull);
111
112 /**
113 * Converts an instance of type {@link ProgramPrivilegeIds} to this DAO's entity.
114 * @param programPrivilegeIds
115 * @return ProgramPrivilege
116 */
117 public ProgramPrivilege programPrivilegeIdsToEntity(ProgramPrivilegeIds programPrivilegeIds);
118
119 /**
120 * Converts a Collection of instances of type {@link ProgramPrivilegeIds} to this
121 * DAO's entity.
122 * @param instances
123 */
124 public void programPrivilegeIdsToEntityCollection(Collection<?> instances);
125
126 /**
127 * Gets an instance of ProgramPrivilege from the persistent store.
128 * @param progPrivId
129 * @return ProgramPrivilege
130 */
131 public ProgramPrivilege get(Integer progPrivId);
132
133 /**
134 * <p>
135 * Does the same thing as {@link #get(Integer)} 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 progPrivId 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, Integer progPrivId);
148
149 /**
150 * Loads an instance of ProgramPrivilege from the persistent store.
151 * @param progPrivId
152 * @return ProgramPrivilege
153 */
154 public ProgramPrivilege load(Integer progPrivId);
155
156 /**
157 * <p>
158 * Does the same thing as {@link #load(Integer)} 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 progPrivId 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, Integer progPrivId);
171
172 /**
173 * Loads all entities of type {@link ProgramPrivilege}.
174 *
175 * @return the loaded entities.
176 */
177 public Collection<ProgramPrivilege> 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 ProgramPrivilege and adds it to the persistent store.
225 * @param programPrivilege
226 * @return ProgramPrivilege
227 */
228 public ProgramPrivilege create(ProgramPrivilege programPrivilege);
229
230 /**
231 * <p>
232 * Does the same thing as {@link #create(ProgramPrivilege)} 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 programPrivilege
241 * @return Object
242 */
243 public Object create(int transform, ProgramPrivilege programPrivilege);
244
245 /**
246 * Creates a new instance of ProgramPrivilege and adds
247 * from the passed in <code>entities</code> collection
248 *
249 * @param entities the collection of ProgramPrivilege
250 * instances to create.
251 *
252 * @return the created instances.
253 */
254 public Collection<ProgramPrivilege> create(Collection<ProgramPrivilege> entities);
255
256 /**
257 * <p>
258 * Does the same thing as {@link #create(ProgramPrivilege)} 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<ProgramPrivilege> entities);
270
271 /**
272 * <p>
273 * Creates a new <code>ProgramPrivilege</code>
274 * instance from <strong>all</strong> attributes and adds it to
275 * the persistent store.
276 * </p>
277 * @param progPrivNm Libellé du privilège
278 * @param progPrivDc Description du privilège
279 * @param updateDt Date de modification de l'objet, mise à jour par le système
280 * @return ProgramPrivilege
281 */
282 public ProgramPrivilege create(
283 String progPrivNm,
284 String progPrivDc,
285 Timestamp updateDt);
286
287 /**
288 * <p>
289 * Does the same thing as {@link #create(String, String, Timestamp)} with an
290 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
291 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
292 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
293 * transform the entity (into a value object for example). By default, transformation does
294 * not occur.
295 * </p>
296 * @param transform
297 * @param progPrivNm Libellé du privilège
298 * @param progPrivDc Description du privilège
299 * @param updateDt Date de modification de l'objet, mise à jour par le système
300 * @return ProgramPrivilege
301 */
302 public Object create(
303 int transform,
304 String progPrivNm,
305 String progPrivDc,
306 Timestamp updateDt);
307
308
309 /**
310 * Updates the <code>programPrivilege</code> instance in the persistent store.
311 * @param programPrivilege
312 */
313 public void update(ProgramPrivilege programPrivilege);
314
315 /**
316 * Updates all instances in the <code>entities</code> collection in the persistent store.
317 * @param entities
318 */
319 public void update(Collection<ProgramPrivilege> entities);
320
321 /**
322 * Removes the instance of ProgramPrivilege from the persistent store.
323 * @param programPrivilege
324 */
325 public void remove(ProgramPrivilege programPrivilege);
326
327 /**
328 * Removes the instance of ProgramPrivilege having the given
329 * <code>identifier</code> from the persistent store.
330 * @param progPrivId
331 */
332 public void remove(Integer progPrivId);
333
334 /**
335 * Removes all entities in the given <code>entities</code> collection.
336 * @param entities
337 */
338 public void remove(Collection<ProgramPrivilege> entities);
339
340
341 /**
342 * Does the same thing as {@link #search(int, Search)} but with an
343 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
344 * limit your data to a specified page number and size.
345 *
346 * @param transform the transformation flag.
347 * @param pageNumber the page number in the data to retrieve
348 * @param pageSize the size of the page to retrieve.
349 * @param search the search object which provides the search parameters and pagination specification.
350 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
351 */
352 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
353
354 /**
355 * Does the same thing as {@link #search(Search)} but with an
356 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
357 * limit your data to a specified page number and size.
358 *
359 * @param pageNumber the page number in the data to retrieve
360 * @param pageSize the size of the page to retrieve.
361 * @param search the search object which provides the search parameters and pagination specification.
362 * @return any found results from the search wrapped in a {@link PaginationResult} instance.
363 */
364 public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
365
366 /**
367 * Does the same thing as {@link #search(Search)} but with an
368 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
369 * finder results will <strong>NOT</strong> be transformed during retrieval.
370 * If this flag is any of the other constants defined here
371 * then results <strong>WILL BE</strong> passed through an operation which can optionally
372 * transform the entities (into value objects for example). By default, transformation does
373 * not occur.
374 *
375 * @param transform the transformation flag.
376 * @param search the search object which provides the search parameters and pagination specification.
377 * @return any found results from the search.
378 */
379 public Set<?> search(final int transform, final Search search);
380
381 /**
382 * Performs a search using the parameters specified in the given <code>search</code> object.
383 *
384 * @param search the search object which provides the search parameters and pagination specification.
385 * @return any found results from the search.
386 */
387 public Set<ProgramPrivilege> search(final Search search);
388
389 /**
390 * Allows transformation of entities into value objects
391 * (or something else for that matter), when the <code>transform</code>
392 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.administration.program.ProgramPrivilegeDao</code>, please note
393 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
394 * will be returned.
395 * <p>
396 * This method will return instances of these types:
397 * <ul>
398 * <li>{@link ProgramPrivilege} - {@link #TRANSFORM_NONE}</li>
399 * <li>{@link ProgramPrivilegeIds} - {@link #TRANSFORM_PROGRAMPRIVILEGEIDS}</li>
400 * </ul>
401 *
402 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
403 *
404 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.administration.program.ProgramPrivilegeDao}
405 * @param entity an entity that was found
406 * @return the transformed entity (i.e. new value object, etc)
407 * @see #transformEntities(int,Collection)
408 */
409 public Object transformEntity(final int transform, final ProgramPrivilege entity);
410
411 /**
412 * Transforms a collection of entities using the
413 * {@link #transformEntity(int,ProgramPrivilege)}
414 * method. This method does not instantiate a new collection.
415 * <p>
416 * This method is to be used internally only.
417 *
418 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.administration.program.ProgramPrivilegeDao</code>
419 * @param entities the collection of entities to transform
420 * @see #transformEntity(int,ProgramPrivilege)
421 */
422 public void transformEntities(final int transform, final Collection<?> entities);
423
424 // spring-dao merge-point
425 }