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 for Allegro 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.util.Collection; 033import java.util.Set; 034import org.andromda.spring.PaginationResult; 035 036/** 037 * Indice qualité d'une donnée. 038 * Actuellement, les indices qualités identifiés sont : 039 * 0 - Non qualifiée, 040 * 1 - Bonne, 041 * 2 - Hors statistiques, 042 * 3 - Douteuse, 043 * 4 - Fausse, 044 * 5 - Corrigée, 045 * 8 - Incomplète, 046 * 9 - Absente. 047 * @see QualityFlag 048 */ 049public interface QualityFlagDao 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 QualityFlag} 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 QualityFlag from the persistent store. 071 * @param code 072 * @return QualityFlag 073 */ 074 public QualityFlag 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 QualityFlag from the persistent store. 094 * @param code 095 * @return QualityFlag 096 */ 097 public QualityFlag 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 QualityFlag}. 117 * 118 * @return the loaded entities. 119 */ 120 public Collection<QualityFlag> 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 QualityFlag and adds it to the persistent store. 168 * @param qualityFlag 169 * @return QualityFlag 170 */ 171 public QualityFlag create(QualityFlag qualityFlag); 172 173 /** 174 * <p> 175 * Does the same thing as {@link #create(QualityFlag)} 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 qualityFlag 184 * @return Object 185 */ 186 public Object create(int transform, QualityFlag qualityFlag); 187 188 /** 189 * Creates a new instance of QualityFlag and adds 190 * from the passed in <code>entities</code> collection 191 * 192 * @param entities the collection of QualityFlag 193 * instances to create. 194 * 195 * @return the created instances. 196 */ 197 public Collection<QualityFlag> create(Collection<QualityFlag> entities); 198 199 /** 200 * <p> 201 * Does the same thing as {@link #create(QualityFlag)} 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<QualityFlag> entities); 213 214 /** 215 * <p> 216 * Creates a new <code>QualityFlag</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 * @return QualityFlag 223 */ 224 public QualityFlag create( 225 String code, 226 String name); 227 228 /** 229 * <p> 230 * Does the same thing as {@link #create(String)} with an 231 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 232 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 233 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 234 * transform the entity (into a value object for example). By default, transformation does 235 * not occur. 236 * </p> 237 * @param transform 238 * @param code 239 * @param name 240 * @return QualityFlag 241 */ 242 public Object create( 243 int transform, 244 String code, 245 String name); 246 247 /** 248 * <p> 249 * Creates a new <code>QualityFlag</code> 250 * instance from only <strong>required</strong> properties (attributes 251 * and association ends) and adds it to the persistent store. 252 * </p> 253 * @param name 254 * @param status 255 * @return QualityFlag 256 */ 257 public QualityFlag create( 258 String name, 259 Status status); 260 261 /** 262 * <p> 263 * Does the same thing as {@link #create(String)} with an 264 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 265 * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants 266 * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally 267 * transform the entity (into a value object for example). By default, transformation does 268 * not occur. 269 * </p> 270 * @param transform flag to determine transformation type. 271 * @param name 272 * @param status 273 * @return Object 274 */ 275 public Object create( 276 int transform, 277 String name, 278 Status status); 279 280 /** 281 * Updates the <code>qualityFlag</code> instance in the persistent store. 282 * @param qualityFlag 283 */ 284 public void update(QualityFlag qualityFlag); 285 286 /** 287 * Updates all instances in the <code>entities</code> collection in the persistent store. 288 * @param entities 289 */ 290 public void update(Collection<QualityFlag> entities); 291 292 /** 293 * Removes the instance of QualityFlag from the persistent store. 294 * @param qualityFlag 295 */ 296 public void remove(QualityFlag qualityFlag); 297 298 /** 299 * Removes the instance of QualityFlag having the given 300 * <code>identifier</code> from the persistent store. 301 * @param code 302 */ 303 public void remove(String code); 304 305 /** 306 * Removes all entities in the given <code>entities</code> collection. 307 * @param entities 308 */ 309 public void remove(Collection<QualityFlag> entities); 310 311 312 /** 313 * Does the same thing as {@link #search(int, Search)} but with an 314 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 315 * limit your data to a specified page number and size. 316 * 317 * @param transform the transformation flag. 318 * @param pageNumber the page number in the data to retrieve 319 * @param pageSize the size of the page to retrieve. 320 * @param search the search object which provides the search parameters and pagination specification. 321 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 322 */ 323 public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search); 324 325 /** 326 * Does the same thing as {@link #search(Search)} but with an 327 * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to 328 * limit your data to a specified page number and size. 329 * 330 * @param pageNumber the page number in the data to retrieve 331 * @param pageSize the size of the page to retrieve. 332 * @param search the search object which provides the search parameters and pagination specification. 333 * @return any found results from the search wrapped in a {@link PaginationResult} instance. 334 */ 335 public PaginationResult search(final int pageNumber, final int pageSize, final Search search); 336 337 /** 338 * Does the same thing as {@link #search(Search)} but with an 339 * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then 340 * finder results will <strong>NOT</strong> be transformed during retrieval. 341 * If this flag is any of the other constants defined here 342 * then results <strong>WILL BE</strong> passed through an operation which can optionally 343 * transform the entities (into value objects for example). By default, transformation does 344 * not occur. 345 * 346 * @param transform the transformation flag. 347 * @param search the search object which provides the search parameters and pagination specification. 348 * @return any found results from the search. 349 */ 350 public Set<?> search(final int transform, final Search search); 351 352 /** 353 * Performs a search using the parameters specified in the given <code>search</code> object. 354 * 355 * @param search the search object which provides the search parameters and pagination specification. 356 * @return any found results from the search. 357 */ 358 public Set<QualityFlag> search(final Search search); 359 360 /** 361 * Allows transformation of entities into value objects 362 * (or something else for that matter), when the <code>transform</code> 363 * flag is set to one of the constants defined in <code>fr.ifremer.adagio.core.dao.referential.QualityFlagDao</code>, please note 364 * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself 365 * will be returned. 366 * 367 * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed. 368 * 369 * @param transform one of the constants declared in {@link fr.ifremer.adagio.core.dao.referential.QualityFlagDao} 370 * @param entity an entity that was found 371 * @return the transformed entity (i.e. new value object, etc) 372 * @see #transformEntities(int,Collection) 373 */ 374 public Object transformEntity(final int transform, final QualityFlag entity); 375 376 /** 377 * Transforms a collection of entities using the 378 * {@link #transformEntity(int,QualityFlag)} 379 * method. This method does not instantiate a new collection. 380 * <p> 381 * This method is to be used internally only. 382 * 383 * @param transform one of the constants declared in <code>fr.ifremer.adagio.core.dao.referential.QualityFlagDao</code> 384 * @param entities the collection of entities to transform 385 * @see #transformEntity(int,QualityFlag) 386 */ 387 public void transformEntities(final int transform, final Collection<?> entities); 388 389 // spring-dao merge-point 390}