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; 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 java.sql.Timestamp; 033import java.util.Collection; 034import java.util.Set; 035import org.andromda.spring.PaginationResult; 036 037/** 038 * Pour les données du référentiel, information permettant de déterminer si une donnée est valide, 039 * obsolète ou temporaire. 040 * - obsolète (=inactif) : '0' 041 * - valide (=actif) : '1' 042 * - temporaire : '2' 043 * - en cours de suppression : '3' 044 * - : '4' 045 * note : on a préfère ici 'valide' au terme 'actif' (utilisé dans Harmonie), pour ne pas confondre 046 * avec par exemple l'activité d'un navire sur un mois. 047 * @see Status 048 */ 049public interface StatusDao 050{ 051 /** 052 * This constant is used as a transformation flag; entities can be converted automatically into value objects 053 * or other types, different methods in a class implementing this interface support this feature: look for 054 * an <code>int</code> parameter called <code>transform</code>. 055 * <p> 056 * This specific flag denotes no transformation will occur. 057 */ 058 public static final int TRANSFORM_NONE = 0; 059 060 061 /** 062 * Transforms the given results to a collection of {@link Status} 063 * instances (this is useful when the returned results contains a row of data and you want just entities only). 064 * 065 * @param results the query results. 066 */ 067 public void toEntities(final Collection<?> results); 068 069 /** 070 * Gets an instance of Status from the persistent store. 071 * @param code 072 * @return Status 073 */ 074 public Status get(String code); 075 076 /** 077 * <p> 078 * Does the same thing as {@link #get(String)} with an 079 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 080 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 081 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 082 * optionally transform the entity (into a value object for example). By default, transformation does 083 * not occur. 084 * </p> 085 * 086 * @param transform flag to determine transformation type. 087 * @param code the identifier of the entity to get. 088 * @return either the entity or the object transformed from the entity. 089 */ 090 public Object get(int transform, String code); 091 092 /** 093 * Loads an instance of Status from the persistent store. 094 * @param code 095 * @return Status 096 */ 097 public Status load(String code); 098 099 /** 100 * <p> 101 * Does the same thing as {@link #load(String)} with an 102 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 103 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 104 * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can 105 * optionally transform the entity (into a value object for example). By default, transformation does 106 * not occur. 107 * </p> 108 * 109 * @param transform flag to determine transformation type. 110 * @param code the identifier of the entity to load. 111 * @return either the entity or the object transformed from the entity. 112 */ 113 public Object load(int transform, String code); 114 115 /** 116 * Loads all entities of type {@link Status}. 117 * 118 * @return the loaded entities. 119 */ 120 public Collection<Status> loadAll(); 121 122 /** 123 * <p> 124 * Does the same thing as {@link #loadAll()} with an 125 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 126 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 127 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 128 * transform the entity (into a value object for example). By default, transformation does 129 * not occur. 130 * </p> 131 * 132 * @param transform the flag indicating what transformation to use. 133 * @return the loaded entities. 134 */ 135 public Collection<?> loadAll(final int transform); 136 137 /** 138 * <p> 139 * Does the same thing as {@link #loadAll()} with an 140 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 141 * 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 142 * page retrieved. 143 * </p> 144 * 145 * @param pageNumber the page number to retrieve when paging results. 146 * @param pageSize the size of the page to retrieve when paging results. 147 * @return the loaded entities. 148 */ 149 public Collection<?> loadAll(final int pageNumber, final int pageSize); 150 151 /** 152 * <p> 153 * Does the same thing as {@link #loadAll(int)} with an 154 * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code> 155 * 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 156 * page retrieved. 157 * </p> 158 * 159 * @param transform the flag indicating what transformation to use. 160 * @param pageNumber the page number to retrieve when paging results. 161 * @param pageSize the size of the page to retrieve when paging results. 162 * @return the loaded entities. 163 */ 164 public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize); 165 166 /** 167 * Creates an instance of Status and adds it to the persistent store. 168 * @param status 169 * @return Status 170 */ 171 public Status create(Status status); 172 173 /** 174 * <p> 175 * Does the same thing as {@link #create(Status)} with an 176 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 177 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 178 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 179 * transform the entity (into a value object for example). By default, transformation does 180 * not occur. 181 * </p> 182 * @param transform 183 * @param status 184 * @return Object 185 */ 186 public Object create(int transform, Status status); 187 188 /** 189 * Creates a new instance of Status and adds 190 * from the passed in <code>entities</code> collection 191 * 192 * @param entities the collection of Status 193 * instances to create. 194 * 195 * @return the created instances. 196 */ 197 public Collection<Status> create(Collection<Status> entities); 198 199 /** 200 * <p> 201 * Does the same thing as {@link #create(Status)} with an 202 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 203 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 204 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 205 * transform the entities (into value objects for example). By default, transformation does 206 * not occur. 207 * </p> 208 * @param transform 209 * @param entities 210 * @return Collection 211 */ 212 public Collection<?> create(int transform, Collection<Status> entities); 213 214 /** 215 * <p> 216 * Creates a new <code>Status</code> 217 * instance from <strong>all</strong> attributes and adds it to 218 * the persistent store. 219 * </p> 220 * @param code 221 * @param name 222 * @param updateDate 223 * @return Status 224 */ 225 public Status create( 226 String code, 227 String name, 228 Timestamp updateDate); 229 230 /** 231 * <p> 232 * Does the same thing as {@link #create(String, Timestamp)} with an 233 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 234 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 235 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 236 * transform the entity (into a value object for example). By default, transformation does 237 * not occur. 238 * </p> 239 * @param transform 240 * @param code 241 * @param name 242 * @param updateDate 243 * @return Status 244 */ 245 public Object create( 246 int transform, 247 String code, 248 String name, 249 Timestamp updateDate); 250 251 252 /** 253 * Updates the <code>status</code> instance in the persistent store. 254 * @param status 255 */ 256 public void update(Status status); 257 258 /** 259 * Updates all instances in the <code>entities</code> collection in the persistent store. 260 * @param entities 261 */ 262 public void update(Collection<Status> entities); 263 264 /** 265 * Removes the instance of Status from the persistent store. 266 * @param status 267 */ 268 public void remove(Status status); 269 270 /** 271 * Removes the instance of Status having the given 272 * <code>identifier</code> from the persistent store. 273 * @param code 274 */ 275 public void remove(String code); 276 277 /** 278 * Removes all entities in the given <code>entities</code> collection. 279 * @param entities 280 */ 281 public void remove(Collection<Status> entities); 282 283 284 /** 285 * Does the same thing as {@link #search(int, Search)} but with an 286 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 287 * limit your data to a specified page number and size. 288 * 289 * @param transform the transformation flag. 290 * @param pageNumber the page number in the data to retrieve 291 * @param pageSize the size of the page to retrieve. 292 * @param search the search object which provides the search parameters and pagination specification. 293 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 294 */ 295 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 296 297 /** 298 * Does the same thing as {@link #search(Search)} but with an 299 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 300 * limit your data to a specified page number and size. 301 * 302 * @param pageNumber the page number in the data to retrieve 303 * @param pageSize the size of the page to retrieve. 304 * @param search the search object which provides the search parameters and pagination specification. 305 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 306 */ 307 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 308 309 /** 310 * Does the same thing as {@link #search(Search)} but with an 311 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 312 * finder results will <strong>NOT</strong> be transformed during retrieval. 313 * If this flag is any of the other constants defined here 314 * then results <strong>WILL BE</strong> passed through an operation which can optionally 315 * transform the entities (into value objects for example). By default, transformation does 316 * not occur. 317 * 318 * @param transform the transformation flag. 319 * @param search the search object which provides the search parameters and pagination specification. 320 * @return any found results from the search. 321 */ 322 public Set<?> search(final int transform, final Search search); 323 324 /** 325 * Performs a search using the parameters specified in the given <code>search</code> object. 326 * 327 * @param search the search object which provides the search parameters and pagination specification. 328 * @return any found results from the search. 329 */ 330 public Set<Status> search(final Search search); 331 332 /** 333 * Allows transformation of entities into value objects 334 * (or something else for that matter), when the <code>transform</code> 335 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.StatusDao</code>, please note 336 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 337 * will be returned. 338 * 339 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 340 * 341 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.StatusDao} 342 * @param entity an entity that was found 343 * @return the transformed entity (i.e. new value object, etc) 344 * @see #transformEntities(int,Collection) 345 */ 346 public Object transformEntity(final int transform, final Status entity); 347 348 /** 349 * Transforms a collection of entities using the 350 * {@link #transformEntity(int,Status)} 351 * method. This method does not instantiate a new collection. 352 * <p> 353 * This method is to be used internally only. 354 * 355 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.StatusDao</code> 356 * @param entities the collection of entities to transform 357 * @see #transformEntity(int,Status) 358 */ 359 public void transformEntities(final int transform, final Collection<?> entities); 360 361 // spring-dao merge-point 362}