1 // license-header java merge-point 2 // 3 // Attention: Generated code! Do not modify by hand! 4 // Generated by: SpringDao.vsl in andromda-spring-cartridge. 5 // 6 package fr.ifremer.quadrige2.core.dao.data.samplingoperation; 7 8 /*- 9 * #%L 10 * Quadrige2 Core :: Server API 11 * %% 12 * Copyright (C) 2017 Ifremer 13 * %% 14 * This program is free software: you can redistribute it and/or modify 15 * it under the terms of the GNU Affero General Public License as published by 16 * the Free Software Foundation, either version 3 of the License, or 17 * (at your option) any later version. 18 * 19 * This program is distributed in the hope that it will be useful, 20 * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 * GNU General Public License for more details. 23 * 24 * You should have received a copy of the GNU Affero General Public License 25 * along with this program. If not, see <http://www.gnu.org/licenses/>. 26 * #L% 27 */ 28 29 import fr.ifremer.quadrige2.core.dao.Search; 30 import fr.ifremer.quadrige2.core.dao.administration.user.Department; 31 import fr.ifremer.quadrige2.core.dao.data.survey.Survey; 32 import fr.ifremer.quadrige2.core.dao.referential.QualityFlag; 33 import fr.ifremer.quadrige2.core.dao.referential.SamplingEquipment; 34 import java.sql.Timestamp; 35 import java.util.Collection; 36 import java.util.Date; 37 import java.util.Set; 38 import org.andromda.spring.PaginationResult; 39 40 /** 41 * Liste les prélévements effectués lors d'un passage. 42 * @see SamplingOperation 43 */ 44 public interface SamplingOperationDao 45 { 46 /** 47 * This constant is used as a transformation flag; entities can be converted automatically into value objects 48 * or other types, different methods in a class implementing this interface support this feature: look for 49 * an <code>int</code> parameter called <code>transform</code>. 50 * <p> 51 * This specific flag denotes no transformation will occur. 52 */ 53 public static final int TRANSFORM_NONE = 0; 54 55 56 /** 57 * Transforms the given results to a collection of {@link SamplingOperation} 58 * instances (this is useful when the returned results contains a row of data and you want just entities only). 59 * 60 * @param results the query results. 61 */ 62 public void toEntities(final Collection<?> results); 63 64 /** 65 * Gets an instance of SamplingOperation from the persistent store. 66 * @param samplingOperId 67 * @return SamplingOperation 68 */ 69 public SamplingOperation get(Integer samplingOperId); 70 71 /** 72 * <p> 73 * Does the same thing as {@link #get(Integer)} with an 74 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 75 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 76 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 77 * optionally transform the entity (into a value object for example). By default, transformation does 78 * not occur. 79 * </p> 80 * 81 * @param transform flag to determine transformation type. 82 * @param samplingOperId the identifier of the entity to get. 83 * @return either the entity or the object transformed from the entity. 84 */ 85 public Object get(int transform, Integer samplingOperId); 86 87 /** 88 * Loads an instance of SamplingOperation from the persistent store. 89 * @param samplingOperId 90 * @return SamplingOperation 91 */ 92 public SamplingOperation load(Integer samplingOperId); 93 94 /** 95 * <p> 96 * Does the same thing as {@link #load(Integer)} with an 97 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 98 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 99 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 100 * optionally transform the entity (into a value object for example). By default, transformation does 101 * not occur. 102 * </p> 103 * 104 * @param transform flag to determine transformation type. 105 * @param samplingOperId the identifier of the entity to load. 106 * @return either the entity or the object transformed from the entity. 107 */ 108 public Object load(int transform, Integer samplingOperId); 109 110 /** 111 * Loads all entities of type {@link SamplingOperation}. 112 * 113 * @return the loaded entities. 114 */ 115 public Collection<SamplingOperation> loadAll(); 116 117 /** 118 * <p> 119 * Does the same thing as {@link #loadAll()} with an 120 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 121 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 122 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 123 * transform the entity (into a value object for example). By default, transformation does 124 * not occur. 125 * </p> 126 * 127 * @param transform the flag indicating what transformation to use. 128 * @return the loaded entities. 129 */ 130 public Collection<?> loadAll(final int transform); 131 132 /** 133 * <p> 134 * Does the same thing as {@link #loadAll()} with an 135 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 136 * 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 137 * page retrieved. 138 * </p> 139 * 140 * @param pageNumber the page number to retrieve when paging results. 141 * @param pageSize the size of the page to retrieve when paging results. 142 * @return the loaded entities. 143 */ 144 public Collection<?> loadAll(final int pageNumber, final int pageSize); 145 146 /** 147 * <p> 148 * Does the same thing as {@link #loadAll(int)} with an 149 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 150 * 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 151 * page retrieved. 152 * </p> 153 * 154 * @param transform the flag indicating what transformation to use. 155 * @param pageNumber the page number to retrieve when paging results. 156 * @param pageSize the size of the page to retrieve when paging results. 157 * @return the loaded entities. 158 */ 159 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 160 161 /** 162 * Creates an instance of SamplingOperation and adds it to the persistent store. 163 * @param samplingOperation 164 * @return SamplingOperation 165 */ 166 public SamplingOperation create(SamplingOperation samplingOperation); 167 168 /** 169 * <p> 170 * Does the same thing as {@link #create(SamplingOperation)} with an 171 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 172 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 173 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 174 * transform the entity (into a value object for example). By default, transformation does 175 * not occur. 176 * </p> 177 * @param transform 178 * @param samplingOperation 179 * @return Object 180 */ 181 public Object create(int transform, SamplingOperation samplingOperation); 182 183 /** 184 * Creates a new instance of SamplingOperation and adds 185 * from the passed in <code>entities</code> collection 186 * 187 * @param entities the collection of SamplingOperation 188 * instances to create. 189 * 190 * @return the created instances. 191 */ 192 public Collection<SamplingOperation> create(Collection<SamplingOperation> entities); 193 194 /** 195 * <p> 196 * Does the same thing as {@link #create(SamplingOperation)} with an 197 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 198 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 199 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 200 * transform the entities (into value objects for example). By default, transformation does 201 * not occur. 202 * </p> 203 * @param transform 204 * @param entities 205 * @return Collection 206 */ 207 public Collection<?> create(int transform, Collection<SamplingOperation> entities); 208 209 /** 210 * <p> 211 * Creates a new <code>SamplingOperation</code> 212 * instance from <strong>all</strong> attributes and adds it to 213 * the persistent store. 214 * </p> 215 * @param samplingOperLb Mnémonique du prélèvement. 216 * @param samplingOperDepth Immersion du prélèvement. Cette valeur est exclusive de la fourchette min max d'immersion. Elle 217 n'est pas obligatoire. 218 * @param samplingOperMaxDepth Valeur max de la fourchette d'immersion 219 * @param samplingOperMinDepth Valeur min de la fourchette d'immersion 220 * @param samplingOperSize Taille du prélèvement (surface, volume, poids, ¿ prélevé). 221 * @param samplingOperTime Heure à laquelle le prélèvement est effectué (HH24:MM). Pas de seconde a priori, mais exprimé en 222 seconde pour être homogène. 223 * @param samplingOperNumberIndiv Nombre d'individus, par exemple il y a une vingtaine d'huitre dans le prélèvement. 224 Il est à noter que cette quantité n'est pas redondante avec la somme des individus des résultats de 225 mesures. 226 * @param samplingOperCm Commentaire sur le prélèvement 227 * @param samplingOperUtFormat Format UT de l'heure pour le prélèvement [-12;12] 228 * @param samplingOperQualifDt Date de qualification du prélèvement 229 * @param samplingOperQualifCm Commentaire sur la qualification du prélèvement 230 * @param samplingOperControlDt Date de contrôle du prélèvement 231 * @param samplingOperValidDt Date de validation du prélèvement 232 * @param samplingOperActualPosition Vrai s'il s'agit dune géométrie définie par l'utilisateur, faux si la géométrie est héritée 233 * @param samplingOperPositionCm Commentaire associé à la localisation 234 * @param samplingOperGeomValidDt Date de validation de la géométrie du prélèvement 235 * @param samplingOperScope Vrai si l'étape de qualification est globale, faux si des éléments fils ou résultats n'ont pas la 236 même étape 237 * @param samplingOperHasMeas Vrai si l'élément a des résultats de mesure, dénombrement ou fichier 238 * @param updateDt Date de modification de l'objet, mise à jour par le système 239 * @return SamplingOperation 240 */ 241 public SamplingOperation create( 242 String samplingOperLb, 243 Float samplingOperDepth, 244 Float samplingOperMaxDepth, 245 Float samplingOperMinDepth, 246 Float samplingOperSize, 247 Double samplingOperTime, 248 Double samplingOperNumberIndiv, 249 String samplingOperCm, 250 Double samplingOperUtFormat, 251 Date samplingOperQualifDt, 252 String samplingOperQualifCm, 253 Date samplingOperControlDt, 254 Date samplingOperValidDt, 255 String samplingOperActualPosition, 256 String samplingOperPositionCm, 257 Date samplingOperGeomValidDt, 258 String samplingOperScope, 259 String samplingOperHasMeas, 260 Timestamp updateDt); 261 262 /** 263 * <p> 264 * Does the same thing as {@link #create(String, Float, Float, Float, Float, Double, Double, String, Double, Date, String, Date, Date, String, String, Date, String, String, Timestamp)} with an 265 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 266 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 267 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 268 * transform the entity (into a value object for example). By default, transformation does 269 * not occur. 270 * </p> 271 * @param transform 272 * @param samplingOperLb Mnémonique du prélèvement. 273 * @param samplingOperDepth Immersion du prélèvement. Cette valeur est exclusive de la fourchette min max d'immersion. Elle 274 n'est pas obligatoire. 275 * @param samplingOperMaxDepth Valeur max de la fourchette d'immersion 276 * @param samplingOperMinDepth Valeur min de la fourchette d'immersion 277 * @param samplingOperSize Taille du prélèvement (surface, volume, poids, ¿ prélevé). 278 * @param samplingOperTime Heure à laquelle le prélèvement est effectué (HH24:MM). Pas de seconde a priori, mais exprimé en 279 seconde pour être homogène. 280 * @param samplingOperNumberIndiv Nombre d'individus, par exemple il y a une vingtaine d'huitre dans le prélèvement. 281 Il est à noter que cette quantité n'est pas redondante avec la somme des individus des résultats de 282 mesures. 283 * @param samplingOperCm Commentaire sur le prélèvement 284 * @param samplingOperUtFormat Format UT de l'heure pour le prélèvement [-12;12] 285 * @param samplingOperQualifDt Date de qualification du prélèvement 286 * @param samplingOperQualifCm Commentaire sur la qualification du prélèvement 287 * @param samplingOperControlDt Date de contrôle du prélèvement 288 * @param samplingOperValidDt Date de validation du prélèvement 289 * @param samplingOperActualPosition Vrai s'il s'agit dune géométrie définie par l'utilisateur, faux si la géométrie est héritée 290 * @param samplingOperPositionCm Commentaire associé à la localisation 291 * @param samplingOperGeomValidDt Date de validation de la géométrie du prélèvement 292 * @param samplingOperScope Vrai si l'étape de qualification est globale, faux si des éléments fils ou résultats n'ont pas la 293 même étape 294 * @param samplingOperHasMeas Vrai si l'élément a des résultats de mesure, dénombrement ou fichier 295 * @param updateDt Date de modification de l'objet, mise à jour par le système 296 * @return SamplingOperation 297 */ 298 public Object create( 299 int transform, 300 String samplingOperLb, 301 Float samplingOperDepth, 302 Float samplingOperMaxDepth, 303 Float samplingOperMinDepth, 304 Float samplingOperSize, 305 Double samplingOperTime, 306 Double samplingOperNumberIndiv, 307 String samplingOperCm, 308 Double samplingOperUtFormat, 309 Date samplingOperQualifDt, 310 String samplingOperQualifCm, 311 Date samplingOperControlDt, 312 Date samplingOperValidDt, 313 String samplingOperActualPosition, 314 String samplingOperPositionCm, 315 Date samplingOperGeomValidDt, 316 String samplingOperScope, 317 String samplingOperHasMeas, 318 Timestamp updateDt); 319 320 /** 321 * <p> 322 * Creates a new <code>SamplingOperation</code> 323 * instance from only <strong>required</strong> properties (attributes 324 * and association ends) and adds it to the persistent store. 325 * </p> 326 * @param updateDt 327 * @param recorderDepartment 328 * @param department 329 * @param qualityFlag 330 * @param survey 331 * @param samplingEquipment 332 * @return SamplingOperation 333 */ 334 public SamplingOperation create( 335 Timestamp updateDt, 336 Department recorderDepartment, 337 Department department, 338 QualityFlag qualityFlag, 339 Survey survey, 340 SamplingEquipment samplingEquipment); 341 342 /** 343 * <p> 344 * Does the same thing as {@link #create(Timestamp)} with an 345 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 346 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 347 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 348 * transform the entity (into a value object for example). By default, transformation does 349 * not occur. 350 * </p> 351 * @param transform flag to determine transformation type. 352 * @param updateDt 353 * @param recorderDepartment 354 * @param department 355 * @param qualityFlag 356 * @param survey 357 * @param samplingEquipment 358 * @return Object 359 */ 360 public Object create( 361 int transform, 362 Timestamp updateDt, 363 Department recorderDepartment, 364 Department department, 365 QualityFlag qualityFlag, 366 Survey survey, 367 SamplingEquipment samplingEquipment); 368 369 /** 370 * Updates the <code>samplingOperation</code> instance in the persistent store. 371 * @param samplingOperation 372 */ 373 public void update(SamplingOperation samplingOperation); 374 375 /** 376 * Updates all instances in the <code>entities</code> collection in the persistent store. 377 * @param entities 378 */ 379 public void update(Collection<SamplingOperation> entities); 380 381 /** 382 * Removes the instance of SamplingOperation from the persistent store. 383 * @param samplingOperation 384 */ 385 public void remove(SamplingOperation samplingOperation); 386 387 /** 388 * Removes the instance of SamplingOperation having the given 389 * <code>identifier</code> from the persistent store. 390 * @param samplingOperId 391 */ 392 public void remove(Integer samplingOperId); 393 394 /** 395 * Removes all entities in the given <code>entities</code> collection. 396 * @param entities 397 */ 398 public void remove(Collection<SamplingOperation> entities); 399 400 401 /** 402 * Does the same thing as {@link #search(int, Search)} but with an 403 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 404 * limit your data to a specified page number and size. 405 * 406 * @param transform the transformation flag. 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 transform, 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 two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 417 * limit your data to a specified page number and size. 418 * 419 * @param pageNumber the page number in the data to retrieve 420 * @param pageSize the size of the page to retrieve. 421 * @param search the search object which provides the search parameters and pagination specification. 422 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 423 */ 424 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 425 426 /** 427 * Does the same thing as {@link #search(Search)} but with an 428 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 429 * finder results will <strong>NOT</strong> be transformed during retrieval. 430 * If this flag is any of the other constants defined here 431 * then results <strong>WILL BE</strong> passed through an operation which can optionally 432 * transform the entities (into value objects for example). By default, transformation does 433 * not occur. 434 * 435 * @param transform the transformation flag. 436 * @param search the search object which provides the search parameters and pagination specification. 437 * @return any found results from the search. 438 */ 439 public Set<?> search(final int transform, final Search search); 440 441 /** 442 * Performs a search using the parameters specified in the given <code>search</code> object. 443 * 444 * @param search the search object which provides the search parameters and pagination specification. 445 * @return any found results from the search. 446 */ 447 public Set<SamplingOperation> search(final Search search); 448 449 /** 450 * Allows transformation of entities into value objects 451 * (or something else for that matter), when the <code>transform</code> 452 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.data.samplingoperation.SamplingOperationDao</code>, please note 453 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 454 * will be returned. 455 * 456 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 457 * 458 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.data.samplingoperation.SamplingOperationDao} 459 * @param entity an entity that was found 460 * @return the transformed entity (i.e. new value object, etc) 461 * @see #transformEntities(int,Collection) 462 */ 463 public Object transformEntity(final int transform, final SamplingOperation entity); 464 465 /** 466 * Transforms a collection of entities using the 467 * {@link #transformEntity(int,SamplingOperation)} 468 * method. This method does not instantiate a new collection. 469 * <p> 470 * This method is to be used internally only. 471 * 472 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.data.samplingoperation.SamplingOperationDao</code> 473 * @param entities the collection of entities to transform 474 * @see #transformEntity(int,SamplingOperation) 475 */ 476 public void transformEntities(final int transform, final Collection<?> entities); 477 478 // spring-dao merge-point 479 }