1   /**
2    * Copyright (c) 2000-2009 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.portal.service.persistence;
24  
25  /**
26   * <a href="ImageUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class ImageUtil {
32      public static void cacheResult(com.liferay.portal.model.Image image) {
33          getPersistence().cacheResult(image);
34      }
35  
36      public static void cacheResult(
37          java.util.List<com.liferay.portal.model.Image> images) {
38          getPersistence().cacheResult(images);
39      }
40  
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      public static com.liferay.portal.model.Image create(long imageId) {
46          return getPersistence().create(imageId);
47      }
48  
49      public static com.liferay.portal.model.Image remove(long imageId)
50          throws com.liferay.portal.NoSuchImageException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(imageId);
53      }
54  
55      public static com.liferay.portal.model.Image remove(
56          com.liferay.portal.model.Image image)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(image);
59      }
60  
61      /**
62       * @deprecated Use <code>update(Image image, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.Image update(
65          com.liferay.portal.model.Image image)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(image);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        image the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when image is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.Image update(
84          com.liferay.portal.model.Image image, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(image, merge);
87      }
88  
89      public static com.liferay.portal.model.Image updateImpl(
90          com.liferay.portal.model.Image image, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(image, merge);
93      }
94  
95      public static com.liferay.portal.model.Image findByPrimaryKey(long imageId)
96          throws com.liferay.portal.NoSuchImageException,
97              com.liferay.portal.SystemException {
98          return getPersistence().findByPrimaryKey(imageId);
99      }
100 
101     public static com.liferay.portal.model.Image fetchByPrimaryKey(long imageId)
102         throws com.liferay.portal.SystemException {
103         return getPersistence().fetchByPrimaryKey(imageId);
104     }
105 
106     public static java.util.List<com.liferay.portal.model.Image> findBySize(
107         int size) throws com.liferay.portal.SystemException {
108         return getPersistence().findBySize(size);
109     }
110 
111     public static java.util.List<com.liferay.portal.model.Image> findBySize(
112         int size, int start, int end) throws com.liferay.portal.SystemException {
113         return getPersistence().findBySize(size, start, end);
114     }
115 
116     public static java.util.List<com.liferay.portal.model.Image> findBySize(
117         int size, int start, int end,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException {
120         return getPersistence().findBySize(size, start, end, obc);
121     }
122 
123     public static com.liferay.portal.model.Image findBySize_First(int size,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.NoSuchImageException,
126             com.liferay.portal.SystemException {
127         return getPersistence().findBySize_First(size, obc);
128     }
129 
130     public static com.liferay.portal.model.Image findBySize_Last(int size,
131         com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.NoSuchImageException,
133             com.liferay.portal.SystemException {
134         return getPersistence().findBySize_Last(size, obc);
135     }
136 
137     public static com.liferay.portal.model.Image[] findBySize_PrevAndNext(
138         long imageId, int size,
139         com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.NoSuchImageException,
141             com.liferay.portal.SystemException {
142         return getPersistence().findBySize_PrevAndNext(imageId, size, obc);
143     }
144 
145     public static java.util.List<Object> findWithDynamicQuery(
146         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
147         throws com.liferay.portal.SystemException {
148         return getPersistence().findWithDynamicQuery(dynamicQuery);
149     }
150 
151     public static java.util.List<Object> findWithDynamicQuery(
152         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
153         int end) throws com.liferay.portal.SystemException {
154         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
155     }
156 
157     public static java.util.List<com.liferay.portal.model.Image> findAll()
158         throws com.liferay.portal.SystemException {
159         return getPersistence().findAll();
160     }
161 
162     public static java.util.List<com.liferay.portal.model.Image> findAll(
163         int start, int end) throws com.liferay.portal.SystemException {
164         return getPersistence().findAll(start, end);
165     }
166 
167     public static java.util.List<com.liferay.portal.model.Image> findAll(
168         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
169         throws com.liferay.portal.SystemException {
170         return getPersistence().findAll(start, end, obc);
171     }
172 
173     public static void removeBySize(int size)
174         throws com.liferay.portal.SystemException {
175         getPersistence().removeBySize(size);
176     }
177 
178     public static void removeAll() throws com.liferay.portal.SystemException {
179         getPersistence().removeAll();
180     }
181 
182     public static int countBySize(int size)
183         throws com.liferay.portal.SystemException {
184         return getPersistence().countBySize(size);
185     }
186 
187     public static int countAll() throws com.liferay.portal.SystemException {
188         return getPersistence().countAll();
189     }
190 
191     public static ImagePersistence getPersistence() {
192         return _persistence;
193     }
194 
195     public void setPersistence(ImagePersistence persistence) {
196         _persistence = persistence;
197     }
198 
199     private static ImagePersistence _persistence;
200 }