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 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.NoSuchPortletItemException,
40              com.liferay.portal.SystemException {
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.NoSuchPortletItemException,
87              com.liferay.portal.SystemException {
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 start, int end)
104         throws com.liferay.portal.SystemException {
105         return getPersistence().findByG_C(groupId, classNameId, start, end);
106     }
107 
108     public static java.util.List<com.liferay.portal.model.PortletItem> findByG_C(
109         long groupId, long classNameId, int start, int end,
110         com.liferay.portal.kernel.util.OrderByComparator obc)
111         throws com.liferay.portal.SystemException {
112         return getPersistence().findByG_C(groupId, classNameId, start, 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.NoSuchPortletItemException,
119             com.liferay.portal.SystemException {
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.NoSuchPortletItemException,
127             com.liferay.portal.SystemException {
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.NoSuchPortletItemException,
135             com.liferay.portal.SystemException {
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 start,
149         int end) throws com.liferay.portal.SystemException {
150         return getPersistence()
151                    .findByG_P_C(groupId, portletId, classNameId, start, 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 start,
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, start, 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.NoSuchPortletItemException,
166             com.liferay.portal.SystemException {
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.NoSuchPortletItemException,
175             com.liferay.portal.SystemException {
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.NoSuchPortletItemException,
184             com.liferay.portal.SystemException {
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.NoSuchPortletItemException,
194             com.liferay.portal.SystemException {
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<Object> findWithDynamicQuery(
207         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
208         throws com.liferay.portal.SystemException {
209         return getPersistence().findWithDynamicQuery(dynamicQuery);
210     }
211 
212     public static java.util.List<Object> findWithDynamicQuery(
213         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
214         int end) throws com.liferay.portal.SystemException {
215         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
216     }
217 
218     public static java.util.List<com.liferay.portal.model.PortletItem> findAll()
219         throws com.liferay.portal.SystemException {
220         return getPersistence().findAll();
221     }
222 
223     public static java.util.List<com.liferay.portal.model.PortletItem> findAll(
224         int start, int end) throws com.liferay.portal.SystemException {
225         return getPersistence().findAll(start, end);
226     }
227 
228     public static java.util.List<com.liferay.portal.model.PortletItem> findAll(
229         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
230         throws com.liferay.portal.SystemException {
231         return getPersistence().findAll(start, end, obc);
232     }
233 
234     public static void removeByG_C(long groupId, long classNameId)
235         throws com.liferay.portal.SystemException {
236         getPersistence().removeByG_C(groupId, classNameId);
237     }
238 
239     public static void removeByG_P_C(long groupId, java.lang.String portletId,
240         long classNameId) throws com.liferay.portal.SystemException {
241         getPersistence().removeByG_P_C(groupId, portletId, classNameId);
242     }
243 
244     public static void removeByG_N_P_C(long groupId, java.lang.String name,
245         java.lang.String portletId, long classNameId)
246         throws com.liferay.portal.NoSuchPortletItemException,
247             com.liferay.portal.SystemException {
248         getPersistence().removeByG_N_P_C(groupId, name, portletId, classNameId);
249     }
250 
251     public static void removeAll() throws com.liferay.portal.SystemException {
252         getPersistence().removeAll();
253     }
254 
255     public static int countByG_C(long groupId, long classNameId)
256         throws com.liferay.portal.SystemException {
257         return getPersistence().countByG_C(groupId, classNameId);
258     }
259 
260     public static int countByG_P_C(long groupId, java.lang.String portletId,
261         long classNameId) throws com.liferay.portal.SystemException {
262         return getPersistence().countByG_P_C(groupId, portletId, classNameId);
263     }
264 
265     public static int countByG_N_P_C(long groupId, java.lang.String name,
266         java.lang.String portletId, long classNameId)
267         throws com.liferay.portal.SystemException {
268         return getPersistence()
269                    .countByG_N_P_C(groupId, name, portletId, classNameId);
270     }
271 
272     public static int countAll() throws com.liferay.portal.SystemException {
273         return getPersistence().countAll();
274     }
275 
276     public static PortletItemPersistence getPersistence() {
277         return _persistence;
278     }
279 
280     public void setPersistence(PortletItemPersistence persistence) {
281         _persistence = persistence;
282     }
283 
284     private static PortletItemPersistence _persistence;
285 }