View Javadoc
1   // license-header java merge-point
2   //
3   // Attention: Generated code! Do not modify by hand!
4   // Generated by: SpringDao.vsl in andromda-spring-cartridge.
5   //
6   package fr.ifremer.quadrige2.core.dao.system.versionning;
7   
8   /*-
9    * #%L
10   * Quadrige2 Core :: Server API
11   * %%
12   * Copyright (C) 2017 Ifremer
13   * %%
14   * This program is free software: you can redistribute it and/or modify
15   * it under the terms of the GNU Affero General Public License as published by
16   * the Free Software Foundation, either version 3 of the License, or
17   * (at your option) any later version.
18   * 
19   * This program is distributed in the hope that it will be useful,
20   * but WITHOUT ANY WARRANTY; without even the implied warranty of
21   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22   * GNU General Public License for more details.
23   * 
24   * You should have received a copy of the GNU Affero General Public License
25   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
26   * #L%
27   */
28  
29  import fr.ifremer.quadrige2.core.dao.Search;
30  import java.sql.Timestamp;
31  import java.util.Collection;
32  import java.util.Date;
33  import java.util.Set;
34  import org.andromda.spring.PaginationResult;
35  
36  /**
37   * Historiqque des versions du système.
38   * Chaque mise à jour du schéma entraine une insertion dans cette table.
39   * @see SystemVersion
40   */
41  public interface SystemVersionDao
42  {
43      /**
44       * This constant is used as a transformation flag; entities can be converted automatically into value objects
45       * or other types, different methods in a class implementing this interface support this feature: look for
46       * an <code>int</code> parameter called <code>transform</code>.
47       * <p>
48       * This specific flag denotes no transformation will occur.
49       */
50      public static final int TRANSFORM_NONE = 0;
51  
52  
53      /**
54       * Transforms the given results to a collection of {@link SystemVersion}
55       * instances (this is useful when the returned results contains a row of data and you want just entities only).
56       *
57       * @param results the query results.
58       */
59      public void toEntities(final Collection<?> results);
60  
61      /**
62       * Gets an instance of SystemVersion from the persistent store.
63       * @param systemVersionId
64       * @return SystemVersion
65       */
66      public SystemVersion get(Integer systemVersionId);
67  
68      /**
69       * <p>
70       * Does the same thing as {@link #get(Integer)} with an
71       * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
72       * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
73       * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
74       * optionally transform the entity (into a value object for example). By default, transformation does
75       * not occur.
76       * </p>
77       *
78       * @param transform flag to determine transformation type.
79       * @param systemVersionId the identifier of the entity to get.
80       * @return either the entity or the object transformed from the entity.
81       */
82      public Object get(int transform, Integer systemVersionId);
83  
84      /**
85       * Loads an instance of SystemVersion from the persistent store.
86       * @param systemVersionId
87       * @return SystemVersion
88       */
89      public SystemVersion load(Integer systemVersionId);
90  
91      /**
92       * <p>
93       * Does the same thing as {@link #load(Integer)} with an
94       * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
95       * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
96       * defined in this class then the result <strong>WILL BE</strong> passed through an operation which can
97       * optionally transform the entity (into a value object for example). By default, transformation does
98       * not occur.
99       * </p>
100      *
101      * @param transform flag to determine transformation type.
102      * @param systemVersionId the identifier of the entity to load.
103      * @return either the entity or the object transformed from the entity.
104      */
105     public Object load(int transform, Integer systemVersionId);
106 
107     /**
108      * Loads all entities of type {@link SystemVersion}.
109      *
110      * @return the loaded entities.
111      */
112     public Collection<SystemVersion> loadAll();
113 
114     /**
115      * <p>
116      * Does the same thing as {@link #loadAll()} with an
117      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
118      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
119      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
120      * transform the entity (into a value object for example). By default, transformation does
121      * not occur.
122      * </p>
123      *
124      * @param transform the flag indicating what transformation to use.
125      * @return the loaded entities.
126      */
127     public Collection<?> loadAll(final int transform);
128 
129     /**
130      * <p>
131      * Does the same thing as {@link #loadAll()} with an
132      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
133      * 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
134      * page retrieved.
135      * </p>
136      *
137      * @param pageNumber the page number to retrieve when paging results.
138      * @param pageSize the size of the page to retrieve when paging results.
139      * @return the loaded entities.
140      */
141     public Collection<?> loadAll(final int pageNumber, final int pageSize);
142 
143     /**
144      * <p>
145      * Does the same thing as {@link #loadAll(int)} with an
146      * additional two arguments called <code>pageNumber</code> and <code>pageSize</code>. The <code>pageNumber</code>
147      * 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
148      * page retrieved.
149      * </p>
150      *
151      * @param transform the flag indicating what transformation to use.
152      * @param pageNumber the page number to retrieve when paging results.
153      * @param pageSize the size of the page to retrieve when paging results.
154      * @return the loaded entities.
155      */
156     public Collection<?> loadAll(final int transform, final int pageNumber, final int pageSize);
157 
158     /**
159      * Creates an instance of SystemVersion and adds it to the persistent store.
160      * @param systemVersion
161      * @return SystemVersion
162      */
163     public SystemVersion create(SystemVersion systemVersion);
164 
165     /**
166      * <p>
167      * Does the same thing as {@link #create(SystemVersion)} with an
168      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
169      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
170      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
171      * transform the entity (into a value object for example). By default, transformation does
172      * not occur.
173      * </p>
174      * @param transform
175      * @param systemVersion
176      * @return Object
177      */
178     public Object create(int transform, SystemVersion systemVersion);
179 
180     /**
181      * Creates a new instance of SystemVersion and adds
182      * from the passed in <code>entities</code> collection
183      *
184      * @param entities the collection of SystemVersion
185      * instances to create.
186      *
187      * @return the created instances.
188      */
189     public Collection<SystemVersion> create(Collection<SystemVersion> entities);
190 
191     /**
192      * <p>
193      * Does the same thing as {@link #create(SystemVersion)} with an
194      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
195      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
196      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
197      * transform the entities (into value objects for example). By default, transformation does
198      * not occur.
199      * </p>
200      * @param transform
201      * @param entities
202      * @return Collection
203      */
204     public Collection<?> create(int transform, Collection<SystemVersion> entities);
205 
206     /**
207      * <p>
208      * Creates a new <code>SystemVersion</code>
209      * instance from <strong>all</strong> attributes and adds it to
210      * the persistent store.
211      * </p>
212      * @param systemVersionLb <html>
213 <head>
214 <style>
215 p {padding:0px; margin:0px;}
216 </style>
217 </head>
218 <body>
219 <p>
220 The version string. Version identifiers should have three or four
221 components:
222 </p>
223 <p>
224 </p>
225 <ol>
226 <li>
227 Major version. A non-negative integer.
228 </li>
229 <li>
230 Minor version. A non-negative integer.
231 </li>
232 <li>
233 Micro version. A non-negative integer.
234 </li>
235 <li>
236 Qualifier (optional). A text string compatible with regex :
237 ([0-9]|[a-zA-Z]|_|-)+
238 </li>
239 </ol>
240 <p>
241 </p>
242 <p>
243 See osgi Version specification : <a
244 href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html">http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html</a>
245 </p>
246 <p>
247 </p>
248 <p>
249 Example :
250 </p>
251 <ul>
252 <li>
253 3.4.1
254 </li>
255 <li>
256 3.4.1.20130820
257 </li>
258 <li>
259 ...
260 </li>
261 </ul>
262 <p>
263 </p>
264 </body>
265 </html>
266      * @param systemVersionDc 
267      * @param systemVersionCreationDt 
268      * @param systemVersionCm 
269      * @param updateDt 
270      * @return SystemVersion
271      */
272     public SystemVersion create(
273         String systemVersionLb,
274         String systemVersionDc,
275         Date systemVersionCreationDt,
276         String systemVersionCm,
277         Timestamp updateDt);
278 
279     /**
280      * <p>
281      * Does the same thing as {@link #create(String, String, Date, String, Timestamp)} with an
282      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
283      * the returned entity will <strong>NOT</strong> be transformed. If this flag is any of the other constants
284      * defined here then the result <strong>WILL BE</strong> passed through an operation which can optionally
285      * transform the entity (into a value object for example). By default, transformation does
286      * not occur.
287      * </p>
288      * @param transform
289      * @param systemVersionLb <html>
290 <head>
291 <style>
292 p {padding:0px; margin:0px;}
293 </style>
294 </head>
295 <body>
296 <p>
297 The version string. Version identifiers should have three or four
298 components:
299 </p>
300 <p>
301 </p>
302 <ol>
303 <li>
304 Major version. A non-negative integer.
305 </li>
306 <li>
307 Minor version. A non-negative integer.
308 </li>
309 <li>
310 Micro version. A non-negative integer.
311 </li>
312 <li>
313 Qualifier (optional). A text string compatible with regex :
314 ([0-9]|[a-zA-Z]|_|-)+
315 </li>
316 </ol>
317 <p>
318 </p>
319 <p>
320 See osgi Version specification : <a
321 href="http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html">http://www.osgi.org/javadoc/r4v42/org/osgi/framework/Version.html</a>
322 </p>
323 <p>
324 </p>
325 <p>
326 Example :
327 </p>
328 <ul>
329 <li>
330 3.4.1
331 </li>
332 <li>
333 3.4.1.20130820
334 </li>
335 <li>
336 ...
337 </li>
338 </ul>
339 <p>
340 </p>
341 </body>
342 </html>
343      * @param systemVersionDc 
344      * @param systemVersionCreationDt 
345      * @param systemVersionCm 
346      * @param updateDt 
347      * @return SystemVersion
348      */
349     public Object create(
350         int transform,
351         String systemVersionLb,
352         String systemVersionDc,
353         Date systemVersionCreationDt,
354         String systemVersionCm,
355         Timestamp updateDt);
356 
357 
358     /**
359      * Updates the <code>systemVersion</code> instance in the persistent store.
360      * @param systemVersion
361      */
362     public void update(SystemVersion systemVersion);
363 
364     /**
365      * Updates all instances in the <code>entities</code> collection in the persistent store.
366      * @param entities
367      */
368     public void update(Collection<SystemVersion> entities);
369 
370     /**
371      * Removes the instance of SystemVersion from the persistent store.
372      * @param systemVersion
373      */
374     public void remove(SystemVersion systemVersion);
375 
376     /**
377      * Removes the instance of SystemVersion having the given
378      * <code>identifier</code> from the persistent store.
379      * @param systemVersionId
380      */
381     public void remove(Integer systemVersionId);
382 
383     /**
384      * Removes all entities in the given <code>entities</code> collection.
385      * @param entities
386      */
387     public void remove(Collection<SystemVersion> entities);
388 
389 
390     /**
391      * Does the same thing as {@link #search(int, Search)} but with an
392      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
393      * limit your data to a specified page number and size.
394      *
395      * @param transform the transformation flag.
396      * @param pageNumber the page number in the data to retrieve
397      * @param pageSize the size of the page to retrieve.
398      * @param search the search object which provides the search parameters and pagination specification.
399      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
400      */
401     public PaginationResult search(final int transform, final int pageNumber, final int pageSize, final Search search);
402 
403     /**
404      * Does the same thing as {@link #search(Search)} but with an
405      * additional two flags called <code>pageNumber</code> and <code>pageSize</code>. These flags allow you to
406      * limit your data to a specified page number and size.
407      *
408      * @param pageNumber the page number in the data to retrieve
409      * @param pageSize the size of the page to retrieve.
410      * @param search the search object which provides the search parameters and pagination specification.
411      * @return any found results from the search wrapped in a {@link PaginationResult} instance.
412      */
413     public PaginationResult search(final int pageNumber, final int pageSize, final Search search);
414 
415     /**
416      * Does the same thing as {@link #search(Search)} but with an
417      * additional flag called <code>transform</code>. If this flag is set to <code>TRANSFORM_NONE</code> then
418      * finder results will <strong>NOT</strong> be transformed during retrieval.
419      * If this flag is any of the other constants defined here
420      * then results <strong>WILL BE</strong> passed through an operation which can optionally
421      * transform the entities (into value objects for example). By default, transformation does
422      * not occur.
423      *
424      * @param transform the transformation flag.
425      * @param search the search object which provides the search parameters and pagination specification.
426      * @return any found results from the search.
427      */
428     public Set<?> search(final int transform, final Search search);
429 
430     /**
431      * Performs a search using the parameters specified in the given <code>search</code> object.
432      *
433      * @param search the search object which provides the search parameters and pagination specification.
434      * @return any found results from the search.
435      */
436     public Set<SystemVersion> search(final Search search);
437 
438     /**
439      * Allows transformation of entities into value objects
440      * (or something else for that matter), when the <code>transform</code>
441      * flag is set to one of the constants defined in <code>fr.ifremer.quadrige2.core.dao.system.versionning.SystemVersionDao</code>, please note
442      * that the {@link #TRANSFORM_NONE} constant denotes no transformation, so the entity itself
443      * will be returned.
444      *
445      * If the integer argument value is unknown {@link #TRANSFORM_NONE} is assumed.
446      *
447      * @param transform one of the constants declared in {@link fr.ifremer.quadrige2.core.dao.system.versionning.SystemVersionDao}
448      * @param entity an entity that was found
449      * @return the transformed entity (i.e. new value object, etc)
450      * @see #transformEntities(int,Collection)
451      */
452     public Object transformEntity(final int transform, final SystemVersion entity);
453 
454     /**
455      * Transforms a collection of entities using the
456      * {@link #transformEntity(int,SystemVersion)}
457      * method. This method does not instantiate a new collection.
458      * <p>
459      * This method is to be used internally only.
460      *
461      * @param transform one of the constants declared in <code>fr.ifremer.quadrige2.core.dao.system.versionning.SystemVersionDao</code>
462      * @param entities the collection of entities to transform
463      * @see #transformEntity(int,SystemVersion)
464      */
465     public void transformEntities(final int transform, final Collection<?> entities);
466 
467     // spring-dao merge-point
468 }