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.administration.strategy; 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.pmfm.Pmfm; 31 import fr.ifremer.quadrige2.core.vo.administration.strategy.PmfmStrategyVO; 32 import java.sql.Timestamp; 33 import java.util.Collection; 34 import java.util.Set; 35 import org.andromda.spring.PaginationResult; 36 37 /** 38 * PSFM associés à une stratégie 39 * PMSF associés à une stratégie. 40 * @see PmfmStrategy 41 */ 42 public interface PmfmStrategyDao 43 { 44 /** 45 * This constant is used as a transformation flag; entities can be converted automatically into value objects 46 * or other types, different methods in a class implementing this interface support this feature: look for 47 * an <code>int</code> parameter called <code>transform</code>. 48 * <p> 49 * This specific flag denotes no transformation will occur. 50 */ 51 public static final int TRANSFORM_NONE = 0; 52 53 54 /** 55 * Transforms the given results to a collection of {@link PmfmStrategy} 56 * instances (this is useful when the returned results contains a row of data and you want just entities only). 57 * 58 * @param results the query results. 59 */ 60 public void toEntities(final Collection<?> results); 61 62 /** 63 * This constant is used as a transformation flag; entities can be converted automatically into value objects 64 * or other types, different methods in a class implementing this interface support this feature: look for 65 * an <code>int</code> parameter called <code>transform</code>. 66 * <p> 67 * This specific flag denotes entities must be transformed into objects of type 68 * {@link PmfmStrategyVO}. 69 */ 70 public static final int TRANSFORM_PMFMSTRATEGYVO = 1; 71 72 /** 73 * Copies the fields of the specified entity to the target value object. This method is similar to 74 * toPmfmStrategyVO(), but it does not handle any attributes in the target 75 * value object that are "read-only" (as those do not have setter methods exposed). 76 * @param source 77 * @param target 78 */ 79 public void toPmfmStrategyVO( 80 PmfmStrategy source, 81 PmfmStrategyVO target); 82 83 /** 84 * Converts this DAO's entity to an object of type {@link PmfmStrategyVO}. 85 * @param entity 86 * @return PmfmStrategyVO 87 */ 88 public PmfmStrategyVO toPmfmStrategyVO(PmfmStrategy entity); 89 90 /** 91 * Converts this DAO's entity to a Collection of instances of type {@link PmfmStrategyVO}. 92 * @param entities 93 */ 94 public Collection<PmfmStrategyVO> toPmfmStrategyVOCollection(Collection<?> entities); 95 96 /** 97 * Converts this DAO's entity to an array of instances of type {@link PmfmStrategyVO}. 98 * @param entities 99 * @return PmfmStrategyVO[] 100 */ 101 public PmfmStrategyVO[] toPmfmStrategyVOArray(Collection<?> entities); 102 103 /** 104 * Copies the fields of {@link PmfmStrategyVO} to the specified entity. 105 * @param source 106 * @param target 107 * @param copyIfNull If FALSE, the value object's field will not be copied to the entity if the value is NULL. If TRUE, 108 * it will be copied regardless of its value. 109 */ 110 public void pmfmStrategyVOToEntity( 111 PmfmStrategyVO source, 112 PmfmStrategy target, 113 boolean copyIfNull); 114 115 /** 116 * Converts an instance of type {@link PmfmStrategyVO} to this DAO's entity. 117 * @param pmfmStrategyVO 118 * @return PmfmStrategy 119 */ 120 public PmfmStrategy pmfmStrategyVOToEntity(PmfmStrategyVO pmfmStrategyVO); 121 122 /** 123 * Converts a Collection of instances of type {@link PmfmStrategyVO} to this 124 * DAO's entity. 125 * @param instances 126 */ 127 public void pmfmStrategyVOToEntityCollection(Collection<?> instances); 128 129 /** 130 * Gets an instance of PmfmStrategy from the persistent store. 131 * @param pmfmStratId 132 * @return PmfmStrategy 133 */ 134 public PmfmStrategy get(Integer pmfmStratId); 135 136 /** 137 * <p> 138 * Does the same thing as {@link #get(Integer)} with an 139 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 140 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 141 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 142 * optionally transform the entity (into a value object for example). By default, transformation does 143 * not occur. 144 * </p> 145 * 146 * @param transform flag to determine transformation type. 147 * @param pmfmStratId the identifier of the entity to get. 148 * @return either the entity or the object transformed from the entity. 149 */ 150 public Object get(int transform, Integer pmfmStratId); 151 152 /** 153 * Loads an instance of PmfmStrategy from the persistent store. 154 * @param pmfmStratId 155 * @return PmfmStrategy 156 */ 157 public PmfmStrategy load(Integer pmfmStratId); 158 159 /** 160 * <p> 161 * Does the same thing as {@link #load(Integer)} with an 162 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 163 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 164 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 165 * optionally transform the entity (into a value object for example). By default, transformation does 166 * not occur. 167 * </p> 168 * 169 * @param transform flag to determine transformation type. 170 * @param pmfmStratId the identifier of the entity to load. 171 * @return either the entity or the object transformed from the entity. 172 */ 173 public Object load(int transform, Integer pmfmStratId); 174 175 /** 176 * Loads all entities of type {@link PmfmStrategy}. 177 * 178 * @return the loaded entities. 179 */ 180 public Collection<PmfmStrategy> loadAll(); 181 182 /** 183 * <p> 184 * Does the same thing as {@link #loadAll()} with an 185 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 186 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 187 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 188 * transform the entity (into a value object for example). By default, transformation does 189 * not occur. 190 * </p> 191 * 192 * @param transform the flag indicating what transformation to use. 193 * @return the loaded entities. 194 */ 195 public Collection<?> loadAll(final int transform); 196 197 /** 198 * <p> 199 * Does the same thing as {@link #loadAll()} with an 200 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 201 * 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 202 * page retrieved. 203 * </p> 204 * 205 * @param pageNumber the page number to retrieve when paging results. 206 * @param pageSize the size of the page to retrieve when paging results. 207 * @return the loaded entities. 208 */ 209 public Collection<?> loadAll(final int pageNumber, final int pageSize); 210 211 /** 212 * <p> 213 * Does the same thing as {@link #loadAll(int)} with an 214 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 215 * 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 216 * page retrieved. 217 * </p> 218 * 219 * @param transform the flag indicating what transformation to use. 220 * @param pageNumber the page number to retrieve when paging results. 221 * @param pageSize the size of the page to retrieve when paging results. 222 * @return the loaded entities. 223 */ 224 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 225 226 /** 227 * Creates an instance of PmfmStrategy and adds it to the persistent store. 228 * @param pmfmStrategy 229 * @return PmfmStrategy 230 */ 231 public PmfmStrategy create(PmfmStrategy pmfmStrategy); 232 233 /** 234 * <p> 235 * Does the same thing as {@link #create(PmfmStrategy)} with an 236 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 237 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 238 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 239 * transform the entity (into a value object for example). By default, transformation does 240 * not occur. 241 * </p> 242 * @param transform 243 * @param pmfmStrategy 244 * @return Object 245 */ 246 public Object create(int transform, PmfmStrategy pmfmStrategy); 247 248 /** 249 * Creates a new instance of PmfmStrategy and adds 250 * from the passed in <code>entities</code> collection 251 * 252 * @param entities the collection of PmfmStrategy 253 * instances to create. 254 * 255 * @return the created instances. 256 */ 257 public Collection<PmfmStrategy> create(Collection<PmfmStrategy> entities); 258 259 /** 260 * <p> 261 * Does the same thing as {@link #create(PmfmStrategy)} with an 262 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 263 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 264 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 265 * transform the entities (into value objects for example). By default, transformation does 266 * not occur. 267 * </p> 268 * @param transform 269 * @param entities 270 * @return Collection 271 */ 272 public Collection<?> create(int transform, Collection<PmfmStrategy> entities); 273 274 /** 275 * <p> 276 * Creates a new <code>PmfmStrategy</code> 277 * instance from <strong>all</strong> attributes and adds it to 278 * the persistent store. 279 * </p> 280 * @param pmfmStratParAcquisNumber Nombre de fois où un paramètre peut être saisi 281 Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la valeur 1 282 * @param pmfmStratPresRk Rang pour la presentation des résultats 283 * @param pmfmStratParIsIndiv Indique si la saisie du paramètre se fait sur des individus 284 * @param pmfmStratIsUniqueByTaxon 285 * @param updateDt Date de modification de l'objet, mise à jour par le système 286 * @return PmfmStrategy 287 */ 288 public PmfmStrategy create( 289 Double pmfmStratParAcquisNumber, 290 Integer pmfmStratPresRk, 291 String pmfmStratParIsIndiv, 292 String pmfmStratIsUniqueByTaxon, 293 Timestamp updateDt); 294 295 /** 296 * <p> 297 * Does the same thing as {@link #create(Double, Integer, String, String, Timestamp)} with an 298 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 299 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 300 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 301 * transform the entity (into a value object for example). By default, transformation does 302 * not occur. 303 * </p> 304 * @param transform 305 * @param pmfmStratParAcquisNumber Nombre de fois où un paramètre peut être saisi 306 Il est constant pour tous les niveaux de saisie, est obligatoire et par défaut prend la valeur 1 307 * @param pmfmStratPresRk Rang pour la presentation des résultats 308 * @param pmfmStratParIsIndiv Indique si la saisie du paramètre se fait sur des individus 309 * @param pmfmStratIsUniqueByTaxon 310 * @param updateDt Date de modification de l'objet, mise à jour par le système 311 * @return PmfmStrategy 312 */ 313 public Object create( 314 int transform, 315 Double pmfmStratParAcquisNumber, 316 Integer pmfmStratPresRk, 317 String pmfmStratParIsIndiv, 318 String pmfmStratIsUniqueByTaxon, 319 Timestamp updateDt); 320 321 /** 322 * <p> 323 * Creates a new <code>PmfmStrategy</code> 324 * instance from only <strong>required</strong> properties (attributes 325 * and association ends) and adds it to the persistent store. 326 * </p> 327 * @param pmfmStratParAcquisNumber 328 * @param updateDt 329 * @param pmfm 330 * @param strategy 331 * @return PmfmStrategy 332 */ 333 public PmfmStrategy create( 334 Double pmfmStratParAcquisNumber, 335 Timestamp updateDt, 336 Pmfm pmfm, 337 Strategy strategy); 338 339 /** 340 * <p> 341 * Does the same thing as {@link #create(Double, Timestamp)} with an 342 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 343 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 344 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 345 * transform the entity (into a value object for example). By default, transformation does 346 * not occur. 347 * </p> 348 * @param transform flag to determine transformation type. 349 * @param pmfmStratParAcquisNumber 350 * @param updateDt 351 * @param pmfm 352 * @param strategy 353 * @return Object 354 */ 355 public Object create( 356 int transform, 357 Double pmfmStratParAcquisNumber, 358 Timestamp updateDt, 359 Pmfm pmfm, 360 Strategy strategy); 361 362 /** 363 * Updates the <code>pmfmStrategy</code> instance in the persistent store. 364 * @param pmfmStrategy 365 */ 366 public void update(PmfmStrategy pmfmStrategy); 367 368 /** 369 * Updates all instances in the <code>entities</code> collection in the persistent store. 370 * @param entities 371 */ 372 public void update(Collection<PmfmStrategy> entities); 373 374 /** 375 * Removes the instance of PmfmStrategy from the persistent store. 376 * @param pmfmStrategy 377 */ 378 public void remove(PmfmStrategy pmfmStrategy); 379 380 /** 381 * Removes the instance of PmfmStrategy having the given 382 * <code>identifier</code> from the persistent store. 383 * @param pmfmStratId 384 */ 385 public void remove(Integer pmfmStratId); 386 387 /** 388 * Removes all entities in the given <code>entities</code> collection. 389 * @param entities 390 */ 391 public void remove(Collection<PmfmStrategy> entities); 392 393 /** 394 * 395 * @param pmfmStrategy 396 * @param updateDt 397 * @return PmfmStrategyVO 398 */ 399 public PmfmStrategyVO save(PmfmStrategyVO pmfmStrategy, Timestamp updateDt); 400 401 402 /** 403 * Does the same thing as {@link #search(int, 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 transform the transformation flag. 408 * @param pageNumber the page number in the data to retrieve 409 * @param pageSize the size of the page to retrieve. 410 * @param search the search object which provides the search parameters and pagination specification. 411 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 412 */ 413 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 414 415 /** 416 * Does the same thing as {@link #search(Search)} but with an 417 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 418 * limit your data to a specified page number and size. 419 * 420 * @param pageNumber the page number in the data to retrieve 421 * @param pageSize the size of the page to retrieve. 422 * @param search the search object which provides the search parameters and pagination specification. 423 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 424 */ 425 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 426 427 /** 428 * Does the same thing as {@link #search(Search)} but with an 429 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 430 * finder results will <strong>NOT</strong> be transformed during retrieval. 431 * If this flag is any of the other constants defined here 432 * then results <strong>WILL BE</strong> passed through an operation which can optionally 433 * transform the entities (into value objects for example). By default, transformation does 434 * not occur. 435 * 436 * @param transform the transformation flag. 437 * @param search the search object which provides the search parameters and pagination specification. 438 * @return any found results from the search. 439 */ 440 public Set<?> search(final int transform, final Search search); 441 442 /** 443 * Performs a search using the parameters specified in the given <code>search</code> object. 444 * 445 * @param search the search object which provides the search parameters and pagination specification. 446 * @return any found results from the search. 447 */ 448 public Set<PmfmStrategy> search(final Search search); 449 450 /** 451 * Allows transformation of entities into value objects 452 * (or something else for that matter), when the <code>transform</code> 453 * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.administration.strategy.PmfmStrategyDao</code>, please note 454 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 455 * will be returned. 456 * <p> 457 * This method will return instances of these types: 458 * <ul> 459 * <li>{@link PmfmStrategy} - {@link #TRANSFORM_NONE}</li> 460 * <li>{@link PmfmStrategyVO} - {@link #TRANSFORM_PMFMSTRATEGYVO}</li> 461 * </ul> 462 * 463 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 464 * 465 * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.administration.strategy.PmfmStrategyDao} 466 * @param entity an entity that was found 467 * @return the transformed entity (i.e. new value object, etc) 468 * @see #transformEntities(int,Collection) 469 */ 470 public Object transformEntity(final int transform, final PmfmStrategy entity); 471 472 /** 473 * Transforms a collection of entities using the 474 * {@link #transformEntity(int,PmfmStrategy)} 475 * method. This method does not instantiate a new collection. 476 * <p> 477 * This method is to be used internally only. 478 * 479 * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.administration.strategy.PmfmStrategyDao</code> 480 * @param entities the collection of entities to transform 481 * @see #transformEntity(int,PmfmStrategy) 482 */ 483 public void transformEntities(final int transform, final Collection<?> entities); 484 485 // spring-dao merge-point 486 }