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.taxon; 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.Status; 033import java.sql.Timestamp; 034import java.util.Collection; 035import java.util.Date; 036import java.util.Set; 037import org.andromda.spring.PaginationResult; 038 039/** 040 * Deux éléments sont à distinguer dans l'autorité de classification d’un taxon : 041 * - La publication qui fait état de la description et de la nomenclature du taxon. 042 * - La citation, associée au nom du taxon, pour faire référence à la publication d'origine du 043 * taxon. Les règles de nomenclature des taxons et de leurs auteurs sont définies dans The 044 * International Code of Zoological Nomenclature (ICZN : http://www.iczn.org/iczn/index.jsp ) pour 045 * la faune, et dans The International Code of Botanical Nomenclature (ICBN : 046 * http://www.bgbm.fu-berlin.de/iapt/nomenclature/CODE/SaintLouis/0000St.Luistitle.htm) pour la 047 * flore. 048 * Chaque taxon ne possède qu'une seule publication, et une seule citation. Une publication peut 049 * correspondre à plusieurs taxons, et une citation peut être identique pour plusieurs taxons. 050 * @see Citation 051 */ 052public interface CitationDao 053{ 054 /** 055 * This constant is used as a transformation flag; entities can be converted automatically into value objects 056 * or other types, different methods in a class implementing this interface support this feature: look for 057 * an <code>int</code> parameter called <code>transform</code>. 058 * <p> 059 * This specific flag denotes no transformation will occur. 060 */ 061 public static final int TRANSFORM_NONE = 0; 062 063 064 /** 065 * Transforms the given results to a collection of {@link Citation} 066 * instances (this is useful when the returned results contains a row of data and you want just entities only). 067 * 068 * @param results the query results. 069 */ 070 public void toEntities(final Collection<?> results); 071 072 /** 073 * Gets an instance of Citation from the persistent store. 074 * @param id 075 * @return Citation 076 */ 077 public Citation get(Integer id); 078 079 /** 080 * <p> 081 * Does the same thing as {@link #get(Integer)} with an 082 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 083 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 084 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 085 * optionally transform the entity (into a value object for example). By default, transformation does 086 * not occur. 087 * </p> 088 * 089 * @param transform flag to determine transformation type. 090 * @param id the identifier of the entity to get. 091 * @return either the entity or the object transformed from the entity. 092 */ 093 public Object get(int transform, Integer id); 094 095 /** 096 * Loads an instance of Citation from the persistent store. 097 * @param id 098 * @return Citation 099 */ 100 public Citation load(Integer id); 101 102 /** 103 * <p> 104 * Does the same thing as {@link #load(Integer)} with an 105 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 106 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 107 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 108 * optionally transform the entity (into a value object for example). By default, transformation does 109 * not occur. 110 * </p> 111 * 112 * @param transform flag to determine transformation type. 113 * @param id the identifier of the entity to load. 114 * @return either the entity or the object transformed from the entity. 115 */ 116 public Object load(int transform, Integer id); 117 118 /** 119 * Loads all entities of type {@link Citation}. 120 * 121 * @return the loaded entities. 122 */ 123 public Collection<Citation> loadAll(); 124 125 /** 126 * <p> 127 * Does the same thing as {@link #loadAll()} with an 128 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 129 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 130 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 131 * transform the entity (into a value object for example). By default, transformation does 132 * not occur. 133 * </p> 134 * 135 * @param transform the flag indicating what transformation to use. 136 * @return the loaded entities. 137 */ 138 public Collection<?> loadAll(final int transform); 139 140 /** 141 * <p> 142 * Does the same thing as {@link #loadAll()} with an 143 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 144 * 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 145 * page retrieved. 146 * </p> 147 * 148 * @param pageNumber the page number to retrieve when paging results. 149 * @param pageSize the size of the page to retrieve when paging results. 150 * @return the loaded entities. 151 */ 152 public Collection<?> loadAll(final int pageNumber, final int pageSize); 153 154 /** 155 * <p> 156 * Does the same thing as {@link #loadAll(int)} with an 157 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 158 * 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 159 * page retrieved. 160 * </p> 161 * 162 * @param transform the flag indicating what transformation to use. 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 transform, final int pageNumber, final int pageSize); 168 169 /** 170 * Creates an instance of Citation and adds it to the persistent store. 171 * @param citation 172 * @return Citation 173 */ 174 public Citation create(Citation citation); 175 176 /** 177 * <p> 178 * Does the same thing as {@link #create(Citation)} with an 179 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 180 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 181 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 182 * transform the entity (into a value object for example). By default, transformation does 183 * not occur. 184 * </p> 185 * @param transform 186 * @param citation 187 * @return Object 188 */ 189 public Object create(int transform, Citation citation); 190 191 /** 192 * Creates a new instance of Citation and adds 193 * from the passed in <code>entities</code> collection 194 * 195 * @param entities the collection of Citation 196 * instances to create. 197 * 198 * @return the created instances. 199 */ 200 public Collection<Citation> create(Collection<Citation> entities); 201 202 /** 203 * <p> 204 * Does the same thing as {@link #create(Citation)} with an 205 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 206 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 207 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 208 * transform the entities (into value objects for example). By default, transformation does 209 * not occur. 210 * </p> 211 * @param transform 212 * @param entities 213 * @return Collection 214 */ 215 public Collection<?> create(int transform, Collection<Citation> entities); 216 217 /** 218 * <p> 219 * Creates a new <code>Citation</code> 220 * instance from <strong>all</strong> attributes and adds it to 221 * the persistent store. 222 * </p> 223 * @param name Libellé de la citation. Elle comprend toujours au moins un auteur et une date. 224 * @param creationDate Date de création de la citation. Renseigné automatiquement par le système. 225 * @param updateDate Date de mise à jour de la citation. Renseigné automatiquement par le système. 226 * @return Citation 227 */ 228 public Citation create( 229 String name, 230 Date creationDate, 231 Timestamp updateDate); 232 233 /** 234 * <p> 235 * Does the same thing as {@link #create(String, Date, Timestamp)} 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 name Libellé de la citation. Elle comprend toujours au moins un auteur et une date. 244 * @param creationDate Date de création de la citation. Renseigné automatiquement par le système. 245 * @param updateDate Date de mise à jour de la citation. Renseigné automatiquement par le système. 246 * @return Citation 247 */ 248 public Object create( 249 int transform, 250 String name, 251 Date creationDate, 252 Timestamp updateDate); 253 254 /** 255 * <p> 256 * Creates a new <code>Citation</code> 257 * instance from only <strong>required</strong> properties (attributes 258 * and association ends) and adds it to the persistent store. 259 * </p> 260 * @param creationDate 261 * @param name 262 * @param status 263 * @param updateDate 264 * @return Citation 265 */ 266 public Citation create( 267 Date creationDate, 268 String name, 269 Status status, 270 Timestamp updateDate); 271 272 /** 273 * <p> 274 * Does the same thing as {@link #create(String, Date, Timestamp)} with an 275 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 276 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 277 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 278 * transform the entity (into a value object for example). By default, transformation does 279 * not occur. 280 * </p> 281 * @param transform flag to determine transformation type. 282 * @param creationDate 283 * @param name 284 * @param status 285 * @param updateDate 286 * @return Object 287 */ 288 public Object create( 289 int transform, 290 Date creationDate, 291 String name, 292 Status status, 293 Timestamp updateDate); 294 295 /** 296 * Updates the <code>citation</code> instance in the persistent store. 297 * @param citation 298 */ 299 public void update(Citation citation); 300 301 /** 302 * Updates all instances in the <code>entities</code> collection in the persistent store. 303 * @param entities 304 */ 305 public void update(Collection<Citation> entities); 306 307 /** 308 * Removes the instance of Citation from the persistent store. 309 * @param citation 310 */ 311 public void remove(Citation citation); 312 313 /** 314 * Removes the instance of Citation having the given 315 * <code>identifier</code> from the persistent store. 316 * @param id 317 */ 318 public void remove(Integer id); 319 320 /** 321 * Removes all entities in the given <code>entities</code> collection. 322 * @param entities 323 */ 324 public void remove(Collection<Citation> entities); 325 326 327 /** 328 * Does the same thing as {@link #search(int, Search)} but with an 329 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 330 * limit your data to a specified page number and size. 331 * 332 * @param transform the transformation flag. 333 * @param pageNumber the page number in the data to retrieve 334 * @param pageSize the size of the page to retrieve. 335 * @param search the search object which provides the search parameters and pagination specification. 336 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 337 */ 338 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 339 340 /** 341 * Does the same thing as {@link #search(Search)} but with an 342 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 343 * limit your data to a specified page number and size. 344 * 345 * @param pageNumber the page number in the data to retrieve 346 * @param pageSize the size of the page to retrieve. 347 * @param search the search object which provides the search parameters and pagination specification. 348 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 349 */ 350 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 351 352 /** 353 * Does the same thing as {@link #search(Search)} but with an 354 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 355 * finder results will <strong>NOT</strong> be transformed during retrieval. 356 * If this flag is any of the other constants defined here 357 * then results <strong>WILL BE</strong> passed through an operation which can optionally 358 * transform the entities (into value objects for example). By default, transformation does 359 * not occur. 360 * 361 * @param transform the transformation flag. 362 * @param search the search object which provides the search parameters and pagination specification. 363 * @return any found results from the search. 364 */ 365 public Set<?> search(final int transform, final Search search); 366 367 /** 368 * Performs a search using the parameters specified in the given <code>search</code> object. 369 * 370 * @param search the search object which provides the search parameters and pagination specification. 371 * @return any found results from the search. 372 */ 373 public Set<Citation> search(final Search search); 374 375 /** 376 * Allows transformation of entities into value objects 377 * (or something else for that matter), when the <code>transform</code> 378 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.taxon.CitationDao</code>, please note 379 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 380 * will be returned. 381 * 382 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 383 * 384 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.taxon.CitationDao} 385 * @param entity an entity that was found 386 * @return the transformed entity (i.e. new value object, etc) 387 * @see #transformEntities(int,Collection) 388 */ 389 public Object transformEntity(final int transform, final Citation entity); 390 391 /** 392 * Transforms a collection of entities using the 393 * {@link #transformEntity(int,Citation)} 394 * method. This method does not instantiate a new collection. 395 * <p> 396 * This method is to be used internally only. 397 * 398 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.taxon.CitationDao</code> 399 * @param entities the collection of entities to transform 400 * @see #transformEntity(int,Citation) 401 */ 402 public void transformEntities(final int transform, final Collection<?> entities); 403 404 // spring-dao merge-point 405}