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.programStrategy; 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 fr.ifremer.adagio.core.dao.referential.gear.GearClassification; 033import fr.ifremer.adagio.core.dao.referential.location.LocationClassification; 034import fr.ifremer.adagio.core.dao.referential.taxon.TaxonGroupType; 035import java.sql.Timestamp; 036import java.util.Collection; 037import java.util.Date; 038import java.util.Set; 039import org.andromda.spring.PaginationResult; 040 041/** 042 * Programme d'observation à l'origine d'une collecte de données. 043 * Désigne les activités qui sont à l'origine de la collecte d'un ensemble cohérent de données, que 044 * ce soit pour des collectes continues (marées observées en mer, SIPA) ou pour des études limitées 045 * dans le temps. La quantité de données rattachées à un programme peut être variable, selon qu'il 046 * s'agit d'une activité longue ou intensive, ou d'une opération plus ponctuelle (étude) mais 047 * toujours mise en œuvre selon un schéma décidé à l'avance. 048 * Exemple de programmes d'observations : 049 * - SIH-OBSMER (marées observées en mer) 050 * - SIH-STATPECHE (enquete d'activité et d'effort...) 051 * - SIPA : données déclaratives transmises par la DPMA 052 * - VMS : données satellitaires 053 * - OFIMER : données du SI de l'OFIMER 054 * @see Program 055 */ 056public interface ProgramDao 057{ 058 /** 059 * This constant is used as a transformation flag; entities can be converted automatically into value objects 060 * or other types, different methods in a class implementing this interface support this feature: look for 061 * an <code>int</code> parameter called <code>transform</code>. 062 * <p> 063 * This specific flag denotes no transformation will occur. 064 */ 065 public static final int TRANSFORM_NONE = 0; 066 067 068 /** 069 * Transforms the given results to a collection of {@link Program} 070 * instances (this is useful when the returned results contains a row of data and you want just entities only). 071 * 072 * @param results the query results. 073 */ 074 public void toEntities(final Collection<?> results); 075 076 /** 077 * Gets an instance of Program from the persistent store. 078 * @param code 079 * @return Program 080 */ 081 public Program get(String code); 082 083 /** 084 * <p> 085 * Does the same thing as {@link #get(String)} with an 086 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 087 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 088 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 089 * optionally transform the entity (into a value object for example). By default, transformation does 090 * not occur. 091 * </p> 092 * 093 * @param transform flag to determine transformation type. 094 * @param code the identifier of the entity to get. 095 * @return either the entity or the object transformed from the entity. 096 */ 097 public Object get(int transform, String code); 098 099 /** 100 * Loads an instance of Program from the persistent store. 101 * @param code 102 * @return Program 103 */ 104 public Program load(String code); 105 106 /** 107 * <p> 108 * Does the same thing as {@link #load(String)} with an 109 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 110 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 111 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 112 * optionally transform the entity (into a value object for example). By default, transformation does 113 * not occur. 114 * </p> 115 * 116 * @param transform flag to determine transformation type. 117 * @param code the identifier of the entity to load. 118 * @return either the entity or the object transformed from the entity. 119 */ 120 public Object load(int transform, String code); 121 122 /** 123 * Loads all entities of type {@link Program}. 124 * 125 * @return the loaded entities. 126 */ 127 public Collection<Program> loadAll(); 128 129 /** 130 * <p> 131 * Does the same thing as {@link #loadAll()} with an 132 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 133 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 134 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 135 * transform the entity (into a value object for example). By default, transformation does 136 * not occur. 137 * </p> 138 * 139 * @param transform the flag indicating what transformation to use. 140 * @return the loaded entities. 141 */ 142 public Collection<?> loadAll(final int transform); 143 144 /** 145 * <p> 146 * Does the same thing as {@link #loadAll()} with an 147 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 148 * 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 149 * page retrieved. 150 * </p> 151 * 152 * @param pageNumber the page number to retrieve when paging results. 153 * @param pageSize the size of the page to retrieve when paging results. 154 * @return the loaded entities. 155 */ 156 public Collection<?> loadAll(final int pageNumber, final int pageSize); 157 158 /** 159 * <p> 160 * Does the same thing as {@link #loadAll(int)} with an 161 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 162 * 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 163 * page retrieved. 164 * </p> 165 * 166 * @param transform the flag indicating what transformation to use. 167 * @param pageNumber the page number to retrieve when paging results. 168 * @param pageSize the size of the page to retrieve when paging results. 169 * @return the loaded entities. 170 */ 171 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 172 173 /** 174 * Creates an instance of Program and adds it to the persistent store. 175 * @param program 176 * @return Program 177 */ 178 public Program create(Program program); 179 180 /** 181 * <p> 182 * Does the same thing as {@link #create(Program)} 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 * @param transform 190 * @param program 191 * @return Object 192 */ 193 public Object create(int transform, Program program); 194 195 /** 196 * Creates a new instance of Program and adds 197 * from the passed in <code>entities</code> collection 198 * 199 * @param entities the collection of Program 200 * instances to create. 201 * 202 * @return the created instances. 203 */ 204 public Collection<Program> create(Collection<Program> entities); 205 206 /** 207 * <p> 208 * Does the same thing as {@link #create(Program)} with an 209 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 210 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 211 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 212 * transform the entities (into value objects for example). By default, transformation does 213 * not occur. 214 * </p> 215 * @param transform 216 * @param entities 217 * @return Collection 218 */ 219 public Collection<?> create(int transform, Collection<Program> entities); 220 221 /** 222 * <p> 223 * Creates a new <code>Program</code> 224 * instance from <strong>all</strong> attributes and adds it to 225 * the persistent store. 226 * </p> 227 * @param code 228 * @param name 229 * @param description 230 * @param creationDate 231 * @param updateDate 232 * @return Program 233 */ 234 public Program create( 235 String code, 236 String name, 237 String description, 238 Date creationDate, 239 Timestamp updateDate); 240 241 /** 242 * <p> 243 * Does the same thing as {@link #create(String, String, Date, Timestamp)} with an 244 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 245 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 246 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 247 * transform the entity (into a value object for example). By default, transformation does 248 * not occur. 249 * </p> 250 * @param transform 251 * @param code 252 * @param name 253 * @param description 254 * @param creationDate 255 * @param updateDate 256 * @return Program 257 */ 258 public Object create( 259 int transform, 260 String code, 261 String name, 262 String description, 263 Date creationDate, 264 Timestamp updateDate); 265 266 /** 267 * <p> 268 * Creates a new <code>Program</code> 269 * instance from only <strong>required</strong> properties (attributes 270 * and association ends) and adds it to the persistent store. 271 * </p> 272 * @param creationDate 273 * @param description 274 * @param gearClassification 275 * @param locationClassifications 276 * @param name 277 * @param taxonGroupType 278 * @param updateDate 279 * @return Program 280 */ 281 public Program create( 282 Date creationDate, 283 String description, 284 GearClassification gearClassification, 285 Collection<LocationClassification> locationClassifications, 286 String name, 287 TaxonGroupType taxonGroupType, 288 Timestamp updateDate); 289 290 /** 291 * <p> 292 * Does the same thing as {@link #create(String, String, Date, Timestamp)} with an 293 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 294 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 295 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 296 * transform the entity (into a value object for example). By default, transformation does 297 * not occur. 298 * </p> 299 * @param transform flag to determine transformation type. 300 * @param creationDate 301 * @param description 302 * @param gearClassification 303 * @param locationClassifications 304 * @param name 305 * @param taxonGroupType 306 * @param updateDate 307 * @return Object 308 */ 309 public Object create( 310 int transform, 311 Date creationDate, 312 String description, 313 GearClassification gearClassification, 314 Collection<LocationClassification> locationClassifications, 315 String name, 316 TaxonGroupType taxonGroupType, 317 Timestamp updateDate); 318 319 /** 320 * Updates the <code>program</code> instance in the persistent store. 321 * @param program 322 */ 323 public void update(Program program); 324 325 /** 326 * Updates all instances in the <code>entities</code> collection in the persistent store. 327 * @param entities 328 */ 329 public void update(Collection<Program> entities); 330 331 /** 332 * Removes the instance of Program from the persistent store. 333 * @param program 334 */ 335 public void remove(Program program); 336 337 /** 338 * Removes the instance of Program having the given 339 * <code>identifier</code> from the persistent store. 340 * @param code 341 */ 342 public void remove(String code); 343 344 /** 345 * Removes all entities in the given <code>entities</code> collection. 346 * @param entities 347 */ 348 public void remove(Collection<Program> entities); 349 350 351 /** 352 * Does the same thing as {@link #search(int, Search)} but with an 353 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 354 * limit your data to a specified page number and size. 355 * 356 * @param transform the transformation flag. 357 * @param pageNumber the page number in the data to retrieve 358 * @param pageSize the size of the page to retrieve. 359 * @param search the search object which provides the search parameters and pagination specification. 360 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 361 */ 362 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 363 364 /** 365 * Does the same thing as {@link #search(Search)} but with an 366 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 367 * limit your data to a specified page number and size. 368 * 369 * @param pageNumber the page number in the data to retrieve 370 * @param pageSize the size of the page to retrieve. 371 * @param search the search object which provides the search parameters and pagination specification. 372 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 373 */ 374 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 375 376 /** 377 * Does the same thing as {@link #search(Search)} but with an 378 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 379 * finder results will <strong>NOT</strong> be transformed during retrieval. 380 * If this flag is any of the other constants defined here 381 * then results <strong>WILL BE</strong> passed through an operation which can optionally 382 * transform the entities (into value objects for example). By default, transformation does 383 * not occur. 384 * 385 * @param transform the transformation flag. 386 * @param search the search object which provides the search parameters and pagination specification. 387 * @return any found results from the search. 388 */ 389 public Set<?> search(final int transform, final Search search); 390 391 /** 392 * Performs a search using the parameters specified in the given <code>search</code> object. 393 * 394 * @param search the search object which provides the search parameters and pagination specification. 395 * @return any found results from the search. 396 */ 397 public Set<Program> search(final Search search); 398 399 /** 400 * Allows transformation of entities into value objects 401 * (or something else for that matter), when the <code>transform</code> 402 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramDao</code>, please note 403 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 404 * will be returned. 405 * 406 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 407 * 408 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramDao} 409 * @param entity an entity that was found 410 * @return the transformed entity (i.e. new value object, etc) 411 * @see #transformEntities(int,Collection) 412 */ 413 public Object transformEntity(final int transform, final Program entity); 414 415 /** 416 * Transforms a collection of entities using the 417 * {@link #transformEntity(int,Program)} 418 * method. This method does not instantiate a new collection. 419 * <p> 420 * This method is to be used internally only. 421 * 422 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.administration.programStrategy.ProgramDao</code> 423 * @param entities the collection of entities to transform 424 * @see #transformEntity(int,Program) 425 */ 426 public void transformEntities(final int transform, final Collection<?> entities); 427 428 // spring-dao merge-point 429}