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="PortletItemUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class PortletItemUtil {
32      public static void cacheResult(
33          com.liferay.portal.model.PortletItem portletItem) {
34          getPersistence().cacheResult(portletItem);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portal.model.PortletItem> portletItems) {
39          getPersistence().cacheResult(portletItems);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portal.model.PortletItem create(
47          long portletItemId) {
48          return getPersistence().create(portletItemId);
49      }
50  
51      public static com.liferay.portal.model.PortletItem remove(
52          long portletItemId)
53          throws com.liferay.portal.NoSuchPortletItemException,
54              com.liferay.portal.SystemException {
55          return getPersistence().remove(portletItemId);
56      }
57  
58      public static com.liferay.portal.model.PortletItem remove(
59          com.liferay.portal.model.PortletItem portletItem)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(portletItem);
62      }
63  
64      /**
65       * @deprecated Use <code>update(PortletItem portletItem, boolean merge)</code>.
66       */
67      public static com.liferay.portal.model.PortletItem update(
68          com.liferay.portal.model.PortletItem portletItem)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(portletItem);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        portletItem the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when portletItem is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portal.model.PortletItem update(
87          com.liferay.portal.model.PortletItem portletItem, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().update(portletItem, merge);
90      }
91  
92      public static com.liferay.portal.model.PortletItem updateImpl(
93          com.liferay.portal.model.PortletItem portletItem, boolean merge)
94          throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(portletItem, merge);
96      }
97  
98      public static com.liferay.portal.model.PortletItem findByPrimaryKey(
99          long portletItemId)
100         throws com.liferay.portal.NoSuchPortletItemException,
101             com.liferay.portal.SystemException {
102         return getPersistence().findByPrimaryKey(portletItemId);
103     }
104 
105     public static com.liferay.portal.model.PortletItem fetchByPrimaryKey(
106         long portletItemId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(portletItemId);
108     }
109 
110     public static java.util.List<com.liferay.portal.model.PortletItem> findByG_C(
111         long groupId, long classNameId)
112         throws com.liferay.portal.SystemException {
113         return getPersistence().findByG_C(groupId, classNameId);
114     }
115 
116     public static java.util.List<com.liferay.portal.model.PortletItem> findByG_C(
117         long groupId, long classNameId, int start, int end)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().findByG_C(groupId, classNameId, start, end);
120     }
121 
122     public static java.util.List<com.liferay.portal.model.PortletItem> findByG_C(
123         long groupId, long classNameId, int start, int end,
124         com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.SystemException {
126         return getPersistence().findByG_C(groupId, classNameId, start, end, obc);
127     }
128 
129     public static com.liferay.portal.model.PortletItem findByG_C_First(
130         long groupId, long classNameId,
131         com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.NoSuchPortletItemException,
133             com.liferay.portal.SystemException {
134         return getPersistence().findByG_C_First(groupId, classNameId, obc);
135     }
136 
137     public static com.liferay.portal.model.PortletItem findByG_C_Last(
138         long groupId, long classNameId,
139         com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.NoSuchPortletItemException,
141             com.liferay.portal.SystemException {
142         return getPersistence().findByG_C_Last(groupId, classNameId, obc);
143     }
144 
145     public static com.liferay.portal.model.PortletItem[] findByG_C_PrevAndNext(
146         long portletItemId, long groupId, long classNameId,
147         com.liferay.portal.kernel.util.OrderByComparator obc)
148         throws com.liferay.portal.NoSuchPortletItemException,
149             com.liferay.portal.SystemException {
150         return getPersistence()
151                    .findByG_C_PrevAndNext(portletItemId, groupId, classNameId,
152             obc);
153     }
154 
155     public static java.util.List<com.liferay.portal.model.PortletItem> findByG_P_C(
156         long groupId, java.lang.String portletId, long classNameId)
157         throws com.liferay.portal.SystemException {
158         return getPersistence().findByG_P_C(groupId, portletId, classNameId);
159     }
160 
161     public static java.util.List<com.liferay.portal.model.PortletItem> findByG_P_C(
162         long groupId, java.lang.String portletId, long classNameId, int start,
163         int end) throws com.liferay.portal.SystemException {
164         return getPersistence()
165                    .findByG_P_C(groupId, portletId, classNameId, start, end);
166     }
167 
168     public static java.util.List<com.liferay.portal.model.PortletItem> findByG_P_C(
169         long groupId, java.lang.String portletId, long classNameId, int start,
170         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
171         throws com.liferay.portal.SystemException {
172         return getPersistence()
173                    .findByG_P_C(groupId, portletId, classNameId, start, end, obc);
174     }
175 
176     public static com.liferay.portal.model.PortletItem findByG_P_C_First(
177         long groupId, java.lang.String portletId, long classNameId,
178         com.liferay.portal.kernel.util.OrderByComparator obc)
179         throws com.liferay.portal.NoSuchPortletItemException,
180             com.liferay.portal.SystemException {
181         return getPersistence()
182                    .findByG_P_C_First(groupId, portletId, classNameId, obc);
183     }
184 
185     public static com.liferay.portal.model.PortletItem findByG_P_C_Last(
186         long groupId, java.lang.String portletId, long classNameId,
187         com.liferay.portal.kernel.util.OrderByComparator obc)
188         throws com.liferay.portal.NoSuchPortletItemException,
189             com.liferay.portal.SystemException {
190         return getPersistence()
191                    .findByG_P_C_Last(groupId, portletId, classNameId, obc);
192     }
193 
194     public static com.liferay.portal.model.PortletItem[] findByG_P_C_PrevAndNext(
195         long portletItemId, long groupId, java.lang.String portletId,
196         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
197         throws com.liferay.portal.NoSuchPortletItemException,
198             com.liferay.portal.SystemException {
199         return getPersistence()
200                    .findByG_P_C_PrevAndNext(portletItemId, groupId, portletId,
201             classNameId, obc);
202     }
203 
204     public static com.liferay.portal.model.PortletItem findByG_N_P_C(
205         long groupId, java.lang.String name, java.lang.String portletId,
206         long classNameId)
207         throws com.liferay.portal.NoSuchPortletItemException,
208             com.liferay.portal.SystemException {
209         return getPersistence()
210                    .findByG_N_P_C(groupId, name, portletId, classNameId);
211     }
212 
213     public static com.liferay.portal.model.PortletItem fetchByG_N_P_C(
214         long groupId, java.lang.String name, java.lang.String portletId,
215         long classNameId) throws com.liferay.portal.SystemException {
216         return getPersistence()
217                    .fetchByG_N_P_C(groupId, name, portletId, classNameId);
218     }
219 
220     public static com.liferay.portal.model.PortletItem fetchByG_N_P_C(
221         long groupId, java.lang.String name, java.lang.String portletId,
222         long classNameId, boolean retrieveFromCache)
223         throws com.liferay.portal.SystemException {
224         return getPersistence()
225                    .fetchByG_N_P_C(groupId, name, portletId, classNameId,
226             retrieveFromCache);
227     }
228 
229     public static java.util.List<Object> findWithDynamicQuery(
230         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
231         throws com.liferay.portal.SystemException {
232         return getPersistence().findWithDynamicQuery(dynamicQuery);
233     }
234 
235     public static java.util.List<Object> findWithDynamicQuery(
236         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
237         int end) throws com.liferay.portal.SystemException {
238         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
239     }
240 
241     public static java.util.List<com.liferay.portal.model.PortletItem> findAll()
242         throws com.liferay.portal.SystemException {
243         return getPersistence().findAll();
244     }
245 
246     public static java.util.List<com.liferay.portal.model.PortletItem> findAll(
247         int start, int end) throws com.liferay.portal.SystemException {
248         return getPersistence().findAll(start, end);
249     }
250 
251     public static java.util.List<com.liferay.portal.model.PortletItem> findAll(
252         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
253         throws com.liferay.portal.SystemException {
254         return getPersistence().findAll(start, end, obc);
255     }
256 
257     public static void removeByG_C(long groupId, long classNameId)
258         throws com.liferay.portal.SystemException {
259         getPersistence().removeByG_C(groupId, classNameId);
260     }
261 
262     public static void removeByG_P_C(long groupId, java.lang.String portletId,
263         long classNameId) throws com.liferay.portal.SystemException {
264         getPersistence().removeByG_P_C(groupId, portletId, classNameId);
265     }
266 
267     public static void removeByG_N_P_C(long groupId, java.lang.String name,
268         java.lang.String portletId, long classNameId)
269         throws com.liferay.portal.NoSuchPortletItemException,
270             com.liferay.portal.SystemException {
271         getPersistence().removeByG_N_P_C(groupId, name, portletId, classNameId);
272     }
273 
274     public static void removeAll() throws com.liferay.portal.SystemException {
275         getPersistence().removeAll();
276     }
277 
278     public static int countByG_C(long groupId, long classNameId)
279         throws com.liferay.portal.SystemException {
280         return getPersistence().countByG_C(groupId, classNameId);
281     }
282 
283     public static int countByG_P_C(long groupId, java.lang.String portletId,
284         long classNameId) throws com.liferay.portal.SystemException {
285         return getPersistence().countByG_P_C(groupId, portletId, classNameId);
286     }
287 
288     public static int countByG_N_P_C(long groupId, java.lang.String name,
289         java.lang.String portletId, long classNameId)
290         throws com.liferay.portal.SystemException {
291         return getPersistence()
292                    .countByG_N_P_C(groupId, name, portletId, classNameId);
293     }
294 
295     public static int countAll() throws com.liferay.portal.SystemException {
296         return getPersistence().countAll();
297     }
298 
299     public static PortletItemPersistence getPersistence() {
300         return _persistence;
301     }
302 
303     public void setPersistence(PortletItemPersistence persistence) {
304         _persistence = persistence;
305     }
306 
307     private static PortletItemPersistence _persistence;
308 }