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.referential; 007 008/* 009 * #%L 010 * SIH-Adagio :: Core for Allegro 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 * Etat d'un traitement. 044 * </p> 045 * <p> 046 * </p> 047 * <p> 048 * Par exemple :<br>- succès<br>- échec<br>- etc. 049 * </p> 050 * </body> 051 * </html> 052 * @see ProcessingStatus 053 */ 054public interface ProcessingStatusDao 055{ 056 /** 057 * This constant is used as a transformation flag; entities can be converted automatically into value objects 058 * or other types, different methods in a class implementing this interface support this feature: look for 059 * an <code>int</code> parameter called <code>transform</code>. 060 * <p> 061 * This specific flag denotes no transformation will occur. 062 */ 063 public static final int TRANSFORM_NONE = 0; 064 065 066 /** 067 * Transforms the given results to a collection of {@link ProcessingStatus} 068 * instances (this is useful when the returned results contains a row of data and you want just entities only). 069 * 070 * @param results the query results. 071 */ 072 public void toEntities(final Collection<?> results); 073 074 /** 075 * Gets an instance of ProcessingStatus from the persistent store. 076 * @param code 077 * @return ProcessingStatus 078 */ 079 public ProcessingStatus get(String code); 080 081 /** 082 * <p> 083 * Does the same thing as {@link #get(String)} with an 084 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 085 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 086 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 087 * optionally transform the entity (into a value object for example). By default, transformation does 088 * not occur. 089 * </p> 090 * 091 * @param transform flag to determine transformation type. 092 * @param code the identifier of the entity to get. 093 * @return either the entity or the object transformed from the entity. 094 */ 095 public Object get(int transform, String code); 096 097 /** 098 * Loads an instance of ProcessingStatus from the persistent store. 099 * @param code 100 * @return ProcessingStatus 101 */ 102 public ProcessingStatus load(String code); 103 104 /** 105 * <p> 106 * Does the same thing as {@link #load(String)} with an 107 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 108 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 109 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 110 * optionally transform the entity (into a value object for example). By default, transformation does 111 * not occur. 112 * </p> 113 * 114 * @param transform flag to determine transformation type. 115 * @param code the identifier of the entity to load. 116 * @return either the entity or the object transformed from the entity. 117 */ 118 public Object load(int transform, String code); 119 120 /** 121 * Loads all entities of type {@link ProcessingStatus}. 122 * 123 * @return the loaded entities. 124 */ 125 public Collection<ProcessingStatus> loadAll(); 126 127 /** 128 * <p> 129 * Does the same thing as {@link #loadAll()} with an 130 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 131 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 132 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 133 * transform the entity (into a value object for example). By default, transformation does 134 * not occur. 135 * </p> 136 * 137 * @param transform the flag indicating what transformation to use. 138 * @return the loaded entities. 139 */ 140 public Collection<?> loadAll(final int transform); 141 142 /** 143 * <p> 144 * Does the same thing as {@link #loadAll()} with an 145 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 146 * 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 147 * page retrieved. 148 * </p> 149 * 150 * @param pageNumber the page number to retrieve when paging results. 151 * @param pageSize the size of the page to retrieve when paging results. 152 * @return the loaded entities. 153 */ 154 public Collection<?> loadAll(final int pageNumber, final int pageSize); 155 156 /** 157 * <p> 158 * Does the same thing as {@link #loadAll(int)} with an 159 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 160 * 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 161 * page retrieved. 162 * </p> 163 * 164 * @param transform the flag indicating what transformation to use. 165 * @param pageNumber the page number to retrieve when paging results. 166 * @param pageSize the size of the page to retrieve when paging results. 167 * @return the loaded entities. 168 */ 169 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 170 171 /** 172 * Creates an instance of ProcessingStatus and adds it to the persistent store. 173 * @param processingStatus 174 * @return ProcessingStatus 175 */ 176 public ProcessingStatus create(ProcessingStatus processingStatus); 177 178 /** 179 * <p> 180 * Does the same thing as {@link #create(ProcessingStatus)} 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 * @param transform 188 * @param processingStatus 189 * @return Object 190 */ 191 public Object create(int transform, ProcessingStatus processingStatus); 192 193 /** 194 * Creates a new instance of ProcessingStatus and adds 195 * from the passed in <code>entities</code> collection 196 * 197 * @param entities the collection of ProcessingStatus 198 * instances to create. 199 * 200 * @return the created instances. 201 */ 202 public Collection<ProcessingStatus> create(Collection<ProcessingStatus> entities); 203 204 /** 205 * <p> 206 * Does the same thing as {@link #create(ProcessingStatus)} with an 207 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 208 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 209 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 210 * transform the entities (into value objects for example). By default, transformation does 211 * not occur. 212 * </p> 213 * @param transform 214 * @param entities 215 * @return Collection 216 */ 217 public Collection<?> create(int transform, Collection<ProcessingStatus> entities); 218 219 /** 220 * <p> 221 * Creates a new <code>ProcessingStatus</code> 222 * instance from <strong>all</strong> attributes and adds it to 223 * the persistent store. 224 * </p> 225 * @param code Code de l'état d'un traitement. 226Gébnéralement, parmi : SUCCESS, ERROR, WARNING, etc. 227 * @param name Libellé de l'état d'execution d'un traitement 228 * @param updateDate 229 * @return ProcessingStatus 230 */ 231 public ProcessingStatus create( 232 String code, 233 String name, 234 Timestamp updateDate); 235 236 /** 237 * <p> 238 * Does the same thing as {@link #create(String, Timestamp)} with an 239 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 240 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 241 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 242 * transform the entity (into a value object for example). By default, transformation does 243 * not occur. 244 * </p> 245 * @param transform 246 * @param code Code de l'état d'un traitement. 247Gébnéralement, parmi : SUCCESS, ERROR, WARNING, etc. 248 * @param name Libellé de l'état d'execution d'un traitement 249 * @param updateDate 250 * @return ProcessingStatus 251 */ 252 public Object create( 253 int transform, 254 String code, 255 String name, 256 Timestamp updateDate); 257 258 /** 259 * <p> 260 * Creates a new <code>ProcessingStatus</code> 261 * instance from only <strong>required</strong> properties (attributes 262 * and association ends) and adds it to the persistent store. 263 * </p> 264 * @param name 265 * @param status 266 * @return ProcessingStatus 267 */ 268 public ProcessingStatus create( 269 String name, 270 Status status); 271 272 /** 273 * <p> 274 * Does the same thing as {@link #create(String)} with an 275 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 276 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 277 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 278 * transform the entity (into a value object for example). By default, transformation does 279 * not occur. 280 * </p> 281 * @param transform flag to determine transformation type. 282 * @param name 283 * @param status 284 * @return Object 285 */ 286 public Object create( 287 int transform, 288 String name, 289 Status status); 290 291 /** 292 * Updates the <code>processingStatus</code> instance in the persistent store. 293 * @param processingStatus 294 */ 295 public void update(ProcessingStatus processingStatus); 296 297 /** 298 * Updates all instances in the <code>entities</code> collection in the persistent store. 299 * @param entities 300 */ 301 public void update(Collection<ProcessingStatus> entities); 302 303 /** 304 * Removes the instance of ProcessingStatus from the persistent store. 305 * @param processingStatus 306 */ 307 public void remove(ProcessingStatus processingStatus); 308 309 /** 310 * Removes the instance of ProcessingStatus having the given 311 * <code>identifier</code> from the persistent store. 312 * @param code 313 */ 314 public void remove(String code); 315 316 /** 317 * Removes all entities in the given <code>entities</code> collection. 318 * @param entities 319 */ 320 public void remove(Collection<ProcessingStatus> entities); 321 322 323 /** 324 * Does the same thing as {@link #search(int, Search)} but with an 325 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 326 * limit your data to a specified page number and size. 327 * 328 * @param transform the transformation flag. 329 * @param pageNumber the page number in the data to retrieve 330 * @param pageSize the size of the page to retrieve. 331 * @param search the search object which provides the search parameters and pagination specification. 332 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 333 */ 334 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 335 336 /** 337 * Does the same thing as {@link #search(Search)} but with an 338 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 339 * limit your data to a specified page number and size. 340 * 341 * @param pageNumber the page number in the data to retrieve 342 * @param pageSize the size of the page to retrieve. 343 * @param search the search object which provides the search parameters and pagination specification. 344 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 345 */ 346 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 347 348 /** 349 * Does the same thing as {@link #search(Search)} but with an 350 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 351 * finder results will <strong>NOT</strong> be transformed during retrieval. 352 * If this flag is any of the other constants defined here 353 * then results <strong>WILL BE</strong> passed through an operation which can optionally 354 * transform the entities (into value objects for example). By default, transformation does 355 * not occur. 356 * 357 * @param transform the transformation flag. 358 * @param search the search object which provides the search parameters and pagination specification. 359 * @return any found results from the search. 360 */ 361 public Set<?> search(final int transform, final Search search); 362 363 /** 364 * Performs a search using the parameters specified in the given <code>search</code> object. 365 * 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<ProcessingStatus> search(final Search search); 370 371 /** 372 * Allows transformation of entities into value objects 373 * (or something else for that matter), when the <code>transform</code> 374 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.ProcessingStatusDao</code>, please note 375 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 376 * will be returned. 377 * 378 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 379 * 380 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.ProcessingStatusDao} 381 * @param entity an entity that was found 382 * @return the transformed entity (i.e. new value object, etc) 383 * @see #transformEntities(int,Collection) 384 */ 385 public Object transformEntity(final int transform, final ProcessingStatus entity); 386 387 /** 388 * Transforms a collection of entities using the 389 * {@link #transformEntity(int,ProcessingStatus)} 390 * method. This method does not instantiate a new collection. 391 * <p> 392 * This method is to be used internally only. 393 * 394 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.ProcessingStatusDao</code> 395 * @param entities the collection of entities to transform 396 * @see #transformEntity(int,ProcessingStatus) 397 */ 398 public void transformEntities(final int transform, final Collection<?> entities); 399 400 // spring-dao merge-point 401}