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