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.data.measure; 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.data.sample.Sample; 033import fr.ifremer.adagio.core.dao.referential.QualityFlag; 034import fr.ifremer.adagio.core.dao.referential.pmfm.Pmfm; 035import java.util.Collection; 036import java.util.Date; 037import java.util.Set; 038import org.andromda.spring.PaginationResult; 039 040/** 041 * Valeur mesurée ou analysée sur un individu (résultats de mesures sur individu) appartenant à un 042 * prélèvement effectué lors d'un échantillonnage biologique, lors d'une marée, d'un vente ou d'un 043 * débarquement observé. Les observations sur le prélèvement sont souvent menées en laboratoire, à 044 * terre. 045 * @see SampleMeasurement 046 */ 047public interface SampleMeasurementDao 048{ 049 /** 050 * This constant is used as a transformation flag; entities can be converted automatically into value objects 051 * or other types, different methods in a class implementing this interface support this feature: look for 052 * an <code>int</code> parameter called <code>transform</code>. 053 * <p> 054 * This specific flag denotes no transformation will occur. 055 */ 056 public static final int TRANSFORM_NONE = 0; 057 058 059 /** 060 * Transforms the given results to a collection of {@link SampleMeasurement} 061 * instances (this is useful when the returned results contains a row of data and you want just entities only). 062 * 063 * @param results the query results. 064 */ 065 public void toEntities(final Collection<?> results); 066 067 /** 068 * Gets an instance of SampleMeasurement from the persistent store. 069 * @param id 070 * @return SampleMeasurement 071 */ 072 public SampleMeasurement get(Integer id); 073 074 /** 075 * <p> 076 * Does the same thing as {@link #get(Integer)} with an 077 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 078 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 079 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 080 * optionally transform the entity (into a value object for example). By default, transformation does 081 * not occur. 082 * </p> 083 * 084 * @param transform flag to determine transformation type. 085 * @param id the identifier of the entity to get. 086 * @return either the entity or the object transformed from the entity. 087 */ 088 public Object get(int transform, Integer id); 089 090 /** 091 * Loads an instance of SampleMeasurement from the persistent store. 092 * @param id 093 * @return SampleMeasurement 094 */ 095 public SampleMeasurement load(Integer id); 096 097 /** 098 * <p> 099 * Does the same thing as {@link #load(Integer)} with an 100 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 101 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 102 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 103 * optionally transform the entity (into a value object for example). By default, transformation does 104 * not occur. 105 * </p> 106 * 107 * @param transform flag to determine transformation type. 108 * @param id the identifier of the entity to load. 109 * @return either the entity or the object transformed from the entity. 110 */ 111 public Object load(int transform, Integer id); 112 113 /** 114 * Loads all entities of type {@link SampleMeasurement}. 115 * 116 * @return the loaded entities. 117 */ 118 public Collection<SampleMeasurement> loadAll(); 119 120 /** 121 * <p> 122 * Does the same thing as {@link #loadAll()} with an 123 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 124 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 125 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 126 * transform the entity (into a value object for example). By default, transformation does 127 * not occur. 128 * </p> 129 * 130 * @param transform the flag indicating what transformation to use. 131 * @return the loaded entities. 132 */ 133 public Collection<?> loadAll(final int transform); 134 135 /** 136 * <p> 137 * Does the same thing as {@link #loadAll()} with an 138 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 139 * 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 140 * page retrieved. 141 * </p> 142 * 143 * @param pageNumber the page number to retrieve when paging results. 144 * @param pageSize the size of the page to retrieve when paging results. 145 * @return the loaded entities. 146 */ 147 public Collection<?> loadAll(final int pageNumber, final int pageSize); 148 149 /** 150 * <p> 151 * Does the same thing as {@link #loadAll(int)} with an 152 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 153 * 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 154 * page retrieved. 155 * </p> 156 * 157 * @param transform the flag indicating what transformation to use. 158 * @param pageNumber the page number to retrieve when paging results. 159 * @param pageSize the size of the page to retrieve when paging results. 160 * @return the loaded entities. 161 */ 162 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 163 164 /** 165 * Creates an instance of SampleMeasurement and adds it to the persistent store. 166 * @param sampleMeasurement 167 * @return SampleMeasurement 168 */ 169 public SampleMeasurement create(SampleMeasurement sampleMeasurement); 170 171 /** 172 * <p> 173 * Does the same thing as {@link #create(SampleMeasurement)} with an 174 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 175 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 176 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 177 * transform the entity (into a value object for example). By default, transformation does 178 * not occur. 179 * </p> 180 * @param transform 181 * @param sampleMeasurement 182 * @return Object 183 */ 184 public Object create(int transform, SampleMeasurement sampleMeasurement); 185 186 /** 187 * Creates a new instance of SampleMeasurement and adds 188 * from the passed in <code>entities</code> collection 189 * 190 * @param entities the collection of SampleMeasurement 191 * instances to create. 192 * 193 * @return the created instances. 194 */ 195 public Collection<SampleMeasurement> create(Collection<SampleMeasurement> entities); 196 197 /** 198 * <p> 199 * Does the same thing as {@link #create(SampleMeasurement)} with an 200 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 201 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 202 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 203 * transform the entities (into value objects for example). By default, transformation does 204 * not occur. 205 * </p> 206 * @param transform 207 * @param entities 208 * @return Collection 209 */ 210 public Collection<?> create(int transform, Collection<SampleMeasurement> entities); 211 212 /** 213 * <p> 214 * Creates a new <code>SampleMeasurement</code> 215 * instance from <strong>all</strong> attributes and adds it to 216 * the persistent store. 217 * </p> 218 * @param individualNumber Numéro de l'individu sur lequel est effectué la mesure. 219(quand plusieurs individu ont été comptés, au niveau de l'échantillon) 220 * @param isReferenceMeasurement Dans le cas de plusieurs résultat de mesure au sein d'un prélèvement sur un meme individu (identifié 221par le numéro d'individu), cela permet de distinguer la valeur de référence (celle qu'il faudra 222exploiter) tout en gardant les autres mesure. 223Exemple : 224- Pour la leture d'age, plusieurs déterminations d'age sont effectuées, mais une seule est 225conservée. 226 * @param numericalValue <html> 227<head> 228<title>V </title> 229</head> 230<body> 231valeur numérique de la mesure.<br>Elle est nécessairement exprimée 232dans l'unité associé au PSFM de la mesure. 233<br> 234Renseigné uniquement pour un PSFM numérique 235(PMFM.parameter.isQualitative=false) 236</body> 237</html> 238 * @param alphanumericalValue <html> 239<head> 240</head> 241<body> 242<p> 243Valeur alphanumérique de la mesure. 244<br> </p> 245<p> 246<br> 247<u>Attention :</u> <b>Utilisation à éviter</b>. A utiliser 248uniquement dans des cas ou les valeurs qualitatives ne peuvent pas 249convenir (format non fixe, etc.). 250</p> 251<p> 252</p> 253<p> 254Exemples :<br>* Numéros de contrat (Ventre ERS)<br>* Type de 255dimension d'engin (logbook - flux SACAPT) "2X60", "2x6 dragues 75", 256"13.9x2", "2x7m²", "2x17.50", "2m x 2", etc 257</p> 258</body> 259</html> 260 * @param digitCount <html> 261<head> 262</head> 263<body> 264<p> 265Nombre de digits saisis dans la valeur numérique de la mesure. 266</p> 267<p> 268</p> 269<p> 270Cela permet de stocker "10.00" (numericalvalue=10 et digitCount=2) et de 271pouvoir restituer la valeur sous la meme forme. 272</p> 273</body> 274</html> 275 * @param precisionValue <html> 276<head> 277</head> 278<body> 279<p> 280Précision de la mesure. Par exemple : precisioNValue=0.5 pour indiquer 281une précision à + ou - "0.5". 282<br> </p> 283<p> 284</p> 285<p> 286Valeur exprimée soit dans l'unite de la mesure (ex : "mm"), soit en 287poucentage de la mesure (suivant la valeur de <i>PrecisionType</i>). 288</p> 289</body> 290</html> 291 * @param controlDate Date du controle de la donnée. 292Le controle est la première phase de validation de la donnée. 293Exemple : 294- Dans Allegro, ce controle est effectué lorsque l'utilisateur a achevé sa saisie et qu'il souhaite 295"Terminer la saisie", dans le but de transmettre ses données au système centrale. Les controle 296effectué par Allegro sur le poste client sont des vérifications sur les champs obligatoires, ou 297encore sur la cohérence des données (cas d'un arbre d'échantillonnage). 298 * @param validationDate Date de validation de la donnée. 299La validation est typiquement effectué par un thématicien responsable des données. Dans Allegro, il 300s'agit du superviseur du portefeuille de données qui en est responsable. 301 * @param qualificationDate Date de qualification de la donnée. 302L'étape de qualification est liée à l'affectation d'un flag qualité (bon, mauvais, etc.) sur la 303donnée. 304- la qualification n'est pas encore gérée dans Allegro, dans le sens ou il n'existe pass encore 305d'interface pour affecter le flag qualité. Par défaut, le niveau de qualité est donc à "non 306qualifiée" 307 * @param qualificationComments 308 * @return SampleMeasurement 309 */ 310 public SampleMeasurement create( 311 Short individualNumber, 312 Boolean isReferenceMeasurement, 313 Float numericalValue, 314 String alphanumericalValue, 315 Integer digitCount, 316 Float precisionValue, 317 Date controlDate, 318 Date validationDate, 319 Date qualificationDate, 320 String qualificationComments); 321 322 /** 323 * <p> 324 * Does the same thing as {@link #create(Short, Boolean, Float, String, Integer, Float, Date, Date, Date, String)} 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 332 * @param individualNumber Numéro de l'individu sur lequel est effectué la mesure. 333(quand plusieurs individu ont été comptés, au niveau de l'échantillon) 334 * @param isReferenceMeasurement Dans le cas de plusieurs résultat de mesure au sein d'un prélèvement sur un meme individu (identifié 335par le numéro d'individu), cela permet de distinguer la valeur de référence (celle qu'il faudra 336exploiter) tout en gardant les autres mesure. 337Exemple : 338- Pour la leture d'age, plusieurs déterminations d'age sont effectuées, mais une seule est 339conservée. 340 * @param numericalValue <html> 341<head> 342<title>V </title> 343</head> 344<body> 345valeur numérique de la mesure.<br>Elle est nécessairement exprimée 346dans l'unité associé au PSFM de la mesure. 347<br> 348Renseigné uniquement pour un PSFM numérique 349(PMFM.parameter.isQualitative=false) 350</body> 351</html> 352 * @param alphanumericalValue <html> 353<head> 354</head> 355<body> 356<p> 357Valeur alphanumérique de la mesure. 358<br> </p> 359<p> 360<br> 361<u>Attention :</u> <b>Utilisation à éviter</b>. A utiliser 362uniquement dans des cas ou les valeurs qualitatives ne peuvent pas 363convenir (format non fixe, etc.). 364</p> 365<p> 366</p> 367<p> 368Exemples :<br>* Numéros de contrat (Ventre ERS)<br>* Type de 369dimension d'engin (logbook - flux SACAPT) "2X60", "2x6 dragues 75", 370"13.9x2", "2x7m²", "2x17.50", "2m x 2", etc 371</p> 372</body> 373</html> 374 * @param digitCount <html> 375<head> 376</head> 377<body> 378<p> 379Nombre de digits saisis dans la valeur numérique de la mesure. 380</p> 381<p> 382</p> 383<p> 384Cela permet de stocker "10.00" (numericalvalue=10 et digitCount=2) et de 385pouvoir restituer la valeur sous la meme forme. 386</p> 387</body> 388</html> 389 * @param precisionValue <html> 390<head> 391</head> 392<body> 393<p> 394Précision de la mesure. Par exemple : precisioNValue=0.5 pour indiquer 395une précision à + ou - "0.5". 396<br> </p> 397<p> 398</p> 399<p> 400Valeur exprimée soit dans l'unite de la mesure (ex : "mm"), soit en 401poucentage de la mesure (suivant la valeur de <i>PrecisionType</i>). 402</p> 403</body> 404</html> 405 * @param controlDate Date du controle de la donnée. 406Le controle est la première phase de validation de la donnée. 407Exemple : 408- Dans Allegro, ce controle est effectué lorsque l'utilisateur a achevé sa saisie et qu'il souhaite 409"Terminer la saisie", dans le but de transmettre ses données au système centrale. Les controle 410effectué par Allegro sur le poste client sont des vérifications sur les champs obligatoires, ou 411encore sur la cohérence des données (cas d'un arbre d'échantillonnage). 412 * @param validationDate Date de validation de la donnée. 413La validation est typiquement effectué par un thématicien responsable des données. Dans Allegro, il 414s'agit du superviseur du portefeuille de données qui en est responsable. 415 * @param qualificationDate Date de qualification de la donnée. 416L'étape de qualification est liée à l'affectation d'un flag qualité (bon, mauvais, etc.) sur la 417donnée. 418- la qualification n'est pas encore gérée dans Allegro, dans le sens ou il n'existe pass encore 419d'interface pour affecter le flag qualité. Par défaut, le niveau de qualité est donc à "non 420qualifiée" 421 * @param qualificationComments 422 * @return SampleMeasurement 423 */ 424 public Object create( 425 int transform, 426 Short individualNumber, 427 Boolean isReferenceMeasurement, 428 Float numericalValue, 429 String alphanumericalValue, 430 Integer digitCount, 431 Float precisionValue, 432 Date controlDate, 433 Date validationDate, 434 Date qualificationDate, 435 String qualificationComments); 436 437 /** 438 * <p> 439 * Creates a new <code>SampleMeasurement</code> 440 * instance from only <strong>required</strong> properties (attributes 441 * and association ends) and adds it to the persistent store. 442 * </p> 443 * @param pmfm 444 * @param qualityFlag 445 * @param isReferenceMeasurement 446 * @param sample 447 * @return SampleMeasurement 448 */ 449 public SampleMeasurement create( 450 Pmfm pmfm, 451 QualityFlag qualityFlag, 452 Boolean isReferenceMeasurement, 453 Sample sample); 454 455 /** 456 * <p> 457 * Does the same thing as {@link #create(Boolean)} with an 458 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 459 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 460 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 461 * transform the entity (into a value object for example). By default, transformation does 462 * not occur. 463 * </p> 464 * @param transform flag to determine transformation type. 465 * @param pmfm 466 * @param qualityFlag 467 * @param isReferenceMeasurement 468 * @param sample 469 * @return Object 470 */ 471 public Object create( 472 int transform, 473 Pmfm pmfm, 474 QualityFlag qualityFlag, 475 Boolean isReferenceMeasurement, 476 Sample sample); 477 478 /** 479 * Updates the <code>sampleMeasurement</code> instance in the persistent store. 480 * @param sampleMeasurement 481 */ 482 public void update(SampleMeasurement sampleMeasurement); 483 484 /** 485 * Updates all instances in the <code>entities</code> collection in the persistent store. 486 * @param entities 487 */ 488 public void update(Collection<SampleMeasurement> entities); 489 490 /** 491 * Removes the instance of SampleMeasurement from the persistent store. 492 * @param sampleMeasurement 493 */ 494 public void remove(SampleMeasurement sampleMeasurement); 495 496 /** 497 * Removes the instance of SampleMeasurement having the given 498 * <code>identifier</code> from the persistent store. 499 * @param id 500 */ 501 public void remove(Integer id); 502 503 /** 504 * Removes all entities in the given <code>entities</code> collection. 505 * @param entities 506 */ 507 public void remove(Collection<SampleMeasurement> entities); 508 509 510 /** 511 * Does the same thing as {@link #search(int, Search)} but with an 512 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 513 * limit your data to a specified page number and size. 514 * 515 * @param transform the transformation flag. 516 * @param pageNumber the page number in the data to retrieve 517 * @param pageSize the size of the page to retrieve. 518 * @param search the search object which provides the search parameters and pagination specification. 519 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 520 */ 521 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 522 523 /** 524 * Does the same thing as {@link #search(Search)} but with an 525 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 526 * limit your data to a specified page number and size. 527 * 528 * @param pageNumber the page number in the data to retrieve 529 * @param pageSize the size of the page to retrieve. 530 * @param search the search object which provides the search parameters and pagination specification. 531 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 532 */ 533 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 534 535 /** 536 * Does the same thing as {@link #search(Search)} but with an 537 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 538 * finder results will <strong>NOT</strong> be transformed during retrieval. 539 * If this flag is any of the other constants defined here 540 * then results <strong>WILL BE</strong> passed through an operation which can optionally 541 * transform the entities (into value objects for example). By default, transformation does 542 * not occur. 543 * 544 * @param transform the transformation flag. 545 * @param search the search object which provides the search parameters and pagination specification. 546 * @return any found results from the search. 547 */ 548 public Set<?> search(final int transform, final Search search); 549 550 /** 551 * Performs a search using the parameters specified in the given <code>search</code> object. 552 * 553 * @param search the search object which provides the search parameters and pagination specification. 554 * @return any found results from the search. 555 */ 556 public Set<SampleMeasurement> search(final Search search); 557 558 /** 559 * Allows transformation of entities into value objects 560 * (or something else for that matter), when the <code>transform</code> 561 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.data.measure.SampleMeasurementDao</code>, please note 562 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 563 * will be returned. 564 * 565 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 566 * 567 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.data.measure.SampleMeasurementDao} 568 * @param entity an entity that was found 569 * @return the transformed entity (i.e. new value object, etc) 570 * @see #transformEntities(int,Collection) 571 */ 572 public Object transformEntity(final int transform, final SampleMeasurement entity); 573 574 /** 575 * Transforms a collection of entities using the 576 * {@link #transformEntity(int,SampleMeasurement)} 577 * method. This method does not instantiate a new collection. 578 * <p> 579 * This method is to be used internally only. 580 * 581 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.data.measure.SampleMeasurementDao</code> 582 * @param entities the collection of entities to transform 583 * @see #transformEntity(int,SampleMeasurement) 584 */ 585 public void transformEntities(final int transform, final Collection<?> entities); 586 587 // spring-dao merge-point 588}