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