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.conversion; 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.Status; 033import fr.ifremer.adagio.core.dao.referential.location.Location; 034import fr.ifremer.adagio.core.dao.referential.pmfm.Parameter; 035import fr.ifremer.adagio.core.dao.referential.pmfm.Unit; 036import fr.ifremer.adagio.core.dao.referential.taxon.ReferenceTaxon; 037import java.sql.Timestamp; 038import java.util.Collection; 039import java.util.Set; 040import org.andromda.spring.PaginationResult; 041 042/** 043 * <html> 044 * <head> 045 * </head> 046 * <body> 047 * <p> 048 * <b>Relation Taille poids</b> :<br><br> 049 * </p> 050 * <p> 051 * Le calcul se fait par multiplication de la taille d’un poisson par un 052 * coefficient multiplicateur (convCoeff). Ce coefficient est obtenu à 053 * partir des caractéristiques suivantes<br>- Taxon mesuré (=espèces 054 * scientifiques) : ReferenceTaxon<br>- Période (ex : du mois de "décembre" 055 * au mois de "juillet", indépendant de l'année): startMonth, endMonth<br>- 056 * Lieu ( Lieu père si inexistant).<br>- Sexe. Cette caractéristique 057 * n’étant pas renseignée systématiquement dans la table de correspondance, 058 * la recherche du coefficient doit d’abord s’effectuer sur les 059 * coefficients indépendant du sexe (Sex=null ). Si cette recherche est 060 * infructueuse, et si le sexe du lot est connu (critère de classement 061 * ‘sexe’ renseigné) une nouvelle recherche doit être lancée sur les 062 * coefficients ayant le sexe du lot considéré 063 * </p> 064 * </body> 065 * </html> 066 * @see WeightLengthConversion 067 */ 068public interface WeightLengthConversionDao 069{ 070 /** 071 * This constant is used as a transformation flag; entities can be converted automatically into value objects 072 * or other types, different methods in a class implementing this interface support this feature: look for 073 * an <code>int</code> parameter called <code>transform</code>. 074 * <p> 075 * This specific flag denotes no transformation will occur. 076 */ 077 public static final int TRANSFORM_NONE = 0; 078 079 080 /** 081 * Transforms the given results to a collection of {@link WeightLengthConversion} 082 * instances (this is useful when the returned results contains a row of data and you want just entities only). 083 * 084 * @param results the query results. 085 */ 086 public void toEntities(final Collection<?> results); 087 088 /** 089 * Gets an instance of WeightLengthConversion from the persistent store. 090 * @param id 091 * @return WeightLengthConversion 092 */ 093 public WeightLengthConversion get(Integer id); 094 095 /** 096 * <p> 097 * Does the same thing as {@link #get(Integer)} with an 098 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 099 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 100 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 101 * optionally transform the entity (into a value object for example). By default, transformation does 102 * not occur. 103 * </p> 104 * 105 * @param transform flag to determine transformation type. 106 * @param id the identifier of the entity to get. 107 * @return either the entity or the object transformed from the entity. 108 */ 109 public Object get(int transform, Integer id); 110 111 /** 112 * Loads an instance of WeightLengthConversion from the persistent store. 113 * @param id 114 * @return WeightLengthConversion 115 */ 116 public WeightLengthConversion load(Integer id); 117 118 /** 119 * <p> 120 * Does the same thing as {@link #load(Integer)} with an 121 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 122 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 123 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 124 * optionally transform the entity (into a value object for example). By default, transformation does 125 * not occur. 126 * </p> 127 * 128 * @param transform flag to determine transformation type. 129 * @param id the identifier of the entity to load. 130 * @return either the entity or the object transformed from the entity. 131 */ 132 public Object load(int transform, Integer id); 133 134 /** 135 * Loads all entities of type {@link WeightLengthConversion}. 136 * 137 * @return the loaded entities. 138 */ 139 public Collection<WeightLengthConversion> loadAll(); 140 141 /** 142 * <p> 143 * Does the same thing as {@link #loadAll()} with an 144 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 145 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 146 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 147 * transform the entity (into a value object for example). By default, transformation does 148 * not occur. 149 * </p> 150 * 151 * @param transform the flag indicating what transformation to use. 152 * @return the loaded entities. 153 */ 154 public Collection<?> loadAll(final int transform); 155 156 /** 157 * <p> 158 * Does the same thing as {@link #loadAll()} 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 pageNumber the page number to retrieve when paging results. 165 * @param pageSize the size of the page to retrieve when paging results. 166 * @return the loaded entities. 167 */ 168 public Collection<?> loadAll(final int pageNumber, final int pageSize); 169 170 /** 171 * <p> 172 * Does the same thing as {@link #loadAll(int)} with an 173 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 174 * 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 175 * page retrieved. 176 * </p> 177 * 178 * @param transform the flag indicating what transformation to use. 179 * @param pageNumber the page number to retrieve when paging results. 180 * @param pageSize the size of the page to retrieve when paging results. 181 * @return the loaded entities. 182 */ 183 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 184 185 /** 186 * Creates an instance of WeightLengthConversion and adds it to the persistent store. 187 * @param weightLengthConversion 188 * @return WeightLengthConversion 189 */ 190 public WeightLengthConversion create(WeightLengthConversion weightLengthConversion); 191 192 /** 193 * <p> 194 * Does the same thing as {@link #create(WeightLengthConversion)} with an 195 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 196 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 197 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 198 * transform the entity (into a value object for example). By default, transformation does 199 * not occur. 200 * </p> 201 * @param transform 202 * @param weightLengthConversion 203 * @return Object 204 */ 205 public Object create(int transform, WeightLengthConversion weightLengthConversion); 206 207 /** 208 * Creates a new instance of WeightLengthConversion and adds 209 * from the passed in <code>entities</code> collection 210 * 211 * @param entities the collection of WeightLengthConversion 212 * instances to create. 213 * 214 * @return the created instances. 215 */ 216 public Collection<WeightLengthConversion> create(Collection<WeightLengthConversion> entities); 217 218 /** 219 * <p> 220 * Does the same thing as {@link #create(WeightLengthConversion)} with an 221 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 222 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 223 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 224 * transform the entities (into value objects for example). By default, transformation does 225 * not occur. 226 * </p> 227 * @param transform 228 * @param entities 229 * @return Collection 230 */ 231 public Collection<?> create(int transform, Collection<WeightLengthConversion> entities); 232 233 /** 234 * <p> 235 * Creates a new <code>WeightLengthConversion</code> 236 * instance from <strong>all</strong> attributes and adds it to 237 * the persistent store. 238 * </p> 239 * @param conversionCoefficientA Coefficient A de le relation taille/poids. 240 * @param conversionCoefficientB Coefficient B de le relation taille/poids. 241 * @param startMonth Premier mois de l'année (inclus) à partir duquel la conversion s'applique. 242 * @param endMonth Dernier mois de l'année (inclus) à partir duquel la conversion ne s'applique plus. 243 * @param year Année sur laquelle a été établie la relation taille-poids (Optionnel). Si non renseigné, alors la 244relation est toujours valable ou bien l'année est inconnue. 245 * @param description 246 * @param comments 247 * @param updateDate 248 * @return WeightLengthConversion 249 */ 250 public WeightLengthConversion create( 251 Double conversionCoefficientA, 252 Double conversionCoefficientB, 253 Integer startMonth, 254 Integer endMonth, 255 Integer year, 256 String description, 257 String comments, 258 Timestamp updateDate); 259 260 /** 261 * <p> 262 * Does the same thing as {@link #create(Double, Double, Integer, Integer, Integer, String, String, Timestamp)} with an 263 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 264 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 265 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 266 * transform the entity (into a value object for example). By default, transformation does 267 * not occur. 268 * </p> 269 * @param transform 270 * @param conversionCoefficientA Coefficient A de le relation taille/poids. 271 * @param conversionCoefficientB Coefficient B de le relation taille/poids. 272 * @param startMonth Premier mois de l'année (inclus) à partir duquel la conversion s'applique. 273 * @param endMonth Dernier mois de l'année (inclus) à partir duquel la conversion ne s'applique plus. 274 * @param year Année sur laquelle a été établie la relation taille-poids (Optionnel). Si non renseigné, alors la 275relation est toujours valable ou bien l'année est inconnue. 276 * @param description 277 * @param comments 278 * @param updateDate 279 * @return WeightLengthConversion 280 */ 281 public Object create( 282 int transform, 283 Double conversionCoefficientA, 284 Double conversionCoefficientB, 285 Integer startMonth, 286 Integer endMonth, 287 Integer year, 288 String description, 289 String comments, 290 Timestamp updateDate); 291 292 /** 293 * <p> 294 * Creates a new <code>WeightLengthConversion</code> 295 * instance from only <strong>required</strong> properties (attributes 296 * and association ends) and adds it to the persistent store. 297 * </p> 298 * @param conversionCoefficientA 299 * @param conversionCoefficientB 300 * @param endMonth 301 * @param lengthParameter 302 * @param lengthUnit 303 * @param location 304 * @param referenceTaxon 305 * @param startMonth 306 * @param status 307 * @param updateDate 308 * @return WeightLengthConversion 309 */ 310 public WeightLengthConversion create( 311 Double conversionCoefficientA, 312 Double conversionCoefficientB, 313 Integer endMonth, 314 Parameter lengthParameter, 315 Unit lengthUnit, 316 Location location, 317 ReferenceTaxon referenceTaxon, 318 Integer startMonth, 319 Status status, 320 Timestamp updateDate); 321 322 /** 323 * <p> 324 * Does the same thing as {@link #create(Double, Double, Integer, Integer, Timestamp)} with an 325 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 326 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 327 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 328 * transform the entity (into a value object for example). By default, transformation does 329 * not occur. 330 * </p> 331 * @param transform flag to determine transformation type. 332 * @param conversionCoefficientA 333 * @param conversionCoefficientB 334 * @param endMonth 335 * @param lengthParameter 336 * @param lengthUnit 337 * @param location 338 * @param referenceTaxon 339 * @param startMonth 340 * @param status 341 * @param updateDate 342 * @return Object 343 */ 344 public Object create( 345 int transform, 346 Double conversionCoefficientA, 347 Double conversionCoefficientB, 348 Integer endMonth, 349 Parameter lengthParameter, 350 Unit lengthUnit, 351 Location location, 352 ReferenceTaxon referenceTaxon, 353 Integer startMonth, 354 Status status, 355 Timestamp updateDate); 356 357 /** 358 * Updates the <code>weightLengthConversion</code> instance in the persistent store. 359 * @param weightLengthConversion 360 */ 361 public void update(WeightLengthConversion weightLengthConversion); 362 363 /** 364 * Updates all instances in the <code>entities</code> collection in the persistent store. 365 * @param entities 366 */ 367 public void update(Collection<WeightLengthConversion> entities); 368 369 /** 370 * Removes the instance of WeightLengthConversion from the persistent store. 371 * @param weightLengthConversion 372 */ 373 public void remove(WeightLengthConversion weightLengthConversion); 374 375 /** 376 * Removes the instance of WeightLengthConversion having the given 377 * <code>identifier</code> from the persistent store. 378 * @param id 379 */ 380 public void remove(Integer id); 381 382 /** 383 * Removes all entities in the given <code>entities</code> collection. 384 * @param entities 385 */ 386 public void remove(Collection<WeightLengthConversion> entities); 387 388 389 /** 390 * Does the same thing as {@link #search(int, Search)} but with an 391 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 392 * limit your data to a specified page number and size. 393 * 394 * @param transform the transformation flag. 395 * @param pageNumber the page number in the data to retrieve 396 * @param pageSize the size of the page to retrieve. 397 * @param search the search object which provides the search parameters and pagination specification. 398 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 399 */ 400 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 401 402 /** 403 * Does the same thing as {@link #search(Search)} but with an 404 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 405 * limit your data to a specified page number and size. 406 * 407 * @param pageNumber the page number in the data to retrieve 408 * @param pageSize the size of the page to retrieve. 409 * @param search the search object which provides the search parameters and pagination specification. 410 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 411 */ 412 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 413 414 /** 415 * Does the same thing as {@link #search(Search)} but with an 416 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 417 * finder results will <strong>NOT</strong> be transformed during retrieval. 418 * If this flag is any of the other constants defined here 419 * then results <strong>WILL BE</strong> passed through an operation which can optionally 420 * transform the entities (into value objects for example). By default, transformation does 421 * not occur. 422 * 423 * @param transform the transformation flag. 424 * @param search the search object which provides the search parameters and pagination specification. 425 * @return any found results from the search. 426 */ 427 public Set<?> search(final int transform, final Search search); 428 429 /** 430 * Performs a search using the parameters specified in the given <code>search</code> object. 431 * 432 * @param search the search object which provides the search parameters and pagination specification. 433 * @return any found results from the search. 434 */ 435 public Set<WeightLengthConversion> search(final Search search); 436 437 /** 438 * Allows transformation of entities into value objects 439 * (or something else for that matter), when the <code>transform</code> 440 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.conversion.WeightLengthConversionDao</code>, please note 441 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 442 * will be returned. 443 * 444 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 445 * 446 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.conversion.WeightLengthConversionDao} 447 * @param entity an entity that was found 448 * @return the transformed entity (i.e. new value object, etc) 449 * @see #transformEntities(int,Collection) 450 */ 451 public Object transformEntity(final int transform, final WeightLengthConversion entity); 452 453 /** 454 * Transforms a collection of entities using the 455 * {@link #transformEntity(int,WeightLengthConversion)} 456 * method. This method does not instantiate a new collection. 457 * <p> 458 * This method is to be used internally only. 459 * 460 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.conversion.WeightLengthConversionDao</code> 461 * @param entities the collection of entities to transform 462 * @see #transformEntity(int,WeightLengthConversion) 463 */ 464 public void transformEntities(final int transform, final Collection<?> entities); 465 466 // spring-dao merge-point 467}