1   /**
2    * Copyright (c) 2000-2010 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   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.Image;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="ImageUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       ImagePersistence
35   * @see       ImagePersistenceImpl
36   * @generated
37   */
38  public class ImageUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(Image)
48       */
49      public static void clearCache(Image image) {
50          getPersistence().clearCache(image);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static Image remove(Image image) throws SystemException {
81          return getPersistence().remove(image);
82      }
83  
84      /**
85       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
86       */
87      public static Image update(Image image, boolean merge)
88          throws SystemException {
89          return getPersistence().update(image, merge);
90      }
91  
92      public static void cacheResult(com.liferay.portal.model.Image image) {
93          getPersistence().cacheResult(image);
94      }
95  
96      public static void cacheResult(
97          java.util.List<com.liferay.portal.model.Image> images) {
98          getPersistence().cacheResult(images);
99      }
100 
101     public static com.liferay.portal.model.Image create(long imageId) {
102         return getPersistence().create(imageId);
103     }
104 
105     public static com.liferay.portal.model.Image remove(long imageId)
106         throws com.liferay.portal.NoSuchImageException,
107             com.liferay.portal.SystemException {
108         return getPersistence().remove(imageId);
109     }
110 
111     /**
112      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
113      */
114     public static com.liferay.portal.model.Image update(
115         com.liferay.portal.model.Image image)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().update(image);
118     }
119 
120     public static com.liferay.portal.model.Image updateImpl(
121         com.liferay.portal.model.Image image, boolean merge)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().updateImpl(image, merge);
124     }
125 
126     public static com.liferay.portal.model.Image findByPrimaryKey(long imageId)
127         throws com.liferay.portal.NoSuchImageException,
128             com.liferay.portal.SystemException {
129         return getPersistence().findByPrimaryKey(imageId);
130     }
131 
132     public static com.liferay.portal.model.Image fetchByPrimaryKey(long imageId)
133         throws com.liferay.portal.SystemException {
134         return getPersistence().fetchByPrimaryKey(imageId);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.Image> findBySize(
138         int size) throws com.liferay.portal.SystemException {
139         return getPersistence().findBySize(size);
140     }
141 
142     public static java.util.List<com.liferay.portal.model.Image> findBySize(
143         int size, int start, int end) throws com.liferay.portal.SystemException {
144         return getPersistence().findBySize(size, start, end);
145     }
146 
147     public static java.util.List<com.liferay.portal.model.Image> findBySize(
148         int size, int start, int end,
149         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
150         throws com.liferay.portal.SystemException {
151         return getPersistence().findBySize(size, start, end, orderByComparator);
152     }
153 
154     public static com.liferay.portal.model.Image findBySize_First(int size,
155         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
156         throws com.liferay.portal.NoSuchImageException,
157             com.liferay.portal.SystemException {
158         return getPersistence().findBySize_First(size, orderByComparator);
159     }
160 
161     public static com.liferay.portal.model.Image findBySize_Last(int size,
162         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
163         throws com.liferay.portal.NoSuchImageException,
164             com.liferay.portal.SystemException {
165         return getPersistence().findBySize_Last(size, orderByComparator);
166     }
167 
168     public static com.liferay.portal.model.Image[] findBySize_PrevAndNext(
169         long imageId, int size,
170         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
171         throws com.liferay.portal.NoSuchImageException,
172             com.liferay.portal.SystemException {
173         return getPersistence()
174                    .findBySize_PrevAndNext(imageId, size, orderByComparator);
175     }
176 
177     public static java.util.List<com.liferay.portal.model.Image> findAll()
178         throws com.liferay.portal.SystemException {
179         return getPersistence().findAll();
180     }
181 
182     public static java.util.List<com.liferay.portal.model.Image> findAll(
183         int start, int end) throws com.liferay.portal.SystemException {
184         return getPersistence().findAll(start, end);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Image> findAll(
188         int start, int end,
189         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
190         throws com.liferay.portal.SystemException {
191         return getPersistence().findAll(start, end, orderByComparator);
192     }
193 
194     public static void removeBySize(int size)
195         throws com.liferay.portal.SystemException {
196         getPersistence().removeBySize(size);
197     }
198 
199     public static void removeAll() throws com.liferay.portal.SystemException {
200         getPersistence().removeAll();
201     }
202 
203     public static int countBySize(int size)
204         throws com.liferay.portal.SystemException {
205         return getPersistence().countBySize(size);
206     }
207 
208     public static int countAll() throws com.liferay.portal.SystemException {
209         return getPersistence().countAll();
210     }
211 
212     public static ImagePersistence getPersistence() {
213         if (_persistence == null) {
214             _persistence = (ImagePersistence)PortalBeanLocatorUtil.locate(ImagePersistence.class.getName());
215 
216             ReferenceRegistry.registerReference(ImageUtil.class, "_persistence");
217         }
218 
219         return _persistence;
220     }
221 
222     public void setPersistence(ImagePersistence persistence) {
223         _persistence = persistence;
224 
225         ReferenceRegistry.registerReference(ImageUtil.class, "_persistence");
226     }
227 
228     private static ImagePersistence _persistence;
229 }