1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="ImageUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class ImageUtil {
29      public static void cacheResult(com.liferay.portal.model.Image image) {
30          getPersistence().cacheResult(image);
31      }
32  
33      public static void cacheResult(
34          java.util.List<com.liferay.portal.model.Image> images) {
35          getPersistence().cacheResult(images);
36      }
37  
38      public static void clearCache() {
39          getPersistence().clearCache();
40      }
41  
42      public static com.liferay.portal.model.Image create(long imageId) {
43          return getPersistence().create(imageId);
44      }
45  
46      public static com.liferay.portal.model.Image remove(long imageId)
47          throws com.liferay.portal.NoSuchImageException,
48              com.liferay.portal.SystemException {
49          return getPersistence().remove(imageId);
50      }
51  
52      public static com.liferay.portal.model.Image remove(
53          com.liferay.portal.model.Image image)
54          throws com.liferay.portal.SystemException {
55          return getPersistence().remove(image);
56      }
57  
58      /**
59       * @deprecated Use <code>update(Image image, boolean merge)</code>.
60       */
61      public static com.liferay.portal.model.Image update(
62          com.liferay.portal.model.Image image)
63          throws com.liferay.portal.SystemException {
64          return getPersistence().update(image);
65      }
66  
67      /**
68       * Add, update, or merge, the entity. This method also calls the model
69       * listeners to trigger the proper events associated with adding, deleting,
70       * or updating an entity.
71       *
72       * @param        image the entity to add, update, or merge
73       * @param        merge boolean value for whether to merge the entity. The
74       *                default value is false. Setting merge to true is more
75       *                expensive and should only be true when image is
76       *                transient. See LEP-5473 for a detailed discussion of this
77       *                method.
78       * @return        true if the portlet can be displayed via Ajax
79       */
80      public static com.liferay.portal.model.Image update(
81          com.liferay.portal.model.Image image, boolean merge)
82          throws com.liferay.portal.SystemException {
83          return getPersistence().update(image, merge);
84      }
85  
86      public static com.liferay.portal.model.Image updateImpl(
87          com.liferay.portal.model.Image image, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().updateImpl(image, merge);
90      }
91  
92      public static com.liferay.portal.model.Image findByPrimaryKey(long imageId)
93          throws com.liferay.portal.NoSuchImageException,
94              com.liferay.portal.SystemException {
95          return getPersistence().findByPrimaryKey(imageId);
96      }
97  
98      public static com.liferay.portal.model.Image fetchByPrimaryKey(long imageId)
99          throws com.liferay.portal.SystemException {
100         return getPersistence().fetchByPrimaryKey(imageId);
101     }
102 
103     public static java.util.List<com.liferay.portal.model.Image> findBySize(
104         int size) throws com.liferay.portal.SystemException {
105         return getPersistence().findBySize(size);
106     }
107 
108     public static java.util.List<com.liferay.portal.model.Image> findBySize(
109         int size, int start, int end) throws com.liferay.portal.SystemException {
110         return getPersistence().findBySize(size, start, end);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.Image> findBySize(
114         int size, int start, int end,
115         com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().findBySize(size, start, end, obc);
118     }
119 
120     public static com.liferay.portal.model.Image findBySize_First(int size,
121         com.liferay.portal.kernel.util.OrderByComparator obc)
122         throws com.liferay.portal.NoSuchImageException,
123             com.liferay.portal.SystemException {
124         return getPersistence().findBySize_First(size, obc);
125     }
126 
127     public static com.liferay.portal.model.Image findBySize_Last(int size,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.NoSuchImageException,
130             com.liferay.portal.SystemException {
131         return getPersistence().findBySize_Last(size, obc);
132     }
133 
134     public static com.liferay.portal.model.Image[] findBySize_PrevAndNext(
135         long imageId, int size,
136         com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.NoSuchImageException,
138             com.liferay.portal.SystemException {
139         return getPersistence().findBySize_PrevAndNext(imageId, size, obc);
140     }
141 
142     public static java.util.List<Object> findWithDynamicQuery(
143         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findWithDynamicQuery(dynamicQuery);
146     }
147 
148     public static java.util.List<Object> findWithDynamicQuery(
149         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
150         int end) throws com.liferay.portal.SystemException {
151         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
152     }
153 
154     public static java.util.List<com.liferay.portal.model.Image> findAll()
155         throws com.liferay.portal.SystemException {
156         return getPersistence().findAll();
157     }
158 
159     public static java.util.List<com.liferay.portal.model.Image> findAll(
160         int start, int end) throws com.liferay.portal.SystemException {
161         return getPersistence().findAll(start, end);
162     }
163 
164     public static java.util.List<com.liferay.portal.model.Image> findAll(
165         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
166         throws com.liferay.portal.SystemException {
167         return getPersistence().findAll(start, end, obc);
168     }
169 
170     public static void removeBySize(int size)
171         throws com.liferay.portal.SystemException {
172         getPersistence().removeBySize(size);
173     }
174 
175     public static void removeAll() throws com.liferay.portal.SystemException {
176         getPersistence().removeAll();
177     }
178 
179     public static int countBySize(int size)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().countBySize(size);
182     }
183 
184     public static int countAll() throws com.liferay.portal.SystemException {
185         return getPersistence().countAll();
186     }
187 
188     public static ImagePersistence getPersistence() {
189         return _persistence;
190     }
191 
192     public void setPersistence(ImagePersistence persistence) {
193         _persistence = persistence;
194     }
195 
196     private static ImagePersistence _persistence;
197 }