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