1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.imagegallery.service.persistence;
24  
25  /**
26   * <a href="IGImageUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class IGImageUtil {
32      public static com.liferay.portlet.imagegallery.model.IGImage create(
33          long imageId) {
34          return getPersistence().create(imageId);
35      }
36  
37      public static com.liferay.portlet.imagegallery.model.IGImage remove(
38          long imageId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.imagegallery.NoSuchImageException {
41          return getPersistence().remove(imageId);
42      }
43  
44      public static com.liferay.portlet.imagegallery.model.IGImage remove(
45          com.liferay.portlet.imagegallery.model.IGImage igImage)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(igImage);
48      }
49  
50      /**
51       * @deprecated Use <code>update(IGImage igImage, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.imagegallery.model.IGImage update(
54          com.liferay.portlet.imagegallery.model.IGImage igImage)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(igImage);
57      }
58  
59      /**
60       * Add, update, or merge, the entity. This method also calls the model
61       * listeners to trigger the proper events associated with adding, deleting,
62       * or updating an entity.
63       *
64       * @param        igImage the entity to add, update, or merge
65       * @param        merge boolean value for whether to merge the entity. The
66       *                default value is false. Setting merge to true is more
67       *                expensive and should only be true when igImage is
68       *                transient. See LEP-5473 for a detailed discussion of this
69       *                method.
70       * @return        true if the portlet can be displayed via Ajax
71       */
72      public static com.liferay.portlet.imagegallery.model.IGImage update(
73          com.liferay.portlet.imagegallery.model.IGImage igImage, boolean merge)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(igImage, merge);
76      }
77  
78      public static com.liferay.portlet.imagegallery.model.IGImage updateImpl(
79          com.liferay.portlet.imagegallery.model.IGImage igImage, boolean merge)
80          throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(igImage, merge);
82      }
83  
84      public static com.liferay.portlet.imagegallery.model.IGImage findByPrimaryKey(
85          long imageId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.imagegallery.NoSuchImageException {
88          return getPersistence().findByPrimaryKey(imageId);
89      }
90  
91      public static com.liferay.portlet.imagegallery.model.IGImage fetchByPrimaryKey(
92          long imageId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(imageId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByUuid(
97          java.lang.String uuid) throws com.liferay.portal.SystemException {
98          return getPersistence().findByUuid(uuid);
99      }
100 
101     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByUuid(
102         java.lang.String uuid, int begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByUuid(uuid, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByUuid(
108         java.lang.String uuid, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByUuid(uuid, begin, end, obc);
112     }
113 
114     public static com.liferay.portlet.imagegallery.model.IGImage findByUuid_First(
115         java.lang.String uuid,
116         com.liferay.portal.kernel.util.OrderByComparator obc)
117         throws com.liferay.portal.SystemException,
118             com.liferay.portlet.imagegallery.NoSuchImageException {
119         return getPersistence().findByUuid_First(uuid, obc);
120     }
121 
122     public static com.liferay.portlet.imagegallery.model.IGImage findByUuid_Last(
123         java.lang.String uuid,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException,
126             com.liferay.portlet.imagegallery.NoSuchImageException {
127         return getPersistence().findByUuid_Last(uuid, obc);
128     }
129 
130     public static com.liferay.portlet.imagegallery.model.IGImage[] findByUuid_PrevAndNext(
131         long imageId, java.lang.String uuid,
132         com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.SystemException,
134             com.liferay.portlet.imagegallery.NoSuchImageException {
135         return getPersistence().findByUuid_PrevAndNext(imageId, uuid, obc);
136     }
137 
138     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByFolderId(
139         long folderId) throws com.liferay.portal.SystemException {
140         return getPersistence().findByFolderId(folderId);
141     }
142 
143     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByFolderId(
144         long folderId, int begin, int end)
145         throws com.liferay.portal.SystemException {
146         return getPersistence().findByFolderId(folderId, begin, end);
147     }
148 
149     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByFolderId(
150         long folderId, int begin, int end,
151         com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByFolderId(folderId, begin, end, obc);
154     }
155 
156     public static com.liferay.portlet.imagegallery.model.IGImage findByFolderId_First(
157         long folderId, com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.SystemException,
159             com.liferay.portlet.imagegallery.NoSuchImageException {
160         return getPersistence().findByFolderId_First(folderId, obc);
161     }
162 
163     public static com.liferay.portlet.imagegallery.model.IGImage findByFolderId_Last(
164         long folderId, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portlet.imagegallery.NoSuchImageException {
167         return getPersistence().findByFolderId_Last(folderId, obc);
168     }
169 
170     public static com.liferay.portlet.imagegallery.model.IGImage[] findByFolderId_PrevAndNext(
171         long imageId, long folderId,
172         com.liferay.portal.kernel.util.OrderByComparator obc)
173         throws com.liferay.portal.SystemException,
174             com.liferay.portlet.imagegallery.NoSuchImageException {
175         return getPersistence()
176                    .findByFolderId_PrevAndNext(imageId, folderId, obc);
177     }
178 
179     public static com.liferay.portlet.imagegallery.model.IGImage findBySmallImageId(
180         long smallImageId)
181         throws com.liferay.portal.SystemException,
182             com.liferay.portlet.imagegallery.NoSuchImageException {
183         return getPersistence().findBySmallImageId(smallImageId);
184     }
185 
186     public static com.liferay.portlet.imagegallery.model.IGImage fetchBySmallImageId(
187         long smallImageId) throws com.liferay.portal.SystemException {
188         return getPersistence().fetchBySmallImageId(smallImageId);
189     }
190 
191     public static com.liferay.portlet.imagegallery.model.IGImage findByLargeImageId(
192         long largeImageId)
193         throws com.liferay.portal.SystemException,
194             com.liferay.portlet.imagegallery.NoSuchImageException {
195         return getPersistence().findByLargeImageId(largeImageId);
196     }
197 
198     public static com.liferay.portlet.imagegallery.model.IGImage fetchByLargeImageId(
199         long largeImageId) throws com.liferay.portal.SystemException {
200         return getPersistence().fetchByLargeImageId(largeImageId);
201     }
202 
203     public static com.liferay.portlet.imagegallery.model.IGImage findByCustom1ImageId(
204         long custom1ImageId)
205         throws com.liferay.portal.SystemException,
206             com.liferay.portlet.imagegallery.NoSuchImageException {
207         return getPersistence().findByCustom1ImageId(custom1ImageId);
208     }
209 
210     public static com.liferay.portlet.imagegallery.model.IGImage fetchByCustom1ImageId(
211         long custom1ImageId) throws com.liferay.portal.SystemException {
212         return getPersistence().fetchByCustom1ImageId(custom1ImageId);
213     }
214 
215     public static com.liferay.portlet.imagegallery.model.IGImage findByCustom2ImageId(
216         long custom2ImageId)
217         throws com.liferay.portal.SystemException,
218             com.liferay.portlet.imagegallery.NoSuchImageException {
219         return getPersistence().findByCustom2ImageId(custom2ImageId);
220     }
221 
222     public static com.liferay.portlet.imagegallery.model.IGImage fetchByCustom2ImageId(
223         long custom2ImageId) throws com.liferay.portal.SystemException {
224         return getPersistence().fetchByCustom2ImageId(custom2ImageId);
225     }
226 
227     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByF_N(
228         long folderId, java.lang.String name)
229         throws com.liferay.portal.SystemException {
230         return getPersistence().findByF_N(folderId, name);
231     }
232 
233     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByF_N(
234         long folderId, java.lang.String name, int begin, int end)
235         throws com.liferay.portal.SystemException {
236         return getPersistence().findByF_N(folderId, name, begin, end);
237     }
238 
239     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findByF_N(
240         long folderId, java.lang.String name, int begin, int end,
241         com.liferay.portal.kernel.util.OrderByComparator obc)
242         throws com.liferay.portal.SystemException {
243         return getPersistence().findByF_N(folderId, name, begin, end, obc);
244     }
245 
246     public static com.liferay.portlet.imagegallery.model.IGImage findByF_N_First(
247         long folderId, java.lang.String name,
248         com.liferay.portal.kernel.util.OrderByComparator obc)
249         throws com.liferay.portal.SystemException,
250             com.liferay.portlet.imagegallery.NoSuchImageException {
251         return getPersistence().findByF_N_First(folderId, name, obc);
252     }
253 
254     public static com.liferay.portlet.imagegallery.model.IGImage findByF_N_Last(
255         long folderId, java.lang.String name,
256         com.liferay.portal.kernel.util.OrderByComparator obc)
257         throws com.liferay.portal.SystemException,
258             com.liferay.portlet.imagegallery.NoSuchImageException {
259         return getPersistence().findByF_N_Last(folderId, name, obc);
260     }
261 
262     public static com.liferay.portlet.imagegallery.model.IGImage[] findByF_N_PrevAndNext(
263         long imageId, long folderId, java.lang.String name,
264         com.liferay.portal.kernel.util.OrderByComparator obc)
265         throws com.liferay.portal.SystemException,
266             com.liferay.portlet.imagegallery.NoSuchImageException {
267         return getPersistence()
268                    .findByF_N_PrevAndNext(imageId, folderId, name, obc);
269     }
270 
271     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findWithDynamicQuery(
272         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
273         throws com.liferay.portal.SystemException {
274         return getPersistence().findWithDynamicQuery(queryInitializer);
275     }
276 
277     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findWithDynamicQuery(
278         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
279         int begin, int end) throws com.liferay.portal.SystemException {
280         return getPersistence()
281                    .findWithDynamicQuery(queryInitializer, begin, end);
282     }
283 
284     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findAll()
285         throws com.liferay.portal.SystemException {
286         return getPersistence().findAll();
287     }
288 
289     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findAll(
290         int begin, int end) throws com.liferay.portal.SystemException {
291         return getPersistence().findAll(begin, end);
292     }
293 
294     public static java.util.List<com.liferay.portlet.imagegallery.model.IGImage> findAll(
295         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
296         throws com.liferay.portal.SystemException {
297         return getPersistence().findAll(begin, end, obc);
298     }
299 
300     public static void removeByUuid(java.lang.String uuid)
301         throws com.liferay.portal.SystemException {
302         getPersistence().removeByUuid(uuid);
303     }
304 
305     public static void removeByFolderId(long folderId)
306         throws com.liferay.portal.SystemException {
307         getPersistence().removeByFolderId(folderId);
308     }
309 
310     public static void removeBySmallImageId(long smallImageId)
311         throws com.liferay.portal.SystemException,
312             com.liferay.portlet.imagegallery.NoSuchImageException {
313         getPersistence().removeBySmallImageId(smallImageId);
314     }
315 
316     public static void removeByLargeImageId(long largeImageId)
317         throws com.liferay.portal.SystemException,
318             com.liferay.portlet.imagegallery.NoSuchImageException {
319         getPersistence().removeByLargeImageId(largeImageId);
320     }
321 
322     public static void removeByCustom1ImageId(long custom1ImageId)
323         throws com.liferay.portal.SystemException,
324             com.liferay.portlet.imagegallery.NoSuchImageException {
325         getPersistence().removeByCustom1ImageId(custom1ImageId);
326     }
327 
328     public static void removeByCustom2ImageId(long custom2ImageId)
329         throws com.liferay.portal.SystemException,
330             com.liferay.portlet.imagegallery.NoSuchImageException {
331         getPersistence().removeByCustom2ImageId(custom2ImageId);
332     }
333 
334     public static void removeByF_N(long folderId, java.lang.String name)
335         throws com.liferay.portal.SystemException {
336         getPersistence().removeByF_N(folderId, name);
337     }
338 
339     public static void removeAll() throws com.liferay.portal.SystemException {
340         getPersistence().removeAll();
341     }
342 
343     public static int countByUuid(java.lang.String uuid)
344         throws com.liferay.portal.SystemException {
345         return getPersistence().countByUuid(uuid);
346     }
347 
348     public static int countByFolderId(long folderId)
349         throws com.liferay.portal.SystemException {
350         return getPersistence().countByFolderId(folderId);
351     }
352 
353     public static int countBySmallImageId(long smallImageId)
354         throws com.liferay.portal.SystemException {
355         return getPersistence().countBySmallImageId(smallImageId);
356     }
357 
358     public static int countByLargeImageId(long largeImageId)
359         throws com.liferay.portal.SystemException {
360         return getPersistence().countByLargeImageId(largeImageId);
361     }
362 
363     public static int countByCustom1ImageId(long custom1ImageId)
364         throws com.liferay.portal.SystemException {
365         return getPersistence().countByCustom1ImageId(custom1ImageId);
366     }
367 
368     public static int countByCustom2ImageId(long custom2ImageId)
369         throws com.liferay.portal.SystemException {
370         return getPersistence().countByCustom2ImageId(custom2ImageId);
371     }
372 
373     public static int countByF_N(long folderId, java.lang.String name)
374         throws com.liferay.portal.SystemException {
375         return getPersistence().countByF_N(folderId, name);
376     }
377 
378     public static int countAll() throws com.liferay.portal.SystemException {
379         return getPersistence().countAll();
380     }
381 
382     public static IGImagePersistence getPersistence() {
383         return _getUtil()._persistence;
384     }
385 
386     public void setPersistence(IGImagePersistence persistence) {
387         _persistence = persistence;
388     }
389 
390     private static IGImageUtil _getUtil() {
391         if (_util == null) {
392             _util = (IGImageUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
393         }
394 
395         return _util;
396     }
397 
398     private static final String _UTIL = IGImageUtil.class.getName();
399     private static IGImageUtil _util;
400     private IGImagePersistence _persistence;
401 }