001// license-header java merge-point 002// 003// Attention: Generated code! Do not modify by hand! 004// Generated by: SpringDao.vsl in andromda-spring-cartridge. 005// 006package fr.ifremer.adagio.core.dao.administration.user; 007 008/* 009 * #%L 010 * SIH-Adagio :: Core 011 * $Id:$ 012 * $HeadURL:$ 013 * %% 014 * Copyright (C) 2012 - 2014 Ifremer 015 * %% 016 * This program is free software: you can redistribute it and/or modify 017 * it under the terms of the GNU Affero General Public License as published by 018 * the Free Software Foundation, either version 3 of the License, or 019 * (at your option) any later version. 020 * 021 * This program is distributed in the hope that it will be useful, 022 * but WITHOUT ANY WARRANTY; without even the implied warranty of 023 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 024 * GNU General Public License for more details. 025 * 026 * You should have received a copy of the GNU Affero General Public License 027 * along with this program. If not, see <http://www.gnu.org/licenses/>. 028 * #L% 029 */ 030 031import fr.ifremer.adagio.core.dao.Search; 032import java.sql.Timestamp; 033import java.util.Collection; 034import java.util.Set; 035import org.andromda.spring.PaginationResult; 036 037/** 038 * <html> 039 * <head> 040 * </head> 041 * <body> 042 * <p> 043 * Liste des profils pouvant être affectés à un utilisateur. 044 * </p> 045 * <p> 046 * Pour la v1, les valeurs identifiées sont : 047 * </p> 048 * <p> 049 * - Administrateur de référentiel (pour info, pas encore de synonyme LDAP) 050 * : donne accès aux fonctionnalités d’aministration du référentiel, ainsi 051 * qu’aux autres fonctionn lité d’administration (ex : 052 * programmes/stratégies). 053 * </p> 054 * <p> 055 * - Observateur (pour info, synonyme LDAP = SIH_ROBS) : donne accès en 056 * consultation sur le référentiel (hors données navires). Si portefeuilles 057 * rattachés à l'observateur, alors droits en saisie sur la fonctionnalité 058 * correspondant au type du portefeuille (gestion des marées observées, 059 * calendriers d'activités navires, ...). Si superviseur de portefeuille, 060 * alors droits de correction sur les données saisies dans les 061 * portefeuilles supervisés. 062 * </p> 063 * <p> 064 * - Projet (pour info, synonyme LDAP = SIH_PROJET) : utilisateur membre de 065 * l'équipe projet du système ISIH : membre droits de consultation et de 066 * saisie que pour un observateur. 067 * </p> 068 * <p> 069 * - Utilisateur (pour info, synonyme LDAP = SIH_AUTRE) : utilisateur su 070 * système ISIH : pour la v1, ce profil ne donne accès à aucune 071 * fonctionnalité du système Allegro. 072 * <br> </p> 073 * <p> 074 * </p> 075 * <p> 076 * <u>note 1 :</u> les droits d'accès en saisie sur les fonctions 077 * (superviseur, activité sur les navires, marées observées) ne sont donc 078 * pas gérés ici, mais par l'intermédiaire des portefeuilles (cf classe 079 * "Portefeuille Navire"). 080 * </p> 081 * <p> 082 * <u>note 2 :</u> le synonyme LDAP "SIH_AUTRE" n'est pas utilisé pour le 083 * moment : il correspond à un utilisateur sans profil particulier 084 * </p> 085 * <p> 086 * Nombre de lignes : 4 087 * </p> 088 * </body> 089 * </html> 090 * @see UserProfil 091 */ 092public interface UserProfilDao 093{ 094 /** 095 * This constant is used as a transformation flag; entities can be converted automatically into value objects 096 * or other types, different methods in a class implementing this interface support this feature: look for 097 * an <code>int</code> parameter called <code>transform</code>. 098 * <p> 099 * This specific flag denotes no transformation will occur. 100 */ 101 public static final int TRANSFORM_NONE = 0; 102 103 104 /** 105 * Transforms the given results to a collection of {@link UserProfil} 106 * instances (this is useful when the returned results contains a row of data and you want just entities only). 107 * 108 * @param results the query results. 109 */ 110 public void toEntities(final Collection<?> results); 111 112 /** 113 * Gets an instance of UserProfil from the persistent store. 114 * @param id 115 * @return UserProfil 116 */ 117 public UserProfil get(Integer id); 118 119 /** 120 * <p> 121 * Does the same thing as {@link #get(Integer)} with an 122 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 123 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 124 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 125 * optionally transform the entity (into a value object for example). By default, transformation does 126 * not occur. 127 * </p> 128 * 129 * @param transform flag to determine transformation type. 130 * @param id the identifier of the entity to get. 131 * @return either the entity or the object transformed from the entity. 132 */ 133 public Object get(int transform, Integer id); 134 135 /** 136 * Loads an instance of UserProfil from the persistent store. 137 * @param id 138 * @return UserProfil 139 */ 140 public UserProfil load(Integer id); 141 142 /** 143 * <p> 144 * Does the same thing as {@link #load(Integer)} with an 145 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 146 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 147 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 148 * optionally transform the entity (into a value object for example). By default, transformation does 149 * not occur. 150 * </p> 151 * 152 * @param transform flag to determine transformation type. 153 * @param id the identifier of the entity to load. 154 * @return either the entity or the object transformed from the entity. 155 */ 156 public Object load(int transform, Integer id); 157 158 /** 159 * Loads all entities of type {@link UserProfil}. 160 * 161 * @return the loaded entities. 162 */ 163 public Collection<UserProfil> loadAll(); 164 165 /** 166 * <p> 167 * Does the same thing as {@link #loadAll()} with an 168 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 169 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 170 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 171 * transform the entity (into a value object for example). By default, transformation does 172 * not occur. 173 * </p> 174 * 175 * @param transform the flag indicating what transformation to use. 176 * @return the loaded entities. 177 */ 178 public Collection<?> loadAll(final int transform); 179 180 /** 181 * <p> 182 * Does the same thing as {@link #loadAll()} with an 183 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 184 * 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 185 * page retrieved. 186 * </p> 187 * 188 * @param pageNumber the page number to retrieve when paging results. 189 * @param pageSize the size of the page to retrieve when paging results. 190 * @return the loaded entities. 191 */ 192 public Collection<?> loadAll(final int pageNumber, final int pageSize); 193 194 /** 195 * <p> 196 * Does the same thing as {@link #loadAll(int)} 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 transform the flag indicating what transformation to use. 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 transform, final int pageNumber, final int pageSize); 208 209 /** 210 * Creates an instance of UserProfil and adds it to the persistent store. 211 * @param userProfil 212 * @return UserProfil 213 */ 214 public UserProfil create(UserProfil userProfil); 215 216 /** 217 * <p> 218 * Does the same thing as {@link #create(UserProfil)} with an 219 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 220 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 221 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 222 * transform the entity (into a value object for example). By default, transformation does 223 * not occur. 224 * </p> 225 * @param transform 226 * @param userProfil 227 * @return Object 228 */ 229 public Object create(int transform, UserProfil userProfil); 230 231 /** 232 * Creates a new instance of UserProfil and adds 233 * from the passed in <code>entities</code> collection 234 * 235 * @param entities the collection of UserProfil 236 * instances to create. 237 * 238 * @return the created instances. 239 */ 240 public Collection<UserProfil> create(Collection<UserProfil> entities); 241 242 /** 243 * <p> 244 * Does the same thing as {@link #create(UserProfil)} with an 245 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 246 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 247 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 248 * transform the entities (into value objects for example). By default, transformation does 249 * not occur. 250 * </p> 251 * @param transform 252 * @param entities 253 * @return Collection 254 */ 255 public Collection<?> create(int transform, Collection<UserProfil> entities); 256 257 /** 258 * <p> 259 * Creates a new <code>UserProfil</code> 260 * instance from <strong>all</strong> attributes and adds it to 261 * the persistent store. 262 * </p> 263 * @param id 264 * @param label Synonyme du profil dans LDAP 265 * @param name 266 * @param updateDate 267 * @return UserProfil 268 */ 269 public UserProfil create( 270 Integer id, 271 String label, 272 String name, 273 Timestamp updateDate); 274 275 /** 276 * <p> 277 * Does the same thing as {@link #create(String, String, Timestamp)} with an 278 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 279 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 280 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 281 * transform the entity (into a value object for example). By default, transformation does 282 * not occur. 283 * </p> 284 * @param transform 285 * @param id 286 * @param label Synonyme du profil dans LDAP 287 * @param name 288 * @param updateDate 289 * @return UserProfil 290 */ 291 public Object create( 292 int transform, 293 Integer id, 294 String label, 295 String name, 296 Timestamp updateDate); 297 298 299 /** 300 * Updates the <code>userProfil</code> instance in the persistent store. 301 * @param userProfil 302 */ 303 public void update(UserProfil userProfil); 304 305 /** 306 * Updates all instances in the <code>entities</code> collection in the persistent store. 307 * @param entities 308 */ 309 public void update(Collection<UserProfil> entities); 310 311 /** 312 * Removes the instance of UserProfil from the persistent store. 313 * @param userProfil 314 */ 315 public void remove(UserProfil userProfil); 316 317 /** 318 * Removes the instance of UserProfil having the given 319 * <code>identifier</code> from the persistent store. 320 * @param id 321 */ 322 public void remove(Integer id); 323 324 /** 325 * Removes all entities in the given <code>entities</code> collection. 326 * @param entities 327 */ 328 public void remove(Collection<UserProfil> entities); 329 330 331 /** 332 * Does the same thing as {@link #search(int, Search)} but with an 333 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 334 * limit your data to a specified page number and size. 335 * 336 * @param transform the transformation flag. 337 * @param pageNumber the page number in the data to retrieve 338 * @param pageSize the size of the page to retrieve. 339 * @param search the search object which provides the search parameters and pagination specification. 340 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 341 */ 342 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 343 344 /** 345 * Does the same thing as {@link #search(Search)} but with an 346 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 347 * limit your data to a specified page number and size. 348 * 349 * @param pageNumber the page number in the data to retrieve 350 * @param pageSize the size of the page to retrieve. 351 * @param search the search object which provides the search parameters and pagination specification. 352 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 353 */ 354 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 355 356 /** 357 * Does the same thing as {@link #search(Search)} but with an 358 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 359 * finder results will <strong>NOT</strong> be transformed during retrieval. 360 * If this flag is any of the other constants defined here 361 * then results <strong>WILL BE</strong> passed through an operation which can optionally 362 * transform the entities (into value objects for example). By default, transformation does 363 * not occur. 364 * 365 * @param transform the transformation flag. 366 * @param search the search object which provides the search parameters and pagination specification. 367 * @return any found results from the search. 368 */ 369 public Set<?> search(final int transform, final Search search); 370 371 /** 372 * Performs a search using the parameters specified in the given <code>search</code> object. 373 * 374 * @param search the search object which provides the search parameters and pagination specification. 375 * @return any found results from the search. 376 */ 377 public Set<UserProfil> search(final Search search); 378 379 /** 380 * Allows transformation of entities into value objects 381 * (or something else for that matter), when the <code>transform</code> 382 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.administration.user.UserProfilDao</code>, please note 383 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 384 * will be returned. 385 * 386 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 387 * 388 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.administration.user.UserProfilDao} 389 * @param entity an entity that was found 390 * @return the transformed entity (i.e. new value object, etc) 391 * @see #transformEntities(int,Collection) 392 */ 393 public Object transformEntity(final int transform, final UserProfil entity); 394 395 /** 396 * Transforms a collection of entities using the 397 * {@link #transformEntity(int,UserProfil)} 398 * method. This method does not instantiate a new collection. 399 * <p> 400 * This method is to be used internally only. 401 * 402 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.administration.user.UserProfilDao</code> 403 * @param entities the collection of entities to transform 404 * @see #transformEntity(int,UserProfil) 405 */ 406 public void transformEntities(final int transform, final Collection<?> entities); 407 408 // spring-dao merge-point 409}