1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  import com.liferay.portal.PortalException;
23  import com.liferay.portal.SystemException;
24  import com.liferay.portal.kernel.annotation.Propagation;
25  import com.liferay.portal.kernel.annotation.Transactional;
26  
27  /**
28   * <a href="SubscriptionPersistence.java.html"><b><i>View Source</i></b></a>
29   *
30   * @author Brian Wing Shun Chan
31   *
32   */
33  @Transactional(rollbackFor =  {
34      PortalException.class, SystemException.class})
35  public interface SubscriptionPersistence extends BasePersistence {
36      public com.liferay.portal.model.Subscription create(long subscriptionId);
37  
38      public com.liferay.portal.model.Subscription remove(long subscriptionId)
39          throws com.liferay.portal.NoSuchSubscriptionException,
40              com.liferay.portal.SystemException;
41  
42      public com.liferay.portal.model.Subscription remove(
43          com.liferay.portal.model.Subscription subscription)
44          throws com.liferay.portal.SystemException;
45  
46      /**
47       * @deprecated Use <code>update(Subscription subscription, boolean merge)</code>.
48       */
49      public com.liferay.portal.model.Subscription update(
50          com.liferay.portal.model.Subscription subscription)
51          throws com.liferay.portal.SystemException;
52  
53      /**
54       * Add, update, or merge, the entity. This method also calls the model
55       * listeners to trigger the proper events associated with adding, deleting,
56       * or updating an entity.
57       *
58       * @param        subscription the entity to add, update, or merge
59       * @param        merge boolean value for whether to merge the entity. The
60       *                default value is false. Setting merge to true is more
61       *                expensive and should only be true when subscription is
62       *                transient. See LEP-5473 for a detailed discussion of this
63       *                method.
64       * @return        true if the portlet can be displayed via Ajax
65       */
66      public com.liferay.portal.model.Subscription update(
67          com.liferay.portal.model.Subscription subscription, boolean merge)
68          throws com.liferay.portal.SystemException;
69  
70      public com.liferay.portal.model.Subscription updateImpl(
71          com.liferay.portal.model.Subscription subscription, boolean merge)
72          throws com.liferay.portal.SystemException;
73  
74      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
75      public com.liferay.portal.model.Subscription findByPrimaryKey(
76          long subscriptionId)
77          throws com.liferay.portal.NoSuchSubscriptionException,
78              com.liferay.portal.SystemException;
79  
80      public com.liferay.portal.model.Subscription fetchByPrimaryKey(
81          long subscriptionId) throws com.liferay.portal.SystemException;
82  
83      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
84      public java.util.List<com.liferay.portal.model.Subscription> findByUserId(
85          long userId) throws com.liferay.portal.SystemException;
86  
87      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
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      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
93      public java.util.List<com.liferay.portal.model.Subscription> findByUserId(
94          long userId, int start, int end,
95          com.liferay.portal.kernel.util.OrderByComparator obc)
96          throws com.liferay.portal.SystemException;
97  
98      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
99      public com.liferay.portal.model.Subscription findByUserId_First(
100         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
101         throws com.liferay.portal.NoSuchSubscriptionException,
102             com.liferay.portal.SystemException;
103 
104     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
105     public com.liferay.portal.model.Subscription findByUserId_Last(
106         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
107         throws com.liferay.portal.NoSuchSubscriptionException,
108             com.liferay.portal.SystemException;
109 
110     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
111     public com.liferay.portal.model.Subscription[] findByUserId_PrevAndNext(
112         long subscriptionId, long userId,
113         com.liferay.portal.kernel.util.OrderByComparator obc)
114         throws com.liferay.portal.NoSuchSubscriptionException,
115             com.liferay.portal.SystemException;
116 
117     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
118     public java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
119         long companyId, long classNameId, long classPK)
120         throws com.liferay.portal.SystemException;
121 
122     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123     public java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
124         long companyId, long classNameId, long classPK, int start, int end)
125         throws com.liferay.portal.SystemException;
126 
127     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
128     public java.util.List<com.liferay.portal.model.Subscription> findByC_C_C(
129         long companyId, long classNameId, long classPK, int start, int end,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException;
132 
133     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134     public com.liferay.portal.model.Subscription findByC_C_C_First(
135         long companyId, long classNameId, long classPK,
136         com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.NoSuchSubscriptionException,
138             com.liferay.portal.SystemException;
139 
140     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
141     public com.liferay.portal.model.Subscription findByC_C_C_Last(
142         long companyId, long classNameId, long classPK,
143         com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.NoSuchSubscriptionException,
145             com.liferay.portal.SystemException;
146 
147     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
148     public com.liferay.portal.model.Subscription[] findByC_C_C_PrevAndNext(
149         long subscriptionId, long companyId, long classNameId, long classPK,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.NoSuchSubscriptionException,
152             com.liferay.portal.SystemException;
153 
154     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
155     public com.liferay.portal.model.Subscription findByC_U_C_C(long companyId,
156         long userId, long classNameId, long classPK)
157         throws com.liferay.portal.NoSuchSubscriptionException,
158             com.liferay.portal.SystemException;
159 
160     public com.liferay.portal.model.Subscription fetchByC_U_C_C(
161         long companyId, long userId, long classNameId, long classPK)
162         throws com.liferay.portal.SystemException;
163 
164     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
165     public java.util.List<Object> findWithDynamicQuery(
166         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167         throws com.liferay.portal.SystemException;
168 
169     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
170     public java.util.List<Object> findWithDynamicQuery(
171         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
172         int end) throws com.liferay.portal.SystemException;
173 
174     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
175     public java.util.List<com.liferay.portal.model.Subscription> findAll()
176         throws com.liferay.portal.SystemException;
177 
178     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
179     public java.util.List<com.liferay.portal.model.Subscription> findAll(
180         int start, int end) throws com.liferay.portal.SystemException;
181 
182     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
183     public java.util.List<com.liferay.portal.model.Subscription> findAll(
184         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
185         throws com.liferay.portal.SystemException;
186 
187     public void removeByUserId(long userId)
188         throws com.liferay.portal.SystemException;
189 
190     public void removeByC_C_C(long companyId, long classNameId, long classPK)
191         throws com.liferay.portal.SystemException;
192 
193     public void removeByC_U_C_C(long companyId, long userId, long classNameId,
194         long classPK)
195         throws com.liferay.portal.NoSuchSubscriptionException,
196             com.liferay.portal.SystemException;
197 
198     public void removeAll() throws com.liferay.portal.SystemException;
199 
200     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
201     public int countByUserId(long userId)
202         throws com.liferay.portal.SystemException;
203 
204     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
205     public int countByC_C_C(long companyId, long classNameId, long classPK)
206         throws com.liferay.portal.SystemException;
207 
208     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209     public int countByC_U_C_C(long companyId, long userId, long classNameId,
210         long classPK) throws com.liferay.portal.SystemException;
211 
212     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
213     public int countAll() throws com.liferay.portal.SystemException;
214 }