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