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.gear; 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 * Une classification d'engin permet le regroupement d'un ensemble cohérent d'engin. 039 * Exemple : 040 * - Engin FAO, appellée aussi CSITEP (Classification Standard Internationale Type des Engins de 041 * Pêche), ou, en anglais : International Standard Statistical Classification of Fishing Gear 042 * (ISSCFG) : ftp://ftp.fao.org/FI/DOCUMENT/cwp/handbook/annex/AnnexM1fishinggear.pdf 043 * - Engin CNTS (DPMA SIP) 044 * - Engin EU (basé sur les engins FAO, mais adapté au contexte réglementaire européen) : 045 * exemple : - extension pour signifier 'pas d'engin' : NO 046 * extension pour signifier 'engin inconnu' : NK (Not Known) 047 * 'ligne avec canne (...)' : BTF (code utilisé pour des données historique) 048 * - 'Engin EU Corpus' pour le traitment (cf DRE_CORPUS dans tmpsih) 049 * - Engin Métier Ifremer (basé sur la classification FAO, et etendue aux besoins Ifremer/francais) 050 * Pour ObsMer, la classification utilisée est : FAO 051 * Pour les observations au débarquement, la classification utilisée est : FAO + CNTS (pour 052 * recroiser avec les déclarations) 053 * @see GearClassification 054 */ 055public interface GearClassificationDao 056{ 057 /** 058 * This constant is used as a transformation flag; entities can be converted automatically into value objects 059 * or other types, different methods in a class implementing this interface support this feature: look for 060 * an <code>int</code> parameter called <code>transform</code>. 061 * <p> 062 * This specific flag denotes no transformation will occur. 063 */ 064 public static final int TRANSFORM_NONE = 0; 065 066 067 /** 068 * Transforms the given results to a collection of {@link GearClassification} 069 * instances (this is useful when the returned results contains a row of data and you want just entities only). 070 * 071 * @param results the query results. 072 */ 073 public void toEntities(final Collection<?> results); 074 075 /** 076 * Gets an instance of GearClassification from the persistent store. 077 * @param id 078 * @return GearClassification 079 */ 080 public GearClassification get(Integer id); 081 082 /** 083 * <p> 084 * Does the same thing as {@link #get(Integer)} with an 085 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 086 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 087 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 088 * optionally transform the entity (into a value object for example). By default, transformation does 089 * not occur. 090 * </p> 091 * 092 * @param transform flag to determine transformation type. 093 * @param id the identifier of the entity to get. 094 * @return either the entity or the object transformed from the entity. 095 */ 096 public Object get(int transform, Integer id); 097 098 /** 099 * Loads an instance of GearClassification from the persistent store. 100 * @param id 101 * @return GearClassification 102 */ 103 public GearClassification load(Integer id); 104 105 /** 106 * <p> 107 * Does the same thing as {@link #load(Integer)} with an 108 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 109 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 110 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 111 * optionally transform the entity (into a value object for example). By default, transformation does 112 * not occur. 113 * </p> 114 * 115 * @param transform flag to determine transformation type. 116 * @param id the identifier of the entity to load. 117 * @return either the entity or the object transformed from the entity. 118 */ 119 public Object load(int transform, Integer id); 120 121 /** 122 * Loads all entities of type {@link GearClassification}. 123 * 124 * @return the loaded entities. 125 */ 126 public Collection<GearClassification> loadAll(); 127 128 /** 129 * <p> 130 * Does the same thing as {@link #loadAll()} with an 131 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 132 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 133 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 134 * transform the entity (into a value object for example). By default, transformation does 135 * not occur. 136 * </p> 137 * 138 * @param transform the flag indicating what transformation to use. 139 * @return the loaded entities. 140 */ 141 public Collection<?> loadAll(final int transform); 142 143 /** 144 * <p> 145 * Does the same thing as {@link #loadAll()} with an 146 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 147 * 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 148 * page retrieved. 149 * </p> 150 * 151 * @param pageNumber the page number to retrieve when paging results. 152 * @param pageSize the size of the page to retrieve when paging results. 153 * @return the loaded entities. 154 */ 155 public Collection<?> loadAll(final int pageNumber, final int pageSize); 156 157 /** 158 * <p> 159 * Does the same thing as {@link #loadAll(int)} with an 160 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 161 * 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 162 * page retrieved. 163 * </p> 164 * 165 * @param transform the flag indicating what transformation to use. 166 * @param pageNumber the page number to retrieve when paging results. 167 * @param pageSize the size of the page to retrieve when paging results. 168 * @return the loaded entities. 169 */ 170 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 171 172 /** 173 * Creates an instance of GearClassification and adds it to the persistent store. 174 * @param gearClassification 175 * @return GearClassification 176 */ 177 public GearClassification create(GearClassification gearClassification); 178 179 /** 180 * <p> 181 * Does the same thing as {@link #create(GearClassification)} 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 * @param transform 189 * @param gearClassification 190 * @return Object 191 */ 192 public Object create(int transform, GearClassification gearClassification); 193 194 /** 195 * Creates a new instance of GearClassification and adds 196 * from the passed in <code>entities</code> collection 197 * 198 * @param entities the collection of GearClassification 199 * instances to create. 200 * 201 * @return the created instances. 202 */ 203 public Collection<GearClassification> create(Collection<GearClassification> entities); 204 205 /** 206 * <p> 207 * Does the same thing as {@link #create(GearClassification)} with an 208 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 209 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 210 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 211 * transform the entities (into value objects for example). By default, transformation does 212 * not occur. 213 * </p> 214 * @param transform 215 * @param entities 216 * @return Collection 217 */ 218 public Collection<?> create(int transform, Collection<GearClassification> entities); 219 220 /** 221 * <p> 222 * Creates a new <code>GearClassification</code> 223 * instance from <strong>all</strong> attributes and adds it to 224 * the persistent store. 225 * </p> 226 * @param name 227 * @param description 228 * @param isAggregation <html> 229<head> 230</head> 231<body> 232<p> 233TODO : confirmer si l'attribut est utile 234</p> 235<p> 236, dans la mesure ou les stratégies peuvent permettrent de choisir la 237classification à utiliser.<br> 238</p> 239<p> 240Indicateur permettant de savoir si la classification est utilisé 241uniquement dans le cadre de données d'agrégation. 242</p> 243</body> 244</html> 245 * @param updateDate 246 * @param comments 247 * @return GearClassification 248 */ 249 public GearClassification create( 250 String name, 251 String description, 252 Boolean isAggregation, 253 Timestamp updateDate, 254 String comments); 255 256 /** 257 * <p> 258 * Does the same thing as {@link #create(String, String, Boolean, Timestamp, String)} 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 entity (into a value object for example). By default, transformation does 263 * not occur. 264 * </p> 265 * @param transform 266 * @param name 267 * @param description 268 * @param isAggregation <html> 269<head> 270</head> 271<body> 272<p> 273TODO : confirmer si l'attribut est utile 274</p> 275<p> 276, dans la mesure ou les stratégies peuvent permettrent de choisir la 277classification à utiliser.<br> 278</p> 279<p> 280Indicateur permettant de savoir si la classification est utilisé 281uniquement dans le cadre de données d'agrégation. 282</p> 283</body> 284</html> 285 * @param updateDate 286 * @param comments 287 * @return GearClassification 288 */ 289 public Object create( 290 int transform, 291 String name, 292 String description, 293 Boolean isAggregation, 294 Timestamp updateDate, 295 String comments); 296 297 298 /** 299 * Updates the <code>gearClassification</code> instance in the persistent store. 300 * @param gearClassification 301 */ 302 public void update(GearClassification gearClassification); 303 304 /** 305 * Updates all instances in the <code>entities</code> collection in the persistent store. 306 * @param entities 307 */ 308 public void update(Collection<GearClassification> entities); 309 310 /** 311 * Removes the instance of GearClassification from the persistent store. 312 * @param gearClassification 313 */ 314 public void remove(GearClassification gearClassification); 315 316 /** 317 * Removes the instance of GearClassification having the given 318 * <code>identifier</code> from the persistent store. 319 * @param id 320 */ 321 public void remove(Integer id); 322 323 /** 324 * Removes all entities in the given <code>entities</code> collection. 325 * @param entities 326 */ 327 public void remove(Collection<GearClassification> entities); 328 329 330 /** 331 * Does the same thing as {@link #search(int, Search)} but with an 332 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 333 * limit your data to a specified page number and size. 334 * 335 * @param transform the transformation flag. 336 * @param pageNumber the page number in the data to retrieve 337 * @param pageSize the size of the page to retrieve. 338 * @param search the search object which provides the search parameters and pagination specification. 339 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 340 */ 341 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 342 343 /** 344 * Does the same thing as {@link #search(Search)} but with an 345 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 346 * limit your data to a specified page number and size. 347 * 348 * @param pageNumber the page number in the data to retrieve 349 * @param pageSize the size of the page to retrieve. 350 * @param search the search object which provides the search parameters and pagination specification. 351 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 352 */ 353 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 354 355 /** 356 * Does the same thing as {@link #search(Search)} but with an 357 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 358 * finder results will <strong>NOT</strong> be transformed during retrieval. 359 * If this flag is any of the other constants defined here 360 * then results <strong>WILL BE</strong> passed through an operation which can optionally 361 * transform the entities (into value objects for example). By default, transformation does 362 * not occur. 363 * 364 * @param transform the transformation flag. 365 * @param search the search object which provides the search parameters and pagination specification. 366 * @return any found results from the search. 367 */ 368 public Set<?> search(final int transform, final Search search); 369 370 /** 371 * Performs a search using the parameters specified in the given <code>search</code> object. 372 * 373 * @param search the search object which provides the search parameters and pagination specification. 374 * @return any found results from the search. 375 */ 376 public Set<GearClassification> search(final Search search); 377 378 /** 379 * Allows transformation of entities into value objects 380 * (or something else for that matter), when the <code>transform</code> 381 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.gear.GearClassificationDao</code>, please note 382 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 383 * will be returned. 384 * 385 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 386 * 387 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.gear.GearClassificationDao} 388 * @param entity an entity that was found 389 * @return the transformed entity (i.e. new value object, etc) 390 * @see #transformEntities(int,Collection) 391 */ 392 public Object transformEntity(final int transform, final GearClassification entity); 393 394 /** 395 * Transforms a collection of entities using the 396 * {@link #transformEntity(int,GearClassification)} 397 * method. This method does not instantiate a new collection. 398 * <p> 399 * This method is to be used internally only. 400 * 401 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.gear.GearClassificationDao</code> 402 * @param entities the collection of entities to transform 403 * @see #transformEntity(int,GearClassification) 404 */ 405 public void transformEntities(final int transform, final Collection<?> entities); 406 407 // spring-dao merge-point 408}