1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="SubscriptionPersistence.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public interface SubscriptionPersistence extends BasePersistence {
32      public void cacheResult(com.liferay.portal.model.Subscription subscription);
33  
34      public void cacheResult(
35          java.util.List<com.liferay.portal.model.Subscription> subscriptions);
36  
37      public void clearCache();
38  
39      public com.liferay.portal.model.Subscription create(long subscriptionId);
40  
41      public com.liferay.portal.model.Subscription remove(long subscriptionId)
42          throws com.liferay.portal.NoSuchSubscriptionException,
43              com.liferay.portal.SystemException;
44  
45      public com.liferay.portal.model.Subscription remove(
46          com.liferay.portal.model.Subscription subscription)
47          throws com.liferay.portal.SystemException;
48  
49      /**
50       * @deprecated Use <code>update(Subscription subscription, boolean merge)</code>.
51       */
52      public com.liferay.portal.model.Subscription update(
53          com.liferay.portal.model.Subscription subscription)
54          throws com.liferay.portal.SystemException;
55  
56      /**
57       * Add, update, or merge, the entity. This method also calls the model
58       * listeners to trigger the proper events associated with adding, deleting,
59       * or updating an entity.
60       *
61       * @param        subscription the entity to add, update, or merge
62       * @param        merge boolean value for whether to merge the entity. The
63       *                default value is false. Setting merge to true is more
64       *                expensive and should only be true when subscription is
65       *                transient. See LEP-5473 for a detailed discussion of this
66       *                method.
67       * @return        true if the portlet can be displayed via Ajax
68       */
69      public com.liferay.portal.model.Subscription update(
70          com.liferay.portal.model.Subscription subscription, boolean merge)
71          throws com.liferay.portal.SystemException;
72  
73      public com.liferay.portal.model.Subscription updateImpl(
74          com.liferay.portal.model.Subscription subscription, boolean merge)
75          throws com.liferay.portal.SystemException;
76  
77      public com.liferay.portal.model.Subscription findByPrimaryKey(
78          long subscriptionId)
79          throws com.liferay.portal.NoSuchSubscriptionException,
80              com.liferay.portal.SystemException;
81  
82      public com.liferay.portal.model.Subscription fetchByPrimaryKey(
83          long subscriptionId) throws com.liferay.portal.SystemException;
84  
85      public java.util.List<com.liferay.portal.model.Subscription> findByUserId(
86          long userId) throws com.liferay.portal.SystemException;
87  
88      public java.util.List<com.liferay.portal.model.Subscription> findByUserId(
89          long userId, int start, int end)
90          throws com.liferay.portal.SystemException;
91  
92      public java.util.List<com.liferay.portal.model.Subscription> findByUserId(
93          long userId, int start, int end,
94          com.liferay.portal.kernel.util.OrderByComparator obc)
95          throws com.liferay.portal.SystemException;
96  
97      public com.liferay.portal.model.Subscription findByUserId_First(
98          long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
99          throws com.liferay.portal.NoSuchSubscriptionException,
100             com.liferay.portal.SystemException;
101 
102     public com.liferay.portal.model.Subscription findByUserId_Last(
103         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
104         throws com.liferay.portal.NoSuchSubscriptionException,
105             com.liferay.portal.SystemException;
106 
107     public com.liferay.portal.model.Subscription[] findByUserId_PrevAndNext(
108         long subscriptionId, long userId,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.NoSuchSubscriptionException,
111             com.liferay.portal.SystemException;
112 
113     public java.util.List<com.liferay.portal.model.Subscription> findByU_C(
114         long userId, long classNameId)
115         throws com.liferay.portal.SystemException;
116 
117     public java.util.List<com.liferay.portal.model.Subscription> findByU_C(
118         long userId, long classNameId, int start, int end)
119         throws com.liferay.portal.SystemException;
120 
121     public java.util.List<com.liferay.portal.model.Subscription> findByU_C(
122         long userId, long classNameId, int start, int end,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.SystemException;
125 
126     public com.liferay.portal.model.Subscription findByU_C_First(long userId,
127         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.NoSuchSubscriptionException,
129             com.liferay.portal.SystemException;
130 
131     public com.liferay.portal.model.Subscription findByU_C_Last(long userId,
132         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.NoSuchSubscriptionException,
134             com.liferay.portal.SystemException;
135 
136     public com.liferay.portal.model.Subscription[] findByU_C_PrevAndNext(
137         long subscriptionId, long userId, long classNameId,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.NoSuchSubscriptionException,
140             com.liferay.portal.SystemException;
141 
142     public java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
143         long companyId, long classNameId, long classPK)
144         throws com.liferay.portal.SystemException;
145 
146     public java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
147         long companyId, long classNameId, long classPK, int start, int end)
148         throws com.liferay.portal.SystemException;
149 
150     public java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
151         long companyId, long classNameId, long classPK, int start, int end,
152         com.liferay.portal.kernel.util.OrderByComparator obc)
153         throws com.liferay.portal.SystemException;
154 
155     public com.liferay.portal.model.Subscription findByC_C_C_First(
156         long companyId, long classNameId, long classPK,
157         com.liferay.portal.kernel.util.OrderByComparator obc)
158         throws com.liferay.portal.NoSuchSubscriptionException,
159             com.liferay.portal.SystemException;
160 
161     public com.liferay.portal.model.Subscription findByC_C_C_Last(
162         long companyId, long classNameId, long classPK,
163         com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.NoSuchSubscriptionException,
165             com.liferay.portal.SystemException;
166 
167     public com.liferay.portal.model.Subscription[] findByC_C_C_PrevAndNext(
168         long subscriptionId, long companyId, long classNameId, long classPK,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.NoSuchSubscriptionException,
171             com.liferay.portal.SystemException;
172 
173     public com.liferay.portal.model.Subscription findByC_U_C_C(long companyId,
174         long userId, long classNameId, long classPK)
175         throws com.liferay.portal.NoSuchSubscriptionException,
176             com.liferay.portal.SystemException;
177 
178     public com.liferay.portal.model.Subscription fetchByC_U_C_C(
179         long companyId, long userId, long classNameId, long classPK)
180         throws com.liferay.portal.SystemException;
181 
182     public com.liferay.portal.model.Subscription fetchByC_U_C_C(
183         long companyId, long userId, long classNameId, long classPK,
184         boolean retrieveFromCache) throws com.liferay.portal.SystemException;
185 
186     public java.util.List<Object> findWithDynamicQuery(
187         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
188         throws com.liferay.portal.SystemException;
189 
190     public java.util.List<Object> findWithDynamicQuery(
191         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
192         int end) throws com.liferay.portal.SystemException;
193 
194     public java.util.List<com.liferay.portal.model.Subscription> findAll()
195         throws com.liferay.portal.SystemException;
196 
197     public java.util.List<com.liferay.portal.model.Subscription> findAll(
198         int start, int end) throws com.liferay.portal.SystemException;
199 
200     public java.util.List<com.liferay.portal.model.Subscription> findAll(
201         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
202         throws com.liferay.portal.SystemException;
203 
204     public void removeByUserId(long userId)
205         throws com.liferay.portal.SystemException;
206 
207     public void removeByU_C(long userId, long classNameId)
208         throws com.liferay.portal.SystemException;
209 
210     public void removeByC_C_C(long companyId, long classNameId, long classPK)
211         throws com.liferay.portal.SystemException;
212 
213     public void removeByC_U_C_C(long companyId, long userId, long classNameId,
214         long classPK)
215         throws com.liferay.portal.NoSuchSubscriptionException,
216             com.liferay.portal.SystemException;
217 
218     public void removeAll() throws com.liferay.portal.SystemException;
219 
220     public int countByUserId(long userId)
221         throws com.liferay.portal.SystemException;
222 
223     public int countByU_C(long userId, long classNameId)
224         throws com.liferay.portal.SystemException;
225 
226     public int countByC_C_C(long companyId, long classNameId, long classPK)
227         throws com.liferay.portal.SystemException;
228 
229     public int countByC_U_C_C(long companyId, long userId, long classNameId,
230         long classPK) throws com.liferay.portal.SystemException;
231 
232     public int countAll() throws com.liferay.portal.SystemException;
233 }