1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  /**
27   * <a href="ImageUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       ImagePersistence
36   * @see       ImagePersistenceImpl
37   * @generated
38   */
39  public class ImageUtil {
40      public static void cacheResult(com.liferay.portal.model.Image image) {
41          getPersistence().cacheResult(image);
42      }
43  
44      public static void cacheResult(
45          java.util.List<com.liferay.portal.model.Image> images) {
46          getPersistence().cacheResult(images);
47      }
48  
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      public static com.liferay.portal.model.Image create(long imageId) {
54          return getPersistence().create(imageId);
55      }
56  
57      public static com.liferay.portal.model.Image remove(long imageId)
58          throws com.liferay.portal.NoSuchImageException,
59              com.liferay.portal.SystemException {
60          return getPersistence().remove(imageId);
61      }
62  
63      public static com.liferay.portal.model.Image remove(
64          com.liferay.portal.model.Image image)
65          throws com.liferay.portal.SystemException {
66          return getPersistence().remove(image);
67      }
68  
69      /**
70       * @deprecated Use {@link #update(Image, boolean merge)}.
71       */
72      public static com.liferay.portal.model.Image update(
73          com.liferay.portal.model.Image image)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(image);
76      }
77  
78      /**
79       * Add, update, or merge, the entity. This method also calls the model
80       * listeners to trigger the proper events associated with adding, deleting,
81       * or updating an entity.
82       *
83       * @param  image the entity to add, update, or merge
84       * @param  merge boolean value for whether to merge the entity. The default
85       *         value is false. Setting merge to true is more expensive and
86       *         should only be true when image is transient. See
87       *         LEP-5473 for a detailed discussion of this method.
88       * @return the entity that was added, updated, or merged
89       */
90      public static com.liferay.portal.model.Image update(
91          com.liferay.portal.model.Image image, boolean merge)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().update(image, merge);
94      }
95  
96      public static com.liferay.portal.model.Image updateImpl(
97          com.liferay.portal.model.Image image, boolean merge)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().updateImpl(image, merge);
100     }
101 
102     public static com.liferay.portal.model.Image findByPrimaryKey(long imageId)
103         throws com.liferay.portal.NoSuchImageException,
104             com.liferay.portal.SystemException {
105         return getPersistence().findByPrimaryKey(imageId);
106     }
107 
108     public static com.liferay.portal.model.Image fetchByPrimaryKey(long imageId)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().fetchByPrimaryKey(imageId);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.Image> findBySize(
114         int size) throws com.liferay.portal.SystemException {
115         return getPersistence().findBySize(size);
116     }
117 
118     public static java.util.List<com.liferay.portal.model.Image> findBySize(
119         int size, int start, int end) throws com.liferay.portal.SystemException {
120         return getPersistence().findBySize(size, start, end);
121     }
122 
123     public static java.util.List<com.liferay.portal.model.Image> findBySize(
124         int size, int start, int end,
125         com.liferay.portal.kernel.util.OrderByComparator obc)
126         throws com.liferay.portal.SystemException {
127         return getPersistence().findBySize(size, start, end, obc);
128     }
129 
130     public static com.liferay.portal.model.Image findBySize_First(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_First(size, obc);
135     }
136 
137     public static com.liferay.portal.model.Image findBySize_Last(int size,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.NoSuchImageException,
140             com.liferay.portal.SystemException {
141         return getPersistence().findBySize_Last(size, obc);
142     }
143 
144     public static com.liferay.portal.model.Image[] findBySize_PrevAndNext(
145         long imageId, int size,
146         com.liferay.portal.kernel.util.OrderByComparator obc)
147         throws com.liferay.portal.NoSuchImageException,
148             com.liferay.portal.SystemException {
149         return getPersistence().findBySize_PrevAndNext(imageId, size, obc);
150     }
151 
152     public static java.util.List<Object> findWithDynamicQuery(
153         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
154         throws com.liferay.portal.SystemException {
155         return getPersistence().findWithDynamicQuery(dynamicQuery);
156     }
157 
158     public static java.util.List<Object> findWithDynamicQuery(
159         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
160         int end) throws com.liferay.portal.SystemException {
161         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
162     }
163 
164     public static java.util.List<com.liferay.portal.model.Image> findAll()
165         throws com.liferay.portal.SystemException {
166         return getPersistence().findAll();
167     }
168 
169     public static java.util.List<com.liferay.portal.model.Image> findAll(
170         int start, int end) throws com.liferay.portal.SystemException {
171         return getPersistence().findAll(start, end);
172     }
173 
174     public static java.util.List<com.liferay.portal.model.Image> findAll(
175         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
176         throws com.liferay.portal.SystemException {
177         return getPersistence().findAll(start, end, obc);
178     }
179 
180     public static void removeBySize(int size)
181         throws com.liferay.portal.SystemException {
182         getPersistence().removeBySize(size);
183     }
184 
185     public static void removeAll() throws com.liferay.portal.SystemException {
186         getPersistence().removeAll();
187     }
188 
189     public static int countBySize(int size)
190         throws com.liferay.portal.SystemException {
191         return getPersistence().countBySize(size);
192     }
193 
194     public static int countAll() throws com.liferay.portal.SystemException {
195         return getPersistence().countAll();
196     }
197 
198     public static ImagePersistence getPersistence() {
199         return _persistence;
200     }
201 
202     public void setPersistence(ImagePersistence persistence) {
203         _persistence = persistence;
204     }
205 
206     private static ImagePersistence _persistence;
207 }