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.referential.grouping; 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.referential.ObjectType; 033import java.sql.Timestamp; 034import java.util.Collection; 035import java.util.Set; 036import org.andromda.spring.PaginationResult; 037 038/** 039 * <html> 040 * <head> 041 * <style> 042 * p {padding:0px; margin:0px;} 043 * </style> 044 * </head> 045 * <body> 046 * <p> 047 * Une classification de regroupement ne traite que d’un seul type de 048 * données du référentiel à la fois (<i>ObjectType</i>). 049 * Il peut s’agir de regroupement sur les métiers, les lieux, les espèces, 050 * etc. 051 * </p> 052 * <p> 053 * En revanche, un même type de données du référentiel (ex : Métier) peut 054 * avoir plusieurs classification de regroupement distinctes (DCR, Ifremer, 055 * Natura 2000, …) 056 * </p> 057 * <p> 058 * </p> 059 * <p> 060 * Une classification de regroupement peut contenir un ou plusieurs niveaux 061 * de regroupement (<i>GroupingLevel</i>). 062 * </p> 063 * </body> 064 * </html> 065 * @see GroupingClassification 066 */ 067public interface GroupingClassificationDao 068{ 069 /** 070 * This constant is used as a transformation flag; entities can be converted automatically into value objects 071 * or other types, different methods in a class implementing this interface support this feature: look for 072 * an <code>int</code> parameter called <code>transform</code>. 073 * <p> 074 * This specific flag denotes no transformation will occur. 075 */ 076 public static final int TRANSFORM_NONE = 0; 077 078 079 /** 080 * Transforms the given results to a collection of {@link GroupingClassification} 081 * instances (this is useful when the returned results contains a row of data and you want just entities only). 082 * 083 * @param results the query results. 084 */ 085 public void toEntities(final Collection<?> results); 086 087 /** 088 * Gets an instance of GroupingClassification from the persistent store. 089 * @param id 090 * @return GroupingClassification 091 */ 092 public GroupingClassification get(Integer id); 093 094 /** 095 * <p> 096 * Does the same thing as {@link #get(Integer)} with an 097 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 098 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 099 * 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 id the identifier of the entity to get. 106 * @return either the entity or the object transformed from the entity. 107 */ 108 public Object get(int transform, Integer id); 109 110 /** 111 * Loads an instance of GroupingClassification from the persistent store. 112 * @param id 113 * @return GroupingClassification 114 */ 115 public GroupingClassification load(Integer id); 116 117 /** 118 * <p> 119 * Does the same thing as {@link #load(Integer)} 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 in this class then the result <strong>WILL BE</strong> passed through an operation which can 123 * optionally transform the entity (into a value object for example). By default, transformation does 124 * not occur. 125 * </p> 126 * 127 * @param transform flag to determine transformation type. 128 * @param id the identifier of the entity to load. 129 * @return either the entity or the object transformed from the entity. 130 */ 131 public Object load(int transform, Integer id); 132 133 /** 134 * Loads all entities of type {@link GroupingClassification}. 135 * 136 * @return the loaded entities. 137 */ 138 public Collection<GroupingClassification> loadAll(); 139 140 /** 141 * <p> 142 * Does the same thing as {@link #loadAll()} with an 143 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 144 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 145 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 146 * transform the entity (into a value object for example). By default, transformation does 147 * not occur. 148 * </p> 149 * 150 * @param transform the flag indicating what transformation to use. 151 * @return the loaded entities. 152 */ 153 public Collection<?> loadAll(final int transform); 154 155 /** 156 * <p> 157 * Does the same thing as {@link #loadAll()} with an 158 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 159 * 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 160 * page retrieved. 161 * </p> 162 * 163 * @param pageNumber the page number to retrieve when paging results. 164 * @param pageSize the size of the page to retrieve when paging results. 165 * @return the loaded entities. 166 */ 167 public Collection<?> loadAll(final int pageNumber, final int pageSize); 168 169 /** 170 * <p> 171 * Does the same thing as {@link #loadAll(int)} with an 172 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 173 * 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 174 * page retrieved. 175 * </p> 176 * 177 * @param transform the flag indicating what transformation to use. 178 * @param pageNumber the page number to retrieve when paging results. 179 * @param pageSize the size of the page to retrieve when paging results. 180 * @return the loaded entities. 181 */ 182 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 183 184 /** 185 * Creates an instance of GroupingClassification and adds it to the persistent store. 186 * @param groupingClassification 187 * @return GroupingClassification 188 */ 189 public GroupingClassification create(GroupingClassification groupingClassification); 190 191 /** 192 * <p> 193 * Does the same thing as {@link #create(GroupingClassification)} with an 194 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 195 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 196 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 197 * transform the entity (into a value object for example). By default, transformation does 198 * not occur. 199 * </p> 200 * @param transform 201 * @param groupingClassification 202 * @return Object 203 */ 204 public Object create(int transform, GroupingClassification groupingClassification); 205 206 /** 207 * Creates a new instance of GroupingClassification and adds 208 * from the passed in <code>entities</code> collection 209 * 210 * @param entities the collection of GroupingClassification 211 * instances to create. 212 * 213 * @return the created instances. 214 */ 215 public Collection<GroupingClassification> create(Collection<GroupingClassification> entities); 216 217 /** 218 * <p> 219 * Does the same thing as {@link #create(GroupingClassification)} with an 220 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 221 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 222 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 223 * transform the entities (into value objects for example). By default, transformation does 224 * not occur. 225 * </p> 226 * @param transform 227 * @param entities 228 * @return Collection 229 */ 230 public Collection<?> create(int transform, Collection<GroupingClassification> entities); 231 232 /** 233 * <p> 234 * Creates a new <code>GroupingClassification</code> 235 * instance from <strong>all</strong> attributes and adds it to 236 * the persistent store. 237 * </p> 238 * @param label 239 * @param name 240 * @param description 241 * @param isMandatory Permet de savoir si la classification est à maintenir obligatoirement (par l'équipe d'exploitation). 242 * @param comments 243 * @param updateDate 244 * @param objectReferenceQuery <html> 245<head> 246<style> 247p {padding:0px; margin:0px;} 248</style> 249</head> 250<body> 251<p> 252A SQL query that must return identifier (column ID or CODE). 253</p> 254<p> 255Use this query to limit a grouping classification type to a list of 256entities. 257</p> 258<p> 259</p> 260<p> 261<b>For instance :</b> 262</p> 263<ul> 264<li> 265Limit a grouping classification to commercial species : 266</li> 267</ul> 268<p> 269<i>select ID 270<br>from TAXON_GROUP 271<br>where TAXON_GROUP_TYPE_FK=2 -- FAO species</i> 272</p> 273</body> 274</html> 275 * @return GroupingClassification 276 */ 277 public GroupingClassification create( 278 String label, 279 String name, 280 String description, 281 Boolean isMandatory, 282 String comments, 283 Timestamp updateDate, 284 String objectReferenceQuery); 285 286 /** 287 * <p> 288 * Does the same thing as {@link #create(String, String, String, Boolean, String, Timestamp, String)} with an 289 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 290 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 291 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 292 * transform the entity (into a value object for example). By default, transformation does 293 * not occur. 294 * </p> 295 * @param transform 296 * @param label 297 * @param name 298 * @param description 299 * @param isMandatory Permet de savoir si la classification est à maintenir obligatoirement (par l'équipe d'exploitation). 300 * @param comments 301 * @param updateDate 302 * @param objectReferenceQuery <html> 303<head> 304<style> 305p {padding:0px; margin:0px;} 306</style> 307</head> 308<body> 309<p> 310A SQL query that must return identifier (column ID or CODE). 311</p> 312<p> 313Use this query to limit a grouping classification type to a list of 314entities. 315</p> 316<p> 317</p> 318<p> 319<b>For instance :</b> 320</p> 321<ul> 322<li> 323Limit a grouping classification to commercial species : 324</li> 325</ul> 326<p> 327<i>select ID 328<br>from TAXON_GROUP 329<br>where TAXON_GROUP_TYPE_FK=2 -- FAO species</i> 330</p> 331</body> 332</html> 333 * @return GroupingClassification 334 */ 335 public Object create( 336 int transform, 337 String label, 338 String name, 339 String description, 340 Boolean isMandatory, 341 String comments, 342 Timestamp updateDate, 343 String objectReferenceQuery); 344 345 /** 346 * <p> 347 * Creates a new <code>GroupingClassification</code> 348 * instance from only <strong>required</strong> properties (attributes 349 * and association ends) and adds it to the persistent store. 350 * </p> 351 * @param isMandatory 352 * @param label 353 * @param name 354 * @param objectType 355 * @param updateDate 356 * @return GroupingClassification 357 */ 358 public GroupingClassification create( 359 Boolean isMandatory, 360 String label, 361 String name, 362 ObjectType objectType, 363 Timestamp updateDate); 364 365 /** 366 * <p> 367 * Does the same thing as {@link #create(String, String, Boolean, Timestamp)} with an 368 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 369 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 370 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 371 * transform the entity (into a value object for example). By default, transformation does 372 * not occur. 373 * </p> 374 * @param transform flag to determine transformation type. 375 * @param isMandatory 376 * @param label 377 * @param name 378 * @param objectType 379 * @param updateDate 380 * @return Object 381 */ 382 public Object create( 383 int transform, 384 Boolean isMandatory, 385 String label, 386 String name, 387 ObjectType objectType, 388 Timestamp updateDate); 389 390 /** 391 * Updates the <code>groupingClassification</code> instance in the persistent store. 392 * @param groupingClassification 393 */ 394 public void update(GroupingClassification groupingClassification); 395 396 /** 397 * Updates all instances in the <code>entities</code> collection in the persistent store. 398 * @param entities 399 */ 400 public void update(Collection<GroupingClassification> entities); 401 402 /** 403 * Removes the instance of GroupingClassification from the persistent store. 404 * @param groupingClassification 405 */ 406 public void remove(GroupingClassification groupingClassification); 407 408 /** 409 * Removes the instance of GroupingClassification having the given 410 * <code>identifier</code> from the persistent store. 411 * @param id 412 */ 413 public void remove(Integer id); 414 415 /** 416 * Removes all entities in the given <code>entities</code> collection. 417 * @param entities 418 */ 419 public void remove(Collection<GroupingClassification> entities); 420 421 422 /** 423 * Does the same thing as {@link #search(int, Search)} but with an 424 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 425 * limit your data to a specified page number and size. 426 * 427 * @param transform the transformation flag. 428 * @param pageNumber the page number in the data to retrieve 429 * @param pageSize the size of the page to retrieve. 430 * @param search the search object which provides the search parameters and pagination specification. 431 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 432 */ 433 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 434 435 /** 436 * Does the same thing as {@link #search(Search)} but with an 437 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 438 * limit your data to a specified page number and size. 439 * 440 * @param pageNumber the page number in the data to retrieve 441 * @param pageSize the size of the page to retrieve. 442 * @param search the search object which provides the search parameters and pagination specification. 443 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 444 */ 445 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 446 447 /** 448 * Does the same thing as {@link #search(Search)} but with an 449 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 450 * finder results will <strong>NOT</strong> be transformed during retrieval. 451 * If this flag is any of the other constants defined here 452 * then results <strong>WILL BE</strong> passed through an operation which can optionally 453 * transform the entities (into value objects for example). By default, transformation does 454 * not occur. 455 * 456 * @param transform the transformation flag. 457 * @param search the search object which provides the search parameters and pagination specification. 458 * @return any found results from the search. 459 */ 460 public Set<?> search(final int transform, final Search search); 461 462 /** 463 * Performs a search using the parameters specified in the given <code>search</code> object. 464 * 465 * @param search the search object which provides the search parameters and pagination specification. 466 * @return any found results from the search. 467 */ 468 public Set<GroupingClassification> search(final Search search); 469 470 /** 471 * Allows transformation of entities into value objects 472 * (or something else for that matter), when the <code>transform</code> 473 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.grouping.GroupingClassificationDao</code>, please note 474 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 475 * will be returned. 476 * 477 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 478 * 479 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.grouping.GroupingClassificationDao} 480 * @param entity an entity that was found 481 * @return the transformed entity (i.e. new value object, etc) 482 * @see #transformEntities(int,Collection) 483 */ 484 public Object transformEntity(final int transform, final GroupingClassification entity); 485 486 /** 487 * Transforms a collection of entities using the 488 * {@link #transformEntity(int,GroupingClassification)} 489 * method. This method does not instantiate a new collection. 490 * <p> 491 * This method is to be used internally only. 492 * 493 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.grouping.GroupingClassificationDao</code> 494 * @param entities the collection of entities to transform 495 * @see #transformEntity(int,GroupingClassification) 496 */ 497 public void transformEntities(final int transform, final Collection<?> entities); 498 499 // spring-dao merge-point 500}