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