001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.Subscription;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the subscription service. This utility wraps {@link SubscriptionPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see SubscriptionPersistence
036     * @see SubscriptionPersistenceImpl
037     * @generated
038     */
039    public class SubscriptionUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(Subscription subscription) {
057                    getPersistence().clearCache(subscription);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<Subscription> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<Subscription> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<Subscription> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
098             */
099            public static Subscription update(Subscription subscription, boolean merge)
100                    throws SystemException {
101                    return getPersistence().update(subscription, merge);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
106             */
107            public static Subscription update(Subscription subscription, boolean merge,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(subscription, merge, serviceContext);
110            }
111    
112            /**
113            * Caches the subscription in the entity cache if it is enabled.
114            *
115            * @param subscription the subscription
116            */
117            public static void cacheResult(
118                    com.liferay.portal.model.Subscription subscription) {
119                    getPersistence().cacheResult(subscription);
120            }
121    
122            /**
123            * Caches the subscriptions in the entity cache if it is enabled.
124            *
125            * @param subscriptions the subscriptions
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portal.model.Subscription> subscriptions) {
129                    getPersistence().cacheResult(subscriptions);
130            }
131    
132            /**
133            * Creates a new subscription with the primary key. Does not add the subscription to the database.
134            *
135            * @param subscriptionId the primary key for the new subscription
136            * @return the new subscription
137            */
138            public static com.liferay.portal.model.Subscription create(
139                    long subscriptionId) {
140                    return getPersistence().create(subscriptionId);
141            }
142    
143            /**
144            * Removes the subscription with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param subscriptionId the primary key of the subscription
147            * @return the subscription that was removed
148            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portal.model.Subscription remove(
152                    long subscriptionId)
153                    throws com.liferay.portal.NoSuchSubscriptionException,
154                            com.liferay.portal.kernel.exception.SystemException {
155                    return getPersistence().remove(subscriptionId);
156            }
157    
158            public static com.liferay.portal.model.Subscription updateImpl(
159                    com.liferay.portal.model.Subscription subscription, boolean merge)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence().updateImpl(subscription, merge);
162            }
163    
164            /**
165            * Returns the subscription with the primary key or throws a {@link com.liferay.portal.NoSuchSubscriptionException} if it could not be found.
166            *
167            * @param subscriptionId the primary key of the subscription
168            * @return the subscription
169            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public static com.liferay.portal.model.Subscription findByPrimaryKey(
173                    long subscriptionId)
174                    throws com.liferay.portal.NoSuchSubscriptionException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getPersistence().findByPrimaryKey(subscriptionId);
177            }
178    
179            /**
180            * Returns the subscription with the primary key or returns <code>null</code> if it could not be found.
181            *
182            * @param subscriptionId the primary key of the subscription
183            * @return the subscription, or <code>null</code> if a subscription with the primary key could not be found
184            * @throws SystemException if a system exception occurred
185            */
186            public static com.liferay.portal.model.Subscription fetchByPrimaryKey(
187                    long subscriptionId)
188                    throws com.liferay.portal.kernel.exception.SystemException {
189                    return getPersistence().fetchByPrimaryKey(subscriptionId);
190            }
191    
192            /**
193            * Returns all the subscriptions where userId = &#63;.
194            *
195            * @param userId the user ID
196            * @return the matching subscriptions
197            * @throws SystemException if a system exception occurred
198            */
199            public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
200                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
201                    return getPersistence().findByUserId(userId);
202            }
203    
204            /**
205            * Returns a range of all the subscriptions where userId = &#63;.
206            *
207            * <p>
208            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
209            * </p>
210            *
211            * @param userId the user ID
212            * @param start the lower bound of the range of subscriptions
213            * @param end the upper bound of the range of subscriptions (not inclusive)
214            * @return the range of matching subscriptions
215            * @throws SystemException if a system exception occurred
216            */
217            public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
218                    long userId, int start, int end)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getPersistence().findByUserId(userId, start, end);
221            }
222    
223            /**
224            * Returns an ordered range of all the subscriptions where userId = &#63;.
225            *
226            * <p>
227            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
228            * </p>
229            *
230            * @param userId the user ID
231            * @param start the lower bound of the range of subscriptions
232            * @param end the upper bound of the range of subscriptions (not inclusive)
233            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
234            * @return the ordered range of matching subscriptions
235            * @throws SystemException if a system exception occurred
236            */
237            public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
238                    long userId, int start, int end,
239                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
240                    throws com.liferay.portal.kernel.exception.SystemException {
241                    return getPersistence()
242                                       .findByUserId(userId, start, end, orderByComparator);
243            }
244    
245            /**
246            * Returns the first subscription in the ordered set where userId = &#63;.
247            *
248            * @param userId the user ID
249            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
250            * @return the first matching subscription
251            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
252            * @throws SystemException if a system exception occurred
253            */
254            public static com.liferay.portal.model.Subscription findByUserId_First(
255                    long userId,
256                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
257                    throws com.liferay.portal.NoSuchSubscriptionException,
258                            com.liferay.portal.kernel.exception.SystemException {
259                    return getPersistence().findByUserId_First(userId, orderByComparator);
260            }
261    
262            /**
263            * Returns the first subscription in the ordered set where userId = &#63;.
264            *
265            * @param userId the user ID
266            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
267            * @return the first matching subscription, or <code>null</code> if a matching subscription could not be found
268            * @throws SystemException if a system exception occurred
269            */
270            public static com.liferay.portal.model.Subscription fetchByUserId_First(
271                    long userId,
272                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
273                    throws com.liferay.portal.kernel.exception.SystemException {
274                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
275            }
276    
277            /**
278            * Returns the last subscription in the ordered set where userId = &#63;.
279            *
280            * @param userId the user ID
281            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
282            * @return the last matching subscription
283            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
284            * @throws SystemException if a system exception occurred
285            */
286            public static com.liferay.portal.model.Subscription findByUserId_Last(
287                    long userId,
288                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
289                    throws com.liferay.portal.NoSuchSubscriptionException,
290                            com.liferay.portal.kernel.exception.SystemException {
291                    return getPersistence().findByUserId_Last(userId, orderByComparator);
292            }
293    
294            /**
295            * Returns the last subscription in the ordered set where userId = &#63;.
296            *
297            * @param userId the user ID
298            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
299            * @return the last matching subscription, or <code>null</code> if a matching subscription could not be found
300            * @throws SystemException if a system exception occurred
301            */
302            public static com.liferay.portal.model.Subscription fetchByUserId_Last(
303                    long userId,
304                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
305                    throws com.liferay.portal.kernel.exception.SystemException {
306                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
307            }
308    
309            /**
310            * Returns the subscriptions before and after the current subscription in the ordered set where userId = &#63;.
311            *
312            * @param subscriptionId the primary key of the current subscription
313            * @param userId the user ID
314            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
315            * @return the previous, current, and next subscription
316            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public static com.liferay.portal.model.Subscription[] findByUserId_PrevAndNext(
320                    long subscriptionId, long userId,
321                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
322                    throws com.liferay.portal.NoSuchSubscriptionException,
323                            com.liferay.portal.kernel.exception.SystemException {
324                    return getPersistence()
325                                       .findByUserId_PrevAndNext(subscriptionId, userId,
326                            orderByComparator);
327            }
328    
329            /**
330            * Returns all the subscriptions where userId = &#63; and classNameId = &#63;.
331            *
332            * @param userId the user ID
333            * @param classNameId the class name ID
334            * @return the matching subscriptions
335            * @throws SystemException if a system exception occurred
336            */
337            public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
338                    long userId, long classNameId)
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getPersistence().findByU_C(userId, classNameId);
341            }
342    
343            /**
344            * Returns a range of all the subscriptions where userId = &#63; and classNameId = &#63;.
345            *
346            * <p>
347            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
348            * </p>
349            *
350            * @param userId the user ID
351            * @param classNameId the class name ID
352            * @param start the lower bound of the range of subscriptions
353            * @param end the upper bound of the range of subscriptions (not inclusive)
354            * @return the range of matching subscriptions
355            * @throws SystemException if a system exception occurred
356            */
357            public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
358                    long userId, long classNameId, int start, int end)
359                    throws com.liferay.portal.kernel.exception.SystemException {
360                    return getPersistence().findByU_C(userId, classNameId, start, end);
361            }
362    
363            /**
364            * Returns an ordered range of all the subscriptions where userId = &#63; and classNameId = &#63;.
365            *
366            * <p>
367            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
368            * </p>
369            *
370            * @param userId the user ID
371            * @param classNameId the class name ID
372            * @param start the lower bound of the range of subscriptions
373            * @param end the upper bound of the range of subscriptions (not inclusive)
374            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
375            * @return the ordered range of matching subscriptions
376            * @throws SystemException if a system exception occurred
377            */
378            public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
379                    long userId, long classNameId, int start, int end,
380                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    return getPersistence()
383                                       .findByU_C(userId, classNameId, start, end, orderByComparator);
384            }
385    
386            /**
387            * Returns the first subscription in the ordered set where userId = &#63; and classNameId = &#63;.
388            *
389            * @param userId the user ID
390            * @param classNameId the class name ID
391            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
392            * @return the first matching subscription
393            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
394            * @throws SystemException if a system exception occurred
395            */
396            public static com.liferay.portal.model.Subscription findByU_C_First(
397                    long userId, long classNameId,
398                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
399                    throws com.liferay.portal.NoSuchSubscriptionException,
400                            com.liferay.portal.kernel.exception.SystemException {
401                    return getPersistence()
402                                       .findByU_C_First(userId, classNameId, orderByComparator);
403            }
404    
405            /**
406            * Returns the first subscription in the ordered set where userId = &#63; and classNameId = &#63;.
407            *
408            * @param userId the user ID
409            * @param classNameId the class name ID
410            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
411            * @return the first matching subscription, or <code>null</code> if a matching subscription could not be found
412            * @throws SystemException if a system exception occurred
413            */
414            public static com.liferay.portal.model.Subscription fetchByU_C_First(
415                    long userId, long classNameId,
416                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
417                    throws com.liferay.portal.kernel.exception.SystemException {
418                    return getPersistence()
419                                       .fetchByU_C_First(userId, classNameId, orderByComparator);
420            }
421    
422            /**
423            * Returns the last subscription in the ordered set where userId = &#63; and classNameId = &#63;.
424            *
425            * @param userId the user ID
426            * @param classNameId the class name ID
427            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
428            * @return the last matching subscription
429            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
430            * @throws SystemException if a system exception occurred
431            */
432            public static com.liferay.portal.model.Subscription findByU_C_Last(
433                    long userId, long classNameId,
434                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
435                    throws com.liferay.portal.NoSuchSubscriptionException,
436                            com.liferay.portal.kernel.exception.SystemException {
437                    return getPersistence()
438                                       .findByU_C_Last(userId, classNameId, orderByComparator);
439            }
440    
441            /**
442            * Returns the last subscription in the ordered set where userId = &#63; and classNameId = &#63;.
443            *
444            * @param userId the user ID
445            * @param classNameId the class name ID
446            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
447            * @return the last matching subscription, or <code>null</code> if a matching subscription could not be found
448            * @throws SystemException if a system exception occurred
449            */
450            public static com.liferay.portal.model.Subscription fetchByU_C_Last(
451                    long userId, long classNameId,
452                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
453                    throws com.liferay.portal.kernel.exception.SystemException {
454                    return getPersistence()
455                                       .fetchByU_C_Last(userId, classNameId, orderByComparator);
456            }
457    
458            /**
459            * Returns the subscriptions before and after the current subscription in the ordered set where userId = &#63; and classNameId = &#63;.
460            *
461            * @param subscriptionId the primary key of the current subscription
462            * @param userId the user ID
463            * @param classNameId the class name ID
464            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
465            * @return the previous, current, and next subscription
466            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
467            * @throws SystemException if a system exception occurred
468            */
469            public static com.liferay.portal.model.Subscription[] findByU_C_PrevAndNext(
470                    long subscriptionId, long userId, long classNameId,
471                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
472                    throws com.liferay.portal.NoSuchSubscriptionException,
473                            com.liferay.portal.kernel.exception.SystemException {
474                    return getPersistence()
475                                       .findByU_C_PrevAndNext(subscriptionId, userId, classNameId,
476                            orderByComparator);
477            }
478    
479            /**
480            * Returns all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
481            *
482            * @param companyId the company ID
483            * @param classNameId the class name ID
484            * @param classPK the class p k
485            * @return the matching subscriptions
486            * @throws SystemException if a system exception occurred
487            */
488            public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
489                    long companyId, long classNameId, long classPK)
490                    throws com.liferay.portal.kernel.exception.SystemException {
491                    return getPersistence().findByC_C_C(companyId, classNameId, classPK);
492            }
493    
494            /**
495            * Returns a range of all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
496            *
497            * <p>
498            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
499            * </p>
500            *
501            * @param companyId the company ID
502            * @param classNameId the class name ID
503            * @param classPK the class p k
504            * @param start the lower bound of the range of subscriptions
505            * @param end the upper bound of the range of subscriptions (not inclusive)
506            * @return the range of matching subscriptions
507            * @throws SystemException if a system exception occurred
508            */
509            public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
510                    long companyId, long classNameId, long classPK, int start, int end)
511                    throws com.liferay.portal.kernel.exception.SystemException {
512                    return getPersistence()
513                                       .findByC_C_C(companyId, classNameId, classPK, start, end);
514            }
515    
516            /**
517            * Returns an ordered range of all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
518            *
519            * <p>
520            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
521            * </p>
522            *
523            * @param companyId the company ID
524            * @param classNameId the class name ID
525            * @param classPK the class p k
526            * @param start the lower bound of the range of subscriptions
527            * @param end the upper bound of the range of subscriptions (not inclusive)
528            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
529            * @return the ordered range of matching subscriptions
530            * @throws SystemException if a system exception occurred
531            */
532            public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
533                    long companyId, long classNameId, long classPK, int start, int end,
534                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
535                    throws com.liferay.portal.kernel.exception.SystemException {
536                    return getPersistence()
537                                       .findByC_C_C(companyId, classNameId, classPK, start, end,
538                            orderByComparator);
539            }
540    
541            /**
542            * Returns the first subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
543            *
544            * @param companyId the company ID
545            * @param classNameId the class name ID
546            * @param classPK the class p k
547            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
548            * @return the first matching subscription
549            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
550            * @throws SystemException if a system exception occurred
551            */
552            public static com.liferay.portal.model.Subscription findByC_C_C_First(
553                    long companyId, long classNameId, long classPK,
554                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
555                    throws com.liferay.portal.NoSuchSubscriptionException,
556                            com.liferay.portal.kernel.exception.SystemException {
557                    return getPersistence()
558                                       .findByC_C_C_First(companyId, classNameId, classPK,
559                            orderByComparator);
560            }
561    
562            /**
563            * Returns the first subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
564            *
565            * @param companyId the company ID
566            * @param classNameId the class name ID
567            * @param classPK the class p k
568            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
569            * @return the first matching subscription, or <code>null</code> if a matching subscription could not be found
570            * @throws SystemException if a system exception occurred
571            */
572            public static com.liferay.portal.model.Subscription fetchByC_C_C_First(
573                    long companyId, long classNameId, long classPK,
574                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
575                    throws com.liferay.portal.kernel.exception.SystemException {
576                    return getPersistence()
577                                       .fetchByC_C_C_First(companyId, classNameId, classPK,
578                            orderByComparator);
579            }
580    
581            /**
582            * Returns the last subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
583            *
584            * @param companyId the company ID
585            * @param classNameId the class name ID
586            * @param classPK the class p k
587            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
588            * @return the last matching subscription
589            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
590            * @throws SystemException if a system exception occurred
591            */
592            public static com.liferay.portal.model.Subscription findByC_C_C_Last(
593                    long companyId, long classNameId, long classPK,
594                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
595                    throws com.liferay.portal.NoSuchSubscriptionException,
596                            com.liferay.portal.kernel.exception.SystemException {
597                    return getPersistence()
598                                       .findByC_C_C_Last(companyId, classNameId, classPK,
599                            orderByComparator);
600            }
601    
602            /**
603            * Returns the last subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
604            *
605            * @param companyId the company ID
606            * @param classNameId the class name ID
607            * @param classPK the class p k
608            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
609            * @return the last matching subscription, or <code>null</code> if a matching subscription could not be found
610            * @throws SystemException if a system exception occurred
611            */
612            public static com.liferay.portal.model.Subscription fetchByC_C_C_Last(
613                    long companyId, long classNameId, long classPK,
614                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
615                    throws com.liferay.portal.kernel.exception.SystemException {
616                    return getPersistence()
617                                       .fetchByC_C_C_Last(companyId, classNameId, classPK,
618                            orderByComparator);
619            }
620    
621            /**
622            * Returns the subscriptions before and after the current subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
623            *
624            * @param subscriptionId the primary key of the current subscription
625            * @param companyId the company ID
626            * @param classNameId the class name ID
627            * @param classPK the class p k
628            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
629            * @return the previous, current, and next subscription
630            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
631            * @throws SystemException if a system exception occurred
632            */
633            public static com.liferay.portal.model.Subscription[] findByC_C_C_PrevAndNext(
634                    long subscriptionId, long companyId, long classNameId, long classPK,
635                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
636                    throws com.liferay.portal.NoSuchSubscriptionException,
637                            com.liferay.portal.kernel.exception.SystemException {
638                    return getPersistence()
639                                       .findByC_C_C_PrevAndNext(subscriptionId, companyId,
640                            classNameId, classPK, orderByComparator);
641            }
642    
643            /**
644            * Returns the subscription where companyId = &#63; and userId = &#63; and classNameId = &#63; and classPK = &#63; or throws a {@link com.liferay.portal.NoSuchSubscriptionException} if it could not be found.
645            *
646            * @param companyId the company ID
647            * @param userId the user ID
648            * @param classNameId the class name ID
649            * @param classPK the class p k
650            * @return the matching subscription
651            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
652            * @throws SystemException if a system exception occurred
653            */
654            public static com.liferay.portal.model.Subscription findByC_U_C_C(
655                    long companyId, long userId, long classNameId, long classPK)
656                    throws com.liferay.portal.NoSuchSubscriptionException,
657                            com.liferay.portal.kernel.exception.SystemException {
658                    return getPersistence()
659                                       .findByC_U_C_C(companyId, userId, classNameId, classPK);
660            }
661    
662            /**
663            * Returns the subscription where companyId = &#63; and userId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
664            *
665            * @param companyId the company ID
666            * @param userId the user ID
667            * @param classNameId the class name ID
668            * @param classPK the class p k
669            * @return the matching subscription, or <code>null</code> if a matching subscription could not be found
670            * @throws SystemException if a system exception occurred
671            */
672            public static com.liferay.portal.model.Subscription fetchByC_U_C_C(
673                    long companyId, long userId, long classNameId, long classPK)
674                    throws com.liferay.portal.kernel.exception.SystemException {
675                    return getPersistence()
676                                       .fetchByC_U_C_C(companyId, userId, classNameId, classPK);
677            }
678    
679            /**
680            * Returns the subscription where companyId = &#63; and userId = &#63; and classNameId = &#63; and classPK = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
681            *
682            * @param companyId the company ID
683            * @param userId the user ID
684            * @param classNameId the class name ID
685            * @param classPK the class p k
686            * @param retrieveFromCache whether to use the finder cache
687            * @return the matching subscription, or <code>null</code> if a matching subscription could not be found
688            * @throws SystemException if a system exception occurred
689            */
690            public static com.liferay.portal.model.Subscription fetchByC_U_C_C(
691                    long companyId, long userId, long classNameId, long classPK,
692                    boolean retrieveFromCache)
693                    throws com.liferay.portal.kernel.exception.SystemException {
694                    return getPersistence()
695                                       .fetchByC_U_C_C(companyId, userId, classNameId, classPK,
696                            retrieveFromCache);
697            }
698    
699            /**
700            * Returns all the subscriptions.
701            *
702            * @return the subscriptions
703            * @throws SystemException if a system exception occurred
704            */
705            public static java.util.List<com.liferay.portal.model.Subscription> findAll()
706                    throws com.liferay.portal.kernel.exception.SystemException {
707                    return getPersistence().findAll();
708            }
709    
710            /**
711            * Returns a range of all the subscriptions.
712            *
713            * <p>
714            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
715            * </p>
716            *
717            * @param start the lower bound of the range of subscriptions
718            * @param end the upper bound of the range of subscriptions (not inclusive)
719            * @return the range of subscriptions
720            * @throws SystemException if a system exception occurred
721            */
722            public static java.util.List<com.liferay.portal.model.Subscription> findAll(
723                    int start, int end)
724                    throws com.liferay.portal.kernel.exception.SystemException {
725                    return getPersistence().findAll(start, end);
726            }
727    
728            /**
729            * Returns an ordered range of all the subscriptions.
730            *
731            * <p>
732            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
733            * </p>
734            *
735            * @param start the lower bound of the range of subscriptions
736            * @param end the upper bound of the range of subscriptions (not inclusive)
737            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
738            * @return the ordered range of subscriptions
739            * @throws SystemException if a system exception occurred
740            */
741            public static java.util.List<com.liferay.portal.model.Subscription> findAll(
742                    int start, int end,
743                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
744                    throws com.liferay.portal.kernel.exception.SystemException {
745                    return getPersistence().findAll(start, end, orderByComparator);
746            }
747    
748            /**
749            * Removes all the subscriptions where userId = &#63; from the database.
750            *
751            * @param userId the user ID
752            * @throws SystemException if a system exception occurred
753            */
754            public static void removeByUserId(long userId)
755                    throws com.liferay.portal.kernel.exception.SystemException {
756                    getPersistence().removeByUserId(userId);
757            }
758    
759            /**
760            * Removes all the subscriptions where userId = &#63; and classNameId = &#63; from the database.
761            *
762            * @param userId the user ID
763            * @param classNameId the class name ID
764            * @throws SystemException if a system exception occurred
765            */
766            public static void removeByU_C(long userId, long classNameId)
767                    throws com.liferay.portal.kernel.exception.SystemException {
768                    getPersistence().removeByU_C(userId, classNameId);
769            }
770    
771            /**
772            * Removes all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
773            *
774            * @param companyId the company ID
775            * @param classNameId the class name ID
776            * @param classPK the class p k
777            * @throws SystemException if a system exception occurred
778            */
779            public static void removeByC_C_C(long companyId, long classNameId,
780                    long classPK)
781                    throws com.liferay.portal.kernel.exception.SystemException {
782                    getPersistence().removeByC_C_C(companyId, classNameId, classPK);
783            }
784    
785            /**
786            * Removes the subscription where companyId = &#63; and userId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
787            *
788            * @param companyId the company ID
789            * @param userId the user ID
790            * @param classNameId the class name ID
791            * @param classPK the class p k
792            * @return the subscription that was removed
793            * @throws SystemException if a system exception occurred
794            */
795            public static com.liferay.portal.model.Subscription removeByC_U_C_C(
796                    long companyId, long userId, long classNameId, long classPK)
797                    throws com.liferay.portal.NoSuchSubscriptionException,
798                            com.liferay.portal.kernel.exception.SystemException {
799                    return getPersistence()
800                                       .removeByC_U_C_C(companyId, userId, classNameId, classPK);
801            }
802    
803            /**
804            * Removes all the subscriptions from the database.
805            *
806            * @throws SystemException if a system exception occurred
807            */
808            public static void removeAll()
809                    throws com.liferay.portal.kernel.exception.SystemException {
810                    getPersistence().removeAll();
811            }
812    
813            /**
814            * Returns the number of subscriptions where userId = &#63;.
815            *
816            * @param userId the user ID
817            * @return the number of matching subscriptions
818            * @throws SystemException if a system exception occurred
819            */
820            public static int countByUserId(long userId)
821                    throws com.liferay.portal.kernel.exception.SystemException {
822                    return getPersistence().countByUserId(userId);
823            }
824    
825            /**
826            * Returns the number of subscriptions where userId = &#63; and classNameId = &#63;.
827            *
828            * @param userId the user ID
829            * @param classNameId the class name ID
830            * @return the number of matching subscriptions
831            * @throws SystemException if a system exception occurred
832            */
833            public static int countByU_C(long userId, long classNameId)
834                    throws com.liferay.portal.kernel.exception.SystemException {
835                    return getPersistence().countByU_C(userId, classNameId);
836            }
837    
838            /**
839            * Returns the number of subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
840            *
841            * @param companyId the company ID
842            * @param classNameId the class name ID
843            * @param classPK the class p k
844            * @return the number of matching subscriptions
845            * @throws SystemException if a system exception occurred
846            */
847            public static int countByC_C_C(long companyId, long classNameId,
848                    long classPK)
849                    throws com.liferay.portal.kernel.exception.SystemException {
850                    return getPersistence().countByC_C_C(companyId, classNameId, classPK);
851            }
852    
853            /**
854            * Returns the number of subscriptions where companyId = &#63; and userId = &#63; and classNameId = &#63; and classPK = &#63;.
855            *
856            * @param companyId the company ID
857            * @param userId the user ID
858            * @param classNameId the class name ID
859            * @param classPK the class p k
860            * @return the number of matching subscriptions
861            * @throws SystemException if a system exception occurred
862            */
863            public static int countByC_U_C_C(long companyId, long userId,
864                    long classNameId, long classPK)
865                    throws com.liferay.portal.kernel.exception.SystemException {
866                    return getPersistence()
867                                       .countByC_U_C_C(companyId, userId, classNameId, classPK);
868            }
869    
870            /**
871            * Returns the number of subscriptions.
872            *
873            * @return the number of subscriptions
874            * @throws SystemException if a system exception occurred
875            */
876            public static int countAll()
877                    throws com.liferay.portal.kernel.exception.SystemException {
878                    return getPersistence().countAll();
879            }
880    
881            public static SubscriptionPersistence getPersistence() {
882                    if (_persistence == null) {
883                            _persistence = (SubscriptionPersistence)PortalBeanLocatorUtil.locate(SubscriptionPersistence.class.getName());
884    
885                            ReferenceRegistry.registerReference(SubscriptionUtil.class,
886                                    "_persistence");
887                    }
888    
889                    return _persistence;
890            }
891    
892            /**
893             * @deprecated
894             */
895            public void setPersistence(SubscriptionPersistence persistence) {
896            }
897    
898            private static SubscriptionPersistence _persistence;
899    }