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