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="SubscriptionUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class SubscriptionUtil {
29      public static void cacheResult(
30          com.liferay.portal.model.Subscription subscription) {
31          getPersistence().cacheResult(subscription);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portal.model.Subscription> subscriptions) {
36          getPersistence().cacheResult(subscriptions);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portal.model.Subscription create(
44          long subscriptionId) {
45          return getPersistence().create(subscriptionId);
46      }
47  
48      public static com.liferay.portal.model.Subscription remove(
49          long subscriptionId)
50          throws com.liferay.portal.NoSuchSubscriptionException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(subscriptionId);
53      }
54  
55      public static com.liferay.portal.model.Subscription remove(
56          com.liferay.portal.model.Subscription subscription)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(subscription);
59      }
60  
61      /**
62       * @deprecated Use <code>update(Subscription subscription, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.Subscription update(
65          com.liferay.portal.model.Subscription subscription)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(subscription);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        subscription the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when subscription is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.Subscription update(
84          com.liferay.portal.model.Subscription subscription, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(subscription, merge);
87      }
88  
89      public static com.liferay.portal.model.Subscription updateImpl(
90          com.liferay.portal.model.Subscription subscription, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(subscription, merge);
93      }
94  
95      public static com.liferay.portal.model.Subscription findByPrimaryKey(
96          long subscriptionId)
97          throws com.liferay.portal.NoSuchSubscriptionException,
98              com.liferay.portal.SystemException {
99          return getPersistence().findByPrimaryKey(subscriptionId);
100     }
101 
102     public static com.liferay.portal.model.Subscription fetchByPrimaryKey(
103         long subscriptionId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(subscriptionId);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
108         long userId) throws com.liferay.portal.SystemException {
109         return getPersistence().findByUserId(userId);
110     }
111 
112     public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
113         long userId, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByUserId(userId, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
119         long userId, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByUserId(userId, start, end, obc);
123     }
124 
125     public static com.liferay.portal.model.Subscription findByUserId_First(
126         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.NoSuchSubscriptionException,
128             com.liferay.portal.SystemException {
129         return getPersistence().findByUserId_First(userId, obc);
130     }
131 
132     public static com.liferay.portal.model.Subscription findByUserId_Last(
133         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchSubscriptionException,
135             com.liferay.portal.SystemException {
136         return getPersistence().findByUserId_Last(userId, obc);
137     }
138 
139     public static com.liferay.portal.model.Subscription[] findByUserId_PrevAndNext(
140         long subscriptionId, long userId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.NoSuchSubscriptionException,
143             com.liferay.portal.SystemException {
144         return getPersistence()
145                    .findByUserId_PrevAndNext(subscriptionId, userId, obc);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
149         long userId, long classNameId)
150         throws com.liferay.portal.SystemException {
151         return getPersistence().findByU_C(userId, classNameId);
152     }
153 
154     public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
155         long userId, long classNameId, int start, int end)
156         throws com.liferay.portal.SystemException {
157         return getPersistence().findByU_C(userId, classNameId, start, end);
158     }
159 
160     public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
161         long userId, long classNameId, int start, int end,
162         com.liferay.portal.kernel.util.OrderByComparator obc)
163         throws com.liferay.portal.SystemException {
164         return getPersistence().findByU_C(userId, classNameId, start, end, obc);
165     }
166 
167     public static com.liferay.portal.model.Subscription findByU_C_First(
168         long userId, long classNameId,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.NoSuchSubscriptionException,
171             com.liferay.portal.SystemException {
172         return getPersistence().findByU_C_First(userId, classNameId, obc);
173     }
174 
175     public static com.liferay.portal.model.Subscription findByU_C_Last(
176         long userId, long classNameId,
177         com.liferay.portal.kernel.util.OrderByComparator obc)
178         throws com.liferay.portal.NoSuchSubscriptionException,
179             com.liferay.portal.SystemException {
180         return getPersistence().findByU_C_Last(userId, classNameId, obc);
181     }
182 
183     public static com.liferay.portal.model.Subscription[] findByU_C_PrevAndNext(
184         long subscriptionId, long userId, long classNameId,
185         com.liferay.portal.kernel.util.OrderByComparator obc)
186         throws com.liferay.portal.NoSuchSubscriptionException,
187             com.liferay.portal.SystemException {
188         return getPersistence()
189                    .findByU_C_PrevAndNext(subscriptionId, userId, classNameId,
190             obc);
191     }
192 
193     public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
194         long companyId, long classNameId, long classPK)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
197     }
198 
199     public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
200         long companyId, long classNameId, long classPK, int start, int end)
201         throws com.liferay.portal.SystemException {
202         return getPersistence()
203                    .findByC_C_C(companyId, classNameId, classPK, start, end);
204     }
205 
206     public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
207         long companyId, long classNameId, long classPK, int start, int end,
208         com.liferay.portal.kernel.util.OrderByComparator obc)
209         throws com.liferay.portal.SystemException {
210         return getPersistence()
211                    .findByC_C_C(companyId, classNameId, classPK, start, end, obc);
212     }
213 
214     public static com.liferay.portal.model.Subscription findByC_C_C_First(
215         long companyId, long classNameId, long classPK,
216         com.liferay.portal.kernel.util.OrderByComparator obc)
217         throws com.liferay.portal.NoSuchSubscriptionException,
218             com.liferay.portal.SystemException {
219         return getPersistence()
220                    .findByC_C_C_First(companyId, classNameId, classPK, obc);
221     }
222 
223     public static com.liferay.portal.model.Subscription findByC_C_C_Last(
224         long companyId, long classNameId, long classPK,
225         com.liferay.portal.kernel.util.OrderByComparator obc)
226         throws com.liferay.portal.NoSuchSubscriptionException,
227             com.liferay.portal.SystemException {
228         return getPersistence()
229                    .findByC_C_C_Last(companyId, classNameId, classPK, obc);
230     }
231 
232     public static com.liferay.portal.model.Subscription[] findByC_C_C_PrevAndNext(
233         long subscriptionId, long companyId, long classNameId, long classPK,
234         com.liferay.portal.kernel.util.OrderByComparator obc)
235         throws com.liferay.portal.NoSuchSubscriptionException,
236             com.liferay.portal.SystemException {
237         return getPersistence()
238                    .findByC_C_C_PrevAndNext(subscriptionId, companyId,
239             classNameId, classPK, obc);
240     }
241 
242     public static com.liferay.portal.model.Subscription findByC_U_C_C(
243         long companyId, long userId, long classNameId, long classPK)
244         throws com.liferay.portal.NoSuchSubscriptionException,
245             com.liferay.portal.SystemException {
246         return getPersistence()
247                    .findByC_U_C_C(companyId, userId, classNameId, classPK);
248     }
249 
250     public static com.liferay.portal.model.Subscription fetchByC_U_C_C(
251         long companyId, long userId, long classNameId, long classPK)
252         throws com.liferay.portal.SystemException {
253         return getPersistence()
254                    .fetchByC_U_C_C(companyId, userId, classNameId, classPK);
255     }
256 
257     public static com.liferay.portal.model.Subscription fetchByC_U_C_C(
258         long companyId, long userId, long classNameId, long classPK,
259         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
260         return getPersistence()
261                    .fetchByC_U_C_C(companyId, userId, classNameId, classPK,
262             retrieveFromCache);
263     }
264 
265     public static java.util.List<Object> findWithDynamicQuery(
266         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
267         throws com.liferay.portal.SystemException {
268         return getPersistence().findWithDynamicQuery(dynamicQuery);
269     }
270 
271     public static java.util.List<Object> findWithDynamicQuery(
272         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
273         int end) throws com.liferay.portal.SystemException {
274         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
275     }
276 
277     public static java.util.List<com.liferay.portal.model.Subscription> findAll()
278         throws com.liferay.portal.SystemException {
279         return getPersistence().findAll();
280     }
281 
282     public static java.util.List<com.liferay.portal.model.Subscription> findAll(
283         int start, int end) throws com.liferay.portal.SystemException {
284         return getPersistence().findAll(start, end);
285     }
286 
287     public static java.util.List<com.liferay.portal.model.Subscription> findAll(
288         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
289         throws com.liferay.portal.SystemException {
290         return getPersistence().findAll(start, end, obc);
291     }
292 
293     public static void removeByUserId(long userId)
294         throws com.liferay.portal.SystemException {
295         getPersistence().removeByUserId(userId);
296     }
297 
298     public static void removeByU_C(long userId, long classNameId)
299         throws com.liferay.portal.SystemException {
300         getPersistence().removeByU_C(userId, classNameId);
301     }
302 
303     public static void removeByC_C_C(long companyId, long classNameId,
304         long classPK) throws com.liferay.portal.SystemException {
305         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
306     }
307 
308     public static void removeByC_U_C_C(long companyId, long userId,
309         long classNameId, long classPK)
310         throws com.liferay.portal.NoSuchSubscriptionException,
311             com.liferay.portal.SystemException {
312         getPersistence().removeByC_U_C_C(companyId, userId, classNameId, classPK);
313     }
314 
315     public static void removeAll() throws com.liferay.portal.SystemException {
316         getPersistence().removeAll();
317     }
318 
319     public static int countByUserId(long userId)
320         throws com.liferay.portal.SystemException {
321         return getPersistence().countByUserId(userId);
322     }
323 
324     public static int countByU_C(long userId, long classNameId)
325         throws com.liferay.portal.SystemException {
326         return getPersistence().countByU_C(userId, classNameId);
327     }
328 
329     public static int countByC_C_C(long companyId, long classNameId,
330         long classPK) throws com.liferay.portal.SystemException {
331         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
332     }
333 
334     public static int countByC_U_C_C(long companyId, long userId,
335         long classNameId, long classPK)
336         throws com.liferay.portal.SystemException {
337         return getPersistence()
338                    .countByC_U_C_C(companyId, userId, classNameId, classPK);
339     }
340 
341     public static int countAll() throws com.liferay.portal.SystemException {
342         return getPersistence().countAll();
343     }
344 
345     public static SubscriptionPersistence getPersistence() {
346         return _persistence;
347     }
348 
349     public void setPersistence(SubscriptionPersistence persistence) {
350         _persistence = persistence;
351     }
352 
353     private static SubscriptionPersistence _persistence;
354 }