001    /**
002     * Copyright (c) 2000-2012 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)
098             */
099            public static Subscription update(Subscription subscription)
100                    throws SystemException {
101                    return getPersistence().update(subscription);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static Subscription update(Subscription subscription,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(subscription, serviceContext);
110            }
111    
112            /**
113            * Returns all the subscriptions where userId = &#63;.
114            *
115            * @param userId the user ID
116            * @return the matching subscriptions
117            * @throws SystemException if a system exception occurred
118            */
119            public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
120                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
121                    return getPersistence().findByUserId(userId);
122            }
123    
124            /**
125            * Returns a range of all the subscriptions where userId = &#63;.
126            *
127            * <p>
128            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
129            * </p>
130            *
131            * @param userId the user ID
132            * @param start the lower bound of the range of subscriptions
133            * @param end the upper bound of the range of subscriptions (not inclusive)
134            * @return the range of matching subscriptions
135            * @throws SystemException if a system exception occurred
136            */
137            public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
138                    long userId, int start, int end)
139                    throws com.liferay.portal.kernel.exception.SystemException {
140                    return getPersistence().findByUserId(userId, start, end);
141            }
142    
143            /**
144            * Returns an ordered range of all the subscriptions where userId = &#63;.
145            *
146            * <p>
147            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
148            * </p>
149            *
150            * @param userId the user ID
151            * @param start the lower bound of the range of subscriptions
152            * @param end the upper bound of the range of subscriptions (not inclusive)
153            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
154            * @return the ordered range of matching subscriptions
155            * @throws SystemException if a system exception occurred
156            */
157            public static java.util.List<com.liferay.portal.model.Subscription> findByUserId(
158                    long userId, int start, int end,
159                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence()
162                                       .findByUserId(userId, start, end, orderByComparator);
163            }
164    
165            /**
166            * Returns the first subscription in the ordered set where userId = &#63;.
167            *
168            * @param userId the user ID
169            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
170            * @return the first matching subscription
171            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portal.model.Subscription findByUserId_First(
175                    long userId,
176                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
177                    throws com.liferay.portal.NoSuchSubscriptionException,
178                            com.liferay.portal.kernel.exception.SystemException {
179                    return getPersistence().findByUserId_First(userId, orderByComparator);
180            }
181    
182            /**
183            * Returns the first subscription in the ordered set where userId = &#63;.
184            *
185            * @param userId the user ID
186            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
187            * @return the first matching subscription, or <code>null</code> if a matching subscription could not be found
188            * @throws SystemException if a system exception occurred
189            */
190            public static com.liferay.portal.model.Subscription fetchByUserId_First(
191                    long userId,
192                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
195            }
196    
197            /**
198            * Returns the last subscription in the ordered set where userId = &#63;.
199            *
200            * @param userId the user ID
201            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
202            * @return the last matching subscription
203            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
204            * @throws SystemException if a system exception occurred
205            */
206            public static com.liferay.portal.model.Subscription findByUserId_Last(
207                    long userId,
208                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
209                    throws com.liferay.portal.NoSuchSubscriptionException,
210                            com.liferay.portal.kernel.exception.SystemException {
211                    return getPersistence().findByUserId_Last(userId, orderByComparator);
212            }
213    
214            /**
215            * Returns the last subscription in the ordered set where userId = &#63;.
216            *
217            * @param userId the user ID
218            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
219            * @return the last matching subscription, or <code>null</code> if a matching subscription could not be found
220            * @throws SystemException if a system exception occurred
221            */
222            public static com.liferay.portal.model.Subscription fetchByUserId_Last(
223                    long userId,
224                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
227            }
228    
229            /**
230            * Returns the subscriptions before and after the current subscription in the ordered set where userId = &#63;.
231            *
232            * @param subscriptionId the primary key of the current subscription
233            * @param userId the user ID
234            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
235            * @return the previous, current, and next subscription
236            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
237            * @throws SystemException if a system exception occurred
238            */
239            public static com.liferay.portal.model.Subscription[] findByUserId_PrevAndNext(
240                    long subscriptionId, long userId,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.NoSuchSubscriptionException,
243                            com.liferay.portal.kernel.exception.SystemException {
244                    return getPersistence()
245                                       .findByUserId_PrevAndNext(subscriptionId, userId,
246                            orderByComparator);
247            }
248    
249            /**
250            * Removes all the subscriptions where userId = &#63; from the database.
251            *
252            * @param userId the user ID
253            * @throws SystemException if a system exception occurred
254            */
255            public static void removeByUserId(long userId)
256                    throws com.liferay.portal.kernel.exception.SystemException {
257                    getPersistence().removeByUserId(userId);
258            }
259    
260            /**
261            * Returns the number of subscriptions where userId = &#63;.
262            *
263            * @param userId the user ID
264            * @return the number of matching subscriptions
265            * @throws SystemException if a system exception occurred
266            */
267            public static int countByUserId(long userId)
268                    throws com.liferay.portal.kernel.exception.SystemException {
269                    return getPersistence().countByUserId(userId);
270            }
271    
272            /**
273            * Returns all the subscriptions where userId = &#63; and classNameId = &#63;.
274            *
275            * @param userId the user ID
276            * @param classNameId the class name ID
277            * @return the matching subscriptions
278            * @throws SystemException if a system exception occurred
279            */
280            public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
281                    long userId, long classNameId)
282                    throws com.liferay.portal.kernel.exception.SystemException {
283                    return getPersistence().findByU_C(userId, classNameId);
284            }
285    
286            /**
287            * Returns a range of all the subscriptions where userId = &#63; and classNameId = &#63;.
288            *
289            * <p>
290            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
291            * </p>
292            *
293            * @param userId the user ID
294            * @param classNameId the class name ID
295            * @param start the lower bound of the range of subscriptions
296            * @param end the upper bound of the range of subscriptions (not inclusive)
297            * @return the range of matching subscriptions
298            * @throws SystemException if a system exception occurred
299            */
300            public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
301                    long userId, long classNameId, int start, int end)
302                    throws com.liferay.portal.kernel.exception.SystemException {
303                    return getPersistence().findByU_C(userId, classNameId, start, end);
304            }
305    
306            /**
307            * Returns an ordered range of all the subscriptions where userId = &#63; and classNameId = &#63;.
308            *
309            * <p>
310            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
311            * </p>
312            *
313            * @param userId the user ID
314            * @param classNameId the class name ID
315            * @param start the lower bound of the range of subscriptions
316            * @param end the upper bound of the range of subscriptions (not inclusive)
317            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
318            * @return the ordered range of matching subscriptions
319            * @throws SystemException if a system exception occurred
320            */
321            public static java.util.List<com.liferay.portal.model.Subscription> findByU_C(
322                    long userId, long classNameId, int start, int end,
323                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
324                    throws com.liferay.portal.kernel.exception.SystemException {
325                    return getPersistence()
326                                       .findByU_C(userId, classNameId, start, end, orderByComparator);
327            }
328    
329            /**
330            * Returns the first subscription in the ordered set where userId = &#63; and classNameId = &#63;.
331            *
332            * @param userId the user ID
333            * @param classNameId the class name ID
334            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
335            * @return the first matching subscription
336            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
337            * @throws SystemException if a system exception occurred
338            */
339            public static com.liferay.portal.model.Subscription findByU_C_First(
340                    long userId, long classNameId,
341                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
342                    throws com.liferay.portal.NoSuchSubscriptionException,
343                            com.liferay.portal.kernel.exception.SystemException {
344                    return getPersistence()
345                                       .findByU_C_First(userId, classNameId, orderByComparator);
346            }
347    
348            /**
349            * Returns the first subscription in the ordered set where userId = &#63; and classNameId = &#63;.
350            *
351            * @param userId the user ID
352            * @param classNameId the class name ID
353            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
354            * @return the first matching subscription, or <code>null</code> if a matching subscription could not be found
355            * @throws SystemException if a system exception occurred
356            */
357            public static com.liferay.portal.model.Subscription fetchByU_C_First(
358                    long userId, long classNameId,
359                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
360                    throws com.liferay.portal.kernel.exception.SystemException {
361                    return getPersistence()
362                                       .fetchByU_C_First(userId, classNameId, orderByComparator);
363            }
364    
365            /**
366            * Returns the last subscription in the ordered set where userId = &#63; and classNameId = &#63;.
367            *
368            * @param userId the user ID
369            * @param classNameId the class name ID
370            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
371            * @return the last matching subscription
372            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
373            * @throws SystemException if a system exception occurred
374            */
375            public static com.liferay.portal.model.Subscription findByU_C_Last(
376                    long userId, long classNameId,
377                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
378                    throws com.liferay.portal.NoSuchSubscriptionException,
379                            com.liferay.portal.kernel.exception.SystemException {
380                    return getPersistence()
381                                       .findByU_C_Last(userId, classNameId, orderByComparator);
382            }
383    
384            /**
385            * Returns the last subscription in the ordered set where userId = &#63; and classNameId = &#63;.
386            *
387            * @param userId the user ID
388            * @param classNameId the class name ID
389            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
390            * @return the last matching subscription, or <code>null</code> if a matching subscription could not be found
391            * @throws SystemException if a system exception occurred
392            */
393            public static com.liferay.portal.model.Subscription fetchByU_C_Last(
394                    long userId, long classNameId,
395                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
396                    throws com.liferay.portal.kernel.exception.SystemException {
397                    return getPersistence()
398                                       .fetchByU_C_Last(userId, classNameId, orderByComparator);
399            }
400    
401            /**
402            * Returns the subscriptions before and after the current subscription in the ordered set where userId = &#63; and classNameId = &#63;.
403            *
404            * @param subscriptionId the primary key of the current subscription
405            * @param userId the user ID
406            * @param classNameId the class name ID
407            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
408            * @return the previous, current, and next subscription
409            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
410            * @throws SystemException if a system exception occurred
411            */
412            public static com.liferay.portal.model.Subscription[] findByU_C_PrevAndNext(
413                    long subscriptionId, long userId, long classNameId,
414                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
415                    throws com.liferay.portal.NoSuchSubscriptionException,
416                            com.liferay.portal.kernel.exception.SystemException {
417                    return getPersistence()
418                                       .findByU_C_PrevAndNext(subscriptionId, userId, classNameId,
419                            orderByComparator);
420            }
421    
422            /**
423            * Removes all the subscriptions where userId = &#63; and classNameId = &#63; from the database.
424            *
425            * @param userId the user ID
426            * @param classNameId the class name ID
427            * @throws SystemException if a system exception occurred
428            */
429            public static void removeByU_C(long userId, long classNameId)
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    getPersistence().removeByU_C(userId, classNameId);
432            }
433    
434            /**
435            * Returns the number of subscriptions where userId = &#63; and classNameId = &#63;.
436            *
437            * @param userId the user ID
438            * @param classNameId the class name ID
439            * @return the number of matching subscriptions
440            * @throws SystemException if a system exception occurred
441            */
442            public static int countByU_C(long userId, long classNameId)
443                    throws com.liferay.portal.kernel.exception.SystemException {
444                    return getPersistence().countByU_C(userId, classNameId);
445            }
446    
447            /**
448            * Returns all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
449            *
450            * @param companyId the company ID
451            * @param classNameId the class name ID
452            * @param classPK the class p k
453            * @return the matching subscriptions
454            * @throws SystemException if a system exception occurred
455            */
456            public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
457                    long companyId, long classNameId, long classPK)
458                    throws com.liferay.portal.kernel.exception.SystemException {
459                    return getPersistence().findByC_C_C(companyId, classNameId, classPK);
460            }
461    
462            /**
463            * Returns a range of all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
464            *
465            * <p>
466            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
467            * </p>
468            *
469            * @param companyId the company ID
470            * @param classNameId the class name ID
471            * @param classPK the class p k
472            * @param start the lower bound of the range of subscriptions
473            * @param end the upper bound of the range of subscriptions (not inclusive)
474            * @return the range of matching subscriptions
475            * @throws SystemException if a system exception occurred
476            */
477            public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
478                    long companyId, long classNameId, long classPK, int start, int end)
479                    throws com.liferay.portal.kernel.exception.SystemException {
480                    return getPersistence()
481                                       .findByC_C_C(companyId, classNameId, classPK, start, end);
482            }
483    
484            /**
485            * Returns an ordered range of all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
486            *
487            * <p>
488            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
489            * </p>
490            *
491            * @param companyId the company ID
492            * @param classNameId the class name ID
493            * @param classPK the class p k
494            * @param start the lower bound of the range of subscriptions
495            * @param end the upper bound of the range of subscriptions (not inclusive)
496            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
497            * @return the ordered range of matching subscriptions
498            * @throws SystemException if a system exception occurred
499            */
500            public static java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
501                    long companyId, long classNameId, long classPK, int start, int end,
502                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
503                    throws com.liferay.portal.kernel.exception.SystemException {
504                    return getPersistence()
505                                       .findByC_C_C(companyId, classNameId, classPK, start, end,
506                            orderByComparator);
507            }
508    
509            /**
510            * Returns the first subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
511            *
512            * @param companyId the company ID
513            * @param classNameId the class name ID
514            * @param classPK the class p k
515            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
516            * @return the first matching subscription
517            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
518            * @throws SystemException if a system exception occurred
519            */
520            public static com.liferay.portal.model.Subscription findByC_C_C_First(
521                    long companyId, long classNameId, long classPK,
522                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
523                    throws com.liferay.portal.NoSuchSubscriptionException,
524                            com.liferay.portal.kernel.exception.SystemException {
525                    return getPersistence()
526                                       .findByC_C_C_First(companyId, classNameId, classPK,
527                            orderByComparator);
528            }
529    
530            /**
531            * Returns the first subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
532            *
533            * @param companyId the company ID
534            * @param classNameId the class name ID
535            * @param classPK the class p k
536            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
537            * @return the first matching subscription, or <code>null</code> if a matching subscription could not be found
538            * @throws SystemException if a system exception occurred
539            */
540            public static com.liferay.portal.model.Subscription fetchByC_C_C_First(
541                    long companyId, long classNameId, long classPK,
542                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
543                    throws com.liferay.portal.kernel.exception.SystemException {
544                    return getPersistence()
545                                       .fetchByC_C_C_First(companyId, classNameId, classPK,
546                            orderByComparator);
547            }
548    
549            /**
550            * Returns the last subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
551            *
552            * @param companyId the company ID
553            * @param classNameId the class name ID
554            * @param classPK the class p k
555            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
556            * @return the last matching subscription
557            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
558            * @throws SystemException if a system exception occurred
559            */
560            public static com.liferay.portal.model.Subscription findByC_C_C_Last(
561                    long companyId, long classNameId, long classPK,
562                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
563                    throws com.liferay.portal.NoSuchSubscriptionException,
564                            com.liferay.portal.kernel.exception.SystemException {
565                    return getPersistence()
566                                       .findByC_C_C_Last(companyId, classNameId, classPK,
567                            orderByComparator);
568            }
569    
570            /**
571            * Returns the last subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
572            *
573            * @param companyId the company ID
574            * @param classNameId the class name ID
575            * @param classPK the class p k
576            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
577            * @return the last matching subscription, or <code>null</code> if a matching subscription could not be found
578            * @throws SystemException if a system exception occurred
579            */
580            public static com.liferay.portal.model.Subscription fetchByC_C_C_Last(
581                    long companyId, long classNameId, long classPK,
582                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
583                    throws com.liferay.portal.kernel.exception.SystemException {
584                    return getPersistence()
585                                       .fetchByC_C_C_Last(companyId, classNameId, classPK,
586                            orderByComparator);
587            }
588    
589            /**
590            * Returns the subscriptions before and after the current subscription in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
591            *
592            * @param subscriptionId the primary key of the current subscription
593            * @param companyId the company ID
594            * @param classNameId the class name ID
595            * @param classPK the class p k
596            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
597            * @return the previous, current, and next subscription
598            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
599            * @throws SystemException if a system exception occurred
600            */
601            public static com.liferay.portal.model.Subscription[] findByC_C_C_PrevAndNext(
602                    long subscriptionId, long companyId, long classNameId, long classPK,
603                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
604                    throws com.liferay.portal.NoSuchSubscriptionException,
605                            com.liferay.portal.kernel.exception.SystemException {
606                    return getPersistence()
607                                       .findByC_C_C_PrevAndNext(subscriptionId, companyId,
608                            classNameId, classPK, orderByComparator);
609            }
610    
611            /**
612            * Removes all the subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
613            *
614            * @param companyId the company ID
615            * @param classNameId the class name ID
616            * @param classPK the class p k
617            * @throws SystemException if a system exception occurred
618            */
619            public static void removeByC_C_C(long companyId, long classNameId,
620                    long classPK)
621                    throws com.liferay.portal.kernel.exception.SystemException {
622                    getPersistence().removeByC_C_C(companyId, classNameId, classPK);
623            }
624    
625            /**
626            * Returns the number of subscriptions where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
627            *
628            * @param companyId the company ID
629            * @param classNameId the class name ID
630            * @param classPK the class p k
631            * @return the number of matching subscriptions
632            * @throws SystemException if a system exception occurred
633            */
634            public static int countByC_C_C(long companyId, long classNameId,
635                    long classPK)
636                    throws com.liferay.portal.kernel.exception.SystemException {
637                    return getPersistence().countByC_C_C(companyId, classNameId, classPK);
638            }
639    
640            /**
641            * 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.
642            *
643            * @param companyId the company ID
644            * @param userId the user ID
645            * @param classNameId the class name ID
646            * @param classPK the class p k
647            * @return the matching subscription
648            * @throws com.liferay.portal.NoSuchSubscriptionException if a matching subscription could not be found
649            * @throws SystemException if a system exception occurred
650            */
651            public static com.liferay.portal.model.Subscription findByC_U_C_C(
652                    long companyId, long userId, long classNameId, long classPK)
653                    throws com.liferay.portal.NoSuchSubscriptionException,
654                            com.liferay.portal.kernel.exception.SystemException {
655                    return getPersistence()
656                                       .findByC_U_C_C(companyId, userId, classNameId, classPK);
657            }
658    
659            /**
660            * 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.
661            *
662            * @param companyId the company ID
663            * @param userId the user ID
664            * @param classNameId the class name ID
665            * @param classPK the class p k
666            * @return the matching subscription, or <code>null</code> if a matching subscription could not be found
667            * @throws SystemException if a system exception occurred
668            */
669            public static com.liferay.portal.model.Subscription fetchByC_U_C_C(
670                    long companyId, long userId, long classNameId, long classPK)
671                    throws com.liferay.portal.kernel.exception.SystemException {
672                    return getPersistence()
673                                       .fetchByC_U_C_C(companyId, userId, classNameId, classPK);
674            }
675    
676            /**
677            * 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.
678            *
679            * @param companyId the company ID
680            * @param userId the user ID
681            * @param classNameId the class name ID
682            * @param classPK the class p k
683            * @param retrieveFromCache whether to use the finder cache
684            * @return the matching subscription, or <code>null</code> if a matching subscription could not be found
685            * @throws SystemException if a system exception occurred
686            */
687            public static com.liferay.portal.model.Subscription fetchByC_U_C_C(
688                    long companyId, long userId, long classNameId, long classPK,
689                    boolean retrieveFromCache)
690                    throws com.liferay.portal.kernel.exception.SystemException {
691                    return getPersistence()
692                                       .fetchByC_U_C_C(companyId, userId, classNameId, classPK,
693                            retrieveFromCache);
694            }
695    
696            /**
697            * Removes the subscription where companyId = &#63; and userId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
698            *
699            * @param companyId the company ID
700            * @param userId the user ID
701            * @param classNameId the class name ID
702            * @param classPK the class p k
703            * @return the subscription that was removed
704            * @throws SystemException if a system exception occurred
705            */
706            public static com.liferay.portal.model.Subscription removeByC_U_C_C(
707                    long companyId, long userId, long classNameId, long classPK)
708                    throws com.liferay.portal.NoSuchSubscriptionException,
709                            com.liferay.portal.kernel.exception.SystemException {
710                    return getPersistence()
711                                       .removeByC_U_C_C(companyId, userId, classNameId, classPK);
712            }
713    
714            /**
715            * Returns the number of subscriptions where companyId = &#63; and userId = &#63; and classNameId = &#63; and classPK = &#63;.
716            *
717            * @param companyId the company ID
718            * @param userId the user ID
719            * @param classNameId the class name ID
720            * @param classPK the class p k
721            * @return the number of matching subscriptions
722            * @throws SystemException if a system exception occurred
723            */
724            public static int countByC_U_C_C(long companyId, long userId,
725                    long classNameId, long classPK)
726                    throws com.liferay.portal.kernel.exception.SystemException {
727                    return getPersistence()
728                                       .countByC_U_C_C(companyId, userId, classNameId, classPK);
729            }
730    
731            /**
732            * Caches the subscription in the entity cache if it is enabled.
733            *
734            * @param subscription the subscription
735            */
736            public static void cacheResult(
737                    com.liferay.portal.model.Subscription subscription) {
738                    getPersistence().cacheResult(subscription);
739            }
740    
741            /**
742            * Caches the subscriptions in the entity cache if it is enabled.
743            *
744            * @param subscriptions the subscriptions
745            */
746            public static void cacheResult(
747                    java.util.List<com.liferay.portal.model.Subscription> subscriptions) {
748                    getPersistence().cacheResult(subscriptions);
749            }
750    
751            /**
752            * Creates a new subscription with the primary key. Does not add the subscription to the database.
753            *
754            * @param subscriptionId the primary key for the new subscription
755            * @return the new subscription
756            */
757            public static com.liferay.portal.model.Subscription create(
758                    long subscriptionId) {
759                    return getPersistence().create(subscriptionId);
760            }
761    
762            /**
763            * Removes the subscription with the primary key from the database. Also notifies the appropriate model listeners.
764            *
765            * @param subscriptionId the primary key of the subscription
766            * @return the subscription that was removed
767            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
768            * @throws SystemException if a system exception occurred
769            */
770            public static com.liferay.portal.model.Subscription remove(
771                    long subscriptionId)
772                    throws com.liferay.portal.NoSuchSubscriptionException,
773                            com.liferay.portal.kernel.exception.SystemException {
774                    return getPersistence().remove(subscriptionId);
775            }
776    
777            public static com.liferay.portal.model.Subscription updateImpl(
778                    com.liferay.portal.model.Subscription subscription)
779                    throws com.liferay.portal.kernel.exception.SystemException {
780                    return getPersistence().updateImpl(subscription);
781            }
782    
783            /**
784            * Returns the subscription with the primary key or throws a {@link com.liferay.portal.NoSuchSubscriptionException} if it could not be found.
785            *
786            * @param subscriptionId the primary key of the subscription
787            * @return the subscription
788            * @throws com.liferay.portal.NoSuchSubscriptionException if a subscription with the primary key could not be found
789            * @throws SystemException if a system exception occurred
790            */
791            public static com.liferay.portal.model.Subscription findByPrimaryKey(
792                    long subscriptionId)
793                    throws com.liferay.portal.NoSuchSubscriptionException,
794                            com.liferay.portal.kernel.exception.SystemException {
795                    return getPersistence().findByPrimaryKey(subscriptionId);
796            }
797    
798            /**
799            * Returns the subscription with the primary key or returns <code>null</code> if it could not be found.
800            *
801            * @param subscriptionId the primary key of the subscription
802            * @return the subscription, or <code>null</code> if a subscription with the primary key could not be found
803            * @throws SystemException if a system exception occurred
804            */
805            public static com.liferay.portal.model.Subscription fetchByPrimaryKey(
806                    long subscriptionId)
807                    throws com.liferay.portal.kernel.exception.SystemException {
808                    return getPersistence().fetchByPrimaryKey(subscriptionId);
809            }
810    
811            /**
812            * Returns all the subscriptions.
813            *
814            * @return the subscriptions
815            * @throws SystemException if a system exception occurred
816            */
817            public static java.util.List<com.liferay.portal.model.Subscription> findAll()
818                    throws com.liferay.portal.kernel.exception.SystemException {
819                    return getPersistence().findAll();
820            }
821    
822            /**
823            * Returns a range of all the subscriptions.
824            *
825            * <p>
826            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
827            * </p>
828            *
829            * @param start the lower bound of the range of subscriptions
830            * @param end the upper bound of the range of subscriptions (not inclusive)
831            * @return the range of subscriptions
832            * @throws SystemException if a system exception occurred
833            */
834            public static java.util.List<com.liferay.portal.model.Subscription> findAll(
835                    int start, int end)
836                    throws com.liferay.portal.kernel.exception.SystemException {
837                    return getPersistence().findAll(start, end);
838            }
839    
840            /**
841            * Returns an ordered range of all the subscriptions.
842            *
843            * <p>
844            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.SubscriptionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
845            * </p>
846            *
847            * @param start the lower bound of the range of subscriptions
848            * @param end the upper bound of the range of subscriptions (not inclusive)
849            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
850            * @return the ordered range of subscriptions
851            * @throws SystemException if a system exception occurred
852            */
853            public static java.util.List<com.liferay.portal.model.Subscription> findAll(
854                    int start, int end,
855                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
856                    throws com.liferay.portal.kernel.exception.SystemException {
857                    return getPersistence().findAll(start, end, orderByComparator);
858            }
859    
860            /**
861            * Removes all the subscriptions from the database.
862            *
863            * @throws SystemException if a system exception occurred
864            */
865            public static void removeAll()
866                    throws com.liferay.portal.kernel.exception.SystemException {
867                    getPersistence().removeAll();
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    }