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