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