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.location; 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 fr.ifremer.adagio.core.dao.referential.ValidityStatus; 034import java.sql.Timestamp; 035import java.util.Collection; 036import java.util.Set; 037import org.andromda.spring.PaginationResult; 038 039/** 040 * Représente un lieu au sens général du terme. Il peut s'agir d'un lieu ponctuel, linéaire ou 041 * surfacique. 042 * Suivant sa classification et son niveau, il peut s'agir d'un secteur FAO, un port de pêche, un 043 * quartier maritime, une criée, etc. 044 * Nombre de lignes : lieux terrestre : 4500 + secteurs : 11210 + strates : 1000 + localités : 200 045 * @see Location 046 */ 047public interface LocationDao 048{ 049 /** 050 * This constant is used as a transformation flag; entities can be converted automatically into value objects 051 * or other types, different methods in a class implementing this interface support this feature: look for 052 * an <code>int</code> parameter called <code>transform</code>. 053 * <p> 054 * This specific flag denotes no transformation will occur. 055 */ 056 public static final int TRANSFORM_NONE = 0; 057 058 059 /** 060 * Transforms the given results to a collection of {@link Location} 061 * instances (this is useful when the returned results contains a row of data and you want just entities only). 062 * 063 * @param results the query results. 064 */ 065 public void toEntities(final Collection<?> results); 066 067 /** 068 * Gets an instance of Location from the persistent store. 069 * @param id 070 * @return Location 071 */ 072 public Location get(Integer id); 073 074 /** 075 * <p> 076 * Does the same thing as {@link #get(Integer)} with an 077 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 078 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 079 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 080 * optionally transform the entity (into a value object for example). By default, transformation does 081 * not occur. 082 * </p> 083 * 084 * @param transform flag to determine transformation type. 085 * @param id the identifier of the entity to get. 086 * @return either the entity or the object transformed from the entity. 087 */ 088 public Object get(int transform, Integer id); 089 090 /** 091 * Loads an instance of Location from the persistent store. 092 * @param id 093 * @return Location 094 */ 095 public Location load(Integer id); 096 097 /** 098 * <p> 099 * Does the same thing as {@link #load(Integer)} with an 100 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 101 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 102 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 103 * optionally transform the entity (into a value object for example). By default, transformation does 104 * not occur. 105 * </p> 106 * 107 * @param transform flag to determine transformation type. 108 * @param id the identifier of the entity to load. 109 * @return either the entity or the object transformed from the entity. 110 */ 111 public Object load(int transform, Integer id); 112 113 /** 114 * Loads all entities of type {@link Location}. 115 * 116 * @return the loaded entities. 117 */ 118 public Collection<Location> loadAll(); 119 120 /** 121 * <p> 122 * Does the same thing as {@link #loadAll()} with an 123 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 124 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 125 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 126 * transform the entity (into a value object for example). By default, transformation does 127 * not occur. 128 * </p> 129 * 130 * @param transform the flag indicating what transformation to use. 131 * @return the loaded entities. 132 */ 133 public Collection<?> loadAll(final int transform); 134 135 /** 136 * <p> 137 * Does the same thing as {@link #loadAll()} with an 138 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 139 * 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 140 * page retrieved. 141 * </p> 142 * 143 * @param pageNumber the page number to retrieve when paging results. 144 * @param pageSize the size of the page to retrieve when paging results. 145 * @return the loaded entities. 146 */ 147 public Collection<?> loadAll(final int pageNumber, final int pageSize); 148 149 /** 150 * <p> 151 * Does the same thing as {@link #loadAll(int)} with an 152 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 153 * 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 154 * page retrieved. 155 * </p> 156 * 157 * @param transform the flag indicating what transformation to use. 158 * @param pageNumber the page number to retrieve when paging results. 159 * @param pageSize the size of the page to retrieve when paging results. 160 * @return the loaded entities. 161 */ 162 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 163 164 /** 165 * Creates an instance of Location and adds it to the persistent store. 166 * @param location 167 * @return Location 168 */ 169 public Location create(Location location); 170 171 /** 172 * <p> 173 * Does the same thing as {@link #create(Location)} with an 174 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 175 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 176 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 177 * transform the entity (into a value object for example). By default, transformation does 178 * not occur. 179 * </p> 180 * @param transform 181 * @param location 182 * @return Object 183 */ 184 public Object create(int transform, Location location); 185 186 /** 187 * Creates a new instance of Location and adds 188 * from the passed in <code>entities</code> collection 189 * 190 * @param entities the collection of Location 191 * instances to create. 192 * 193 * @return the created instances. 194 */ 195 public Collection<Location> create(Collection<Location> entities); 196 197 /** 198 * <p> 199 * Does the same thing as {@link #create(Location)} with an 200 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 201 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 202 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 203 * transform the entities (into value objects for example). By default, transformation does 204 * not occur. 205 * </p> 206 * @param transform 207 * @param entities 208 * @return Collection 209 */ 210 public Collection<?> create(int transform, Collection<Location> entities); 211 212 /** 213 * <p> 214 * Creates a new <code>Location</code> 215 * instance from <strong>all</strong> attributes and adds it to 216 * the persistent store. 217 * </p> 218 * @param label Code du lieuExemple : pour les ports : BR, SB 219 * @param name Libellé du lieu 220 * @param bathymetry Valeur de la bathymétrie sur le lieu (optionnel). La bathymétrie peut être positive ou négative. 221 * @param utFormat Format UT (Universal Time) de l'heure pour le lieu (0, +1, -4...). 222En France métropolitaine, par exemple : +1 (= heure Europe/Paris) 223 * @param daylightSavingTime Indique s'il faut opérer le changement d'heure hiver-été, vrai par défaut. 224En France métropolitaine, par exemple : Vrai. 225 * @param comments 226 * @param updateDate 227 * @return Location 228 */ 229 public Location create( 230 String label, 231 String name, 232 Float bathymetry, 233 Short utFormat, 234 Boolean daylightSavingTime, 235 String comments, 236 Timestamp updateDate); 237 238 /** 239 * <p> 240 * Does the same thing as {@link #create(String, String, Float, Short, Boolean, String, Timestamp)} with an 241 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 242 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 243 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 244 * transform the entity (into a value object for example). By default, transformation does 245 * not occur. 246 * </p> 247 * @param transform 248 * @param label Code du lieuExemple : pour les ports : BR, SB 249 * @param name Libellé du lieu 250 * @param bathymetry Valeur de la bathymétrie sur le lieu (optionnel). La bathymétrie peut être positive ou négative. 251 * @param utFormat Format UT (Universal Time) de l'heure pour le lieu (0, +1, -4...). 252En France métropolitaine, par exemple : +1 (= heure Europe/Paris) 253 * @param daylightSavingTime Indique s'il faut opérer le changement d'heure hiver-été, vrai par défaut. 254En France métropolitaine, par exemple : Vrai. 255 * @param comments 256 * @param updateDate 257 * @return Location 258 */ 259 public Object create( 260 int transform, 261 String label, 262 String name, 263 Float bathymetry, 264 Short utFormat, 265 Boolean daylightSavingTime, 266 String comments, 267 Timestamp updateDate); 268 269 /** 270 * <p> 271 * Creates a new <code>Location</code> 272 * instance from only <strong>required</strong> properties (attributes 273 * and association ends) and adds it to the persistent store. 274 * </p> 275 * @param locationClassification 276 * @param locationLevel 277 * @param name 278 * @param status 279 * @param updateDate 280 * @param validityStatus 281 * @return Location 282 */ 283 public Location create( 284 LocationClassification locationClassification, 285 LocationLevel locationLevel, 286 String name, 287 Status status, 288 Timestamp updateDate, 289 ValidityStatus validityStatus); 290 291 /** 292 * <p> 293 * Does the same thing as {@link #create(String, Timestamp)} with an 294 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 295 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 296 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 297 * transform the entity (into a value object for example). By default, transformation does 298 * not occur. 299 * </p> 300 * @param transform flag to determine transformation type. 301 * @param locationClassification 302 * @param locationLevel 303 * @param name 304 * @param status 305 * @param updateDate 306 * @param validityStatus 307 * @return Object 308 */ 309 public Object create( 310 int transform, 311 LocationClassification locationClassification, 312 LocationLevel locationLevel, 313 String name, 314 Status status, 315 Timestamp updateDate, 316 ValidityStatus validityStatus); 317 318 /** 319 * Updates the <code>location</code> instance in the persistent store. 320 * @param location 321 */ 322 public void update(Location location); 323 324 /** 325 * Updates all instances in the <code>entities</code> collection in the persistent store. 326 * @param entities 327 */ 328 public void update(Collection<Location> entities); 329 330 /** 331 * Removes the instance of Location from the persistent store. 332 * @param location 333 */ 334 public void remove(Location location); 335 336 /** 337 * Removes the instance of Location having the given 338 * <code>identifier</code> from the persistent store. 339 * @param id 340 */ 341 public void remove(Integer id); 342 343 /** 344 * Removes all entities in the given <code>entities</code> collection. 345 * @param entities 346 */ 347 public void remove(Collection<Location> entities); 348 349 350 /** 351 * Does the same thing as {@link #search(int, Search)} but with an 352 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 353 * limit your data to a specified page number and size. 354 * 355 * @param transform the transformation flag. 356 * @param pageNumber the page number in the data to retrieve 357 * @param pageSize the size of the page to retrieve. 358 * @param search the search object which provides the search parameters and pagination specification. 359 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 360 */ 361 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 362 363 /** 364 * Does the same thing as {@link #search(Search)} but with an 365 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 366 * limit your data to a specified page number and size. 367 * 368 * @param pageNumber the page number in the data to retrieve 369 * @param pageSize the size of the page to retrieve. 370 * @param search the search object which provides the search parameters and pagination specification. 371 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 372 */ 373 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 374 375 /** 376 * Does the same thing as {@link #search(Search)} but with an 377 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 378 * finder results will <strong>NOT</strong> be transformed during retrieval. 379 * If this flag is any of the other constants defined here 380 * then results <strong>WILL BE</strong> passed through an operation which can optionally 381 * transform the entities (into value objects for example). By default, transformation does 382 * not occur. 383 * 384 * @param transform the transformation flag. 385 * @param search the search object which provides the search parameters and pagination specification. 386 * @return any found results from the search. 387 */ 388 public Set<?> search(final int transform, final Search search); 389 390 /** 391 * Performs a search using the parameters specified in the given <code>search</code> object. 392 * 393 * @param search the search object which provides the search parameters and pagination specification. 394 * @return any found results from the search. 395 */ 396 public Set<Location> search(final Search search); 397 398 /** 399 * Allows transformation of entities into value objects 400 * (or something else for that matter), when the <code>transform</code> 401 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.location.LocationDao</code>, please note 402 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 403 * will be returned. 404 * 405 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 406 * 407 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.location.LocationDao} 408 * @param entity an entity that was found 409 * @return the transformed entity (i.e. new value object, etc) 410 * @see #transformEntities(int,Collection) 411 */ 412 public Object transformEntity(final int transform, final Location entity); 413 414 /** 415 * Transforms a collection of entities using the 416 * {@link #transformEntity(int,Location)} 417 * method. This method does not instantiate a new collection. 418 * <p> 419 * This method is to be used internally only. 420 * 421 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.location.LocationDao</code> 422 * @param entities the collection of entities to transform 423 * @see #transformEntity(int,Location) 424 */ 425 public void transformEntities(final int transform, final Collection<?> entities); 426 427 // spring-dao merge-point 428}