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.measurement; 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.referential.ObjectType; 31 import fr.ifremer.quadrige2.core.dao.referential.QualityFlag; 32 import fr.ifremer.quadrige2.core.dao.referential.pmfm.Pmfm; 33 import java.sql.Timestamp; 34 import java.util.Collection; 35 import java.util.Date; 36 import java.util.Set; 37 import org.andromda.spring.PaginationResult; 38 39 /** 40 * Résultat de mesure faisant uniquement référence à un fichier. 41 * @see MeasurementFile 42 */ 43 public interface MeasurementFileDao 44 { 45 /** 46 * This constant is used as a transformation flag; entities can be converted automatically into value objects 47 * or other types, different methods in a class implementing this interface support this feature: look for 48 * an <code>int</code> parameter called <code>transform</code>. 49 * <p> 50 * This specific flag denotes no transformation will occur. 51 */ 52 public static final int TRANSFORM_NONE = 0; 53 54 55 /** 56 * Transforms the given results to a collection of {@link MeasurementFile} 57 * instances (this is useful when the returned results contains a row of data and you want just entities only). 58 * 59 * @param results the query results. 60 */ 61 public void toEntities(final Collection<?> results); 62 63 /** 64 * Gets an instance of MeasurementFile from the persistent store. 65 * @param measFileId 66 * @return MeasurementFile 67 */ 68 public MeasurementFile get(Integer measFileId); 69 70 /** 71 * <p> 72 * Does the same thing as {@link #get(Integer)} with an 73 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 74 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 75 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 76 * optionally transform the entity (into a value object for example). By default, transformation does 77 * not occur. 78 * </p> 79 * 80 * @param transform flag to determine transformation type. 81 * @param measFileId the identifier of the entity to get. 82 * @return either the entity or the object transformed from the entity. 83 */ 84 public Object get(int transform, Integer measFileId); 85 86 /** 87 * Loads an instance of MeasurementFile from the persistent store. 88 * @param measFileId 89 * @return MeasurementFile 90 */ 91 public MeasurementFile load(Integer measFileId); 92 93 /** 94 * <p> 95 * Does the same thing as {@link #load(Integer)} with an 96 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 97 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 98 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 99 * optionally transform the entity (into a value object for example). By default, transformation does 100 * not occur. 101 * </p> 102 * 103 * @param transform flag to determine transformation type. 104 * @param measFileId the identifier of the entity to load. 105 * @return either the entity or the object transformed from the entity. 106 */ 107 public Object load(int transform, Integer measFileId); 108 109 /** 110 * Loads all entities of type {@link MeasurementFile}. 111 * 112 * @return the loaded entities. 113 */ 114 public Collection<MeasurementFile> loadAll(); 115 116 /** 117 * <p> 118 * Does the same thing as {@link #loadAll()} with an 119 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 120 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 121 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 122 * transform the entity (into a value object for example). By default, transformation does 123 * not occur. 124 * </p> 125 * 126 * @param transform the flag indicating what transformation to use. 127 * @return the loaded entities. 128 */ 129 public Collection<?> loadAll(final int transform); 130 131 /** 132 * <p> 133 * Does the same thing as {@link #loadAll()} with an 134 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 135 * 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 136 * page retrieved. 137 * </p> 138 * 139 * @param pageNumber the page number to retrieve when paging results. 140 * @param pageSize the size of the page to retrieve when paging results. 141 * @return the loaded entities. 142 */ 143 public Collection<?> loadAll(final int pageNumber, final int pageSize); 144 145 /** 146 * <p> 147 * Does the same thing as {@link #loadAll(int)} with an 148 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 149 * 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 150 * page retrieved. 151 * </p> 152 * 153 * @param transform the flag indicating what transformation to use. 154 * @param pageNumber the page number to retrieve when paging results. 155 * @param pageSize the size of the page to retrieve when paging results. 156 * @return the loaded entities. 157 */ 158 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 159 160 /** 161 * Creates an instance of MeasurementFile and adds it to the persistent store. 162 * @param measurementFile 163 * @return MeasurementFile 164 */ 165 public MeasurementFile create(MeasurementFile measurementFile); 166 167 /** 168 * <p> 169 * Does the same thing as {@link #create(MeasurementFile)} with an 170 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 171 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 172 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 173 * transform the entity (into a value object for example). By default, transformation does 174 * not occur. 175 * </p> 176 * @param transform 177 * @param measurementFile 178 * @return Object 179 */ 180 public Object create(int transform, MeasurementFile measurementFile); 181 182 /** 183 * Creates a new instance of MeasurementFile and adds 184 * from the passed in <code>entities</code> collection 185 * 186 * @param entities the collection of MeasurementFile 187 * instances to create. 188 * 189 * @return the created instances. 190 */ 191 public Collection<MeasurementFile> create(Collection<MeasurementFile> entities); 192 193 /** 194 * <p> 195 * Does the same thing as {@link #create(MeasurementFile)} with an 196 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 197 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 198 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 199 * transform the entities (into value objects for example). By default, transformation does 200 * not occur. 201 * </p> 202 * @param transform 203 * @param entities 204 * @return Collection 205 */ 206 public Collection<?> create(int transform, Collection<MeasurementFile> entities); 207 208 /** 209 * <p> 210 * Creates a new <code>MeasurementFile</code> 211 * instance from <strong>all</strong> attributes and adds it to 212 * the persistent store. 213 * </p> 214 * @param objectId Identifiant interne de donnnée in situ de référence (passage, prélèvement, prélèvement) 215 * @param measFilePathNm Adresse du fichier de mesure stocké sur le serveur Q2. 216 * @param measFileNm Libellé du fichier de mesure 217 * @param measFileCm Commentaire sur le fichier de mesure 218 * @param measFileValidDt Date de validation 219 * @param measFileControlDt Date de contrôle 220 * @param measFileQualifDt Date de la qualification du résultat 221 * @param measFileQualifCm Commentaire sur la qualification du résultat 222 Un commentaire de qualification est obligatoire si la mesure est douteuse ou mauvaise. 223 * @param updateDt Date de modification de l'objet, mise à jour par le système 224 * @param parCd @deprecated (filled by synchro) 225 * @param matrixId @deprecated (filled by synchro) 226 * @param fractionId @deprecated (filled by synchro) 227 * @param methodId @deprecated (filled by synchro) 228 * @return MeasurementFile 229 */ 230 public MeasurementFile create( 231 Integer objectId, 232 String measFilePathNm, 233 String measFileNm, 234 String measFileCm, 235 Date measFileValidDt, 236 Date measFileControlDt, 237 Date measFileQualifDt, 238 String measFileQualifCm, 239 Timestamp updateDt, 240 String parCd, 241 Integer matrixId, 242 Integer fractionId, 243 Integer methodId); 244 245 /** 246 * <p> 247 * Does the same thing as {@link #create(Integer, String, String, String, Date, Date, Date, String, Timestamp, String, Integer, Integer, Integer)} with an 248 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 249 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 250 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 251 * transform the entity (into a value object for example). By default, transformation does 252 * not occur. 253 * </p> 254 * @param transform 255 * @param objectId Identifiant interne de donnnée in situ de référence (passage, prélèvement, prélèvement) 256 * @param measFilePathNm Adresse du fichier de mesure stocké sur le serveur Q2. 257 * @param measFileNm Libellé du fichier de mesure 258 * @param measFileCm Commentaire sur le fichier de mesure 259 * @param measFileValidDt Date de validation 260 * @param measFileControlDt Date de contrôle 261 * @param measFileQualifDt Date de la qualification du résultat 262 * @param measFileQualifCm Commentaire sur la qualification du résultat 263 Un commentaire de qualification est obligatoire si la mesure est douteuse ou mauvaise. 264 * @param updateDt Date de modification de l'objet, mise à jour par le système 265 * @param parCd @deprecated (filled by synchro) 266 * @param matrixId @deprecated (filled by synchro) 267 * @param fractionId @deprecated (filled by synchro) 268 * @param methodId @deprecated (filled by synchro) 269 * @return MeasurementFile 270 */ 271 public Object create( 272 int transform, 273 Integer objectId, 274 String measFilePathNm, 275 String measFileNm, 276 String measFileCm, 277 Date measFileValidDt, 278 Date measFileControlDt, 279 Date measFileQualifDt, 280 String measFileQualifCm, 281 Timestamp updateDt, 282 String parCd, 283 Integer matrixId, 284 Integer fractionId, 285 Integer methodId); 286 287 /** 288 * <p> 289 * Creates a new <code>MeasurementFile</code> 290 * instance from only <strong>required</strong> properties (attributes 291 * and association ends) and adds it to the persistent store. 292 * </p> 293 * @param measFilePathNm 294 * @param objectId 295 * @param updateDt 296 * @param objectType 297 * @param pmfm 298 * @param qualityFlag 299 * @return MeasurementFile 300 */ 301 public MeasurementFile create( 302 String measFilePathNm, 303 Integer objectId, 304 Timestamp updateDt, 305 ObjectType objectType, 306 Pmfm pmfm, 307 QualityFlag qualityFlag); 308 309 /** 310 * <p> 311 * Does the same thing as {@link #create(Integer, String, Timestamp)} with an 312 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 313 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 314 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 315 * transform the entity (into a value object for example). By default, transformation does 316 * not occur. 317 * </p> 318 * @param transform flag to determine transformation type. 319 * @param measFilePathNm 320 * @param objectId 321 * @param updateDt 322 * @param objectType 323 * @param pmfm 324 * @param qualityFlag 325 * @return Object 326 */ 327 public Object create( 328 int transform, 329 String measFilePathNm, 330 Integer objectId, 331 Timestamp updateDt, 332 ObjectType objectType, 333 Pmfm pmfm, 334 QualityFlag qualityFlag); 335 336 /** 337 * Updates the <code>measurementFile</code> instance in the persistent store. 338 * @param measurementFile 339 */ 340 public void update(MeasurementFile measurementFile); 341 342 /** 343 * Updates all instances in the <code>entities</code> collection in the persistent store. 344 * @param entities 345 */ 346 public void update(Collection<MeasurementFile> entities); 347 348 /** 349 * Removes the instance of MeasurementFile from the persistent store. 350 * @param measurementFile 351 */ 352 public void remove(MeasurementFile measurementFile); 353 354 /** 355 * Removes the instance of MeasurementFile having the given 356 * <code>identifier</code> from the persistent store. 357 * @param measFileId 358 */ 359 public void remove(Integer measFileId); 360 361 /** 362 * Removes all entities in the given <code>entities</code> collection. 363 * @param entities 364 */ 365 public void remove(Collection<MeasurementFile> entities); 366 367 368 /** 369 * Does the same thing as {@link #search(int, Search)} but with an 370 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 371 * limit your data to a specified page number and size. 372 * 373 * @param transform the transformation flag. 374 * @param pageNumber the page number in the data to retrieve 375 * @param pageSize the size of the page to retrieve. 376 * @param search the search object which provides the search parameters and pagination specification. 377 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 378 */ 379 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 380 381 /** 382 * Does the same thing as {@link #search(Search)} but with an 383 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 384 * limit your data to a specified page number and size. 385 * 386 * @param pageNumber the page number in the data to retrieve 387 * @param pageSize the size of the page to retrieve. 388 * @param search the search object which provides the search parameters and pagination specification. 389 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 390 */ 391 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 392 393 /** 394 * Does the same thing as {@link #search(Search)} but with an 395 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 396 * finder results will <strong>NOT</strong> be transformed during retrieval. 397 * If this flag is any of the other constants defined here 398 * then results <strong>WILL BE</strong> passed through an operation which can optionally 399 * transform the entities (into value objects for example). By default, transformation does 400 * not occur. 401 * 402 * @param transform the transformation flag. 403 * @param search the search object which provides the search parameters and pagination specification. 404 * @return any found results from the search. 405 */ 406 public Set<?> search(final int transform, final Search search); 407 408 /** 409 * Performs a search using the parameters specified in the given <code>search</code> object. 410 * 411 * @param search the search object which provides the search parameters and pagination specification. 412 * @return any found results from the search. 413 */ 414 public Set<MeasurementFile> search(final Search search); 415 416 /** 417 * Allows transformation of entities into value objects 418 * (or something else for that matter), when the <code>transform</code> 419 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.data.measurement.MeasurementFileDao</code>, please note 420 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 421 * will be returned. 422 * 423 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 424 * 425 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.data.measurement.MeasurementFileDao} 426 * @param entity an entity that was found 427 * @return the transformed entity (i.e. new value object, etc) 428 * @see #transformEntities(int,Collection) 429 */ 430 public Object transformEntity(final int transform, final MeasurementFile entity); 431 432 /** 433 * Transforms a collection of entities using the 434 * {@link #transformEntity(int,MeasurementFile)} 435 * method. This method does not instantiate a new collection. 436 * <p> 437 * This method is to be used internally only. 438 * 439 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.data.measurement.MeasurementFileDao</code> 440 * @param entities the collection of entities to transform 441 * @see #transformEntity(int,MeasurementFile) 442 */ 443 public void transformEntities(final int transform, final Collection<?> entities); 444 445 // spring-dao merge-point 446 }