1   /**
2    * Copyright (c) 2000-2008 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.portlet.social.service.persistence;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.Propagation;
28  import com.liferay.portal.kernel.annotation.Transactional;
29  
30  /**
31   * <a href="SocialActivityPersistence.java.html"><b><i>View Source</i></b></a>
32   *
33   * @author Brian Wing Shun Chan
34   *
35   */
36  @Transactional(rollbackFor =  {
37      PortalException.class, SystemException.class})
38  public interface SocialActivityPersistence {
39      public com.liferay.portlet.social.model.SocialActivity create(
40          long activityId);
41  
42      public com.liferay.portlet.social.model.SocialActivity remove(
43          long activityId)
44          throws com.liferay.portal.SystemException,
45              com.liferay.portlet.social.NoSuchActivityException;
46  
47      public com.liferay.portlet.social.model.SocialActivity remove(
48          com.liferay.portlet.social.model.SocialActivity socialActivity)
49          throws com.liferay.portal.SystemException;
50  
51      /**
52       * @deprecated Use <code>update(SocialActivity socialActivity, boolean merge)</code>.
53       */
54      public com.liferay.portlet.social.model.SocialActivity update(
55          com.liferay.portlet.social.model.SocialActivity socialActivity)
56          throws com.liferay.portal.SystemException;
57  
58      /**
59       * Add, update, or merge, the entity. This method also calls the model
60       * listeners to trigger the proper events associated with adding, deleting,
61       * or updating an entity.
62       *
63       * @param        socialActivity the entity to add, update, or merge
64       * @param        merge boolean value for whether to merge the entity. The
65       *                default value is false. Setting merge to true is more
66       *                expensive and should only be true when socialActivity is
67       *                transient. See LEP-5473 for a detailed discussion of this
68       *                method.
69       * @return        true if the portlet can be displayed via Ajax
70       */
71      public com.liferay.portlet.social.model.SocialActivity update(
72          com.liferay.portlet.social.model.SocialActivity socialActivity,
73          boolean merge) throws com.liferay.portal.SystemException;
74  
75      public com.liferay.portlet.social.model.SocialActivity updateImpl(
76          com.liferay.portlet.social.model.SocialActivity socialActivity,
77          boolean merge) throws com.liferay.portal.SystemException;
78  
79      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
80      public com.liferay.portlet.social.model.SocialActivity findByPrimaryKey(
81          long activityId)
82          throws com.liferay.portal.SystemException,
83              com.liferay.portlet.social.NoSuchActivityException;
84  
85      public com.liferay.portlet.social.model.SocialActivity fetchByPrimaryKey(
86          long activityId) throws com.liferay.portal.SystemException;
87  
88      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
89      public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
90          long groupId) throws com.liferay.portal.SystemException;
91  
92      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
93      public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
94          long groupId, int start, int end)
95          throws com.liferay.portal.SystemException;
96  
97      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
98      public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
99          long groupId, int start, int end,
100         com.liferay.portal.kernel.util.OrderByComparator obc)
101         throws com.liferay.portal.SystemException;
102 
103     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
104     public com.liferay.portlet.social.model.SocialActivity findByGroupId_First(
105         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
106         throws com.liferay.portal.SystemException,
107             com.liferay.portlet.social.NoSuchActivityException;
108 
109     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
110     public com.liferay.portlet.social.model.SocialActivity findByGroupId_Last(
111         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
112         throws com.liferay.portal.SystemException,
113             com.liferay.portlet.social.NoSuchActivityException;
114 
115     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
116     public com.liferay.portlet.social.model.SocialActivity[] findByGroupId_PrevAndNext(
117         long activityId, long groupId,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException,
120             com.liferay.portlet.social.NoSuchActivityException;
121 
122     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
123     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByCompanyId(
124         long companyId) throws com.liferay.portal.SystemException;
125 
126     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
127     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByCompanyId(
128         long companyId, int start, int end)
129         throws com.liferay.portal.SystemException;
130 
131     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
132     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByCompanyId(
133         long companyId, int start, int end,
134         com.liferay.portal.kernel.util.OrderByComparator obc)
135         throws com.liferay.portal.SystemException;
136 
137     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
138     public com.liferay.portlet.social.model.SocialActivity findByCompanyId_First(
139         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.SystemException,
141             com.liferay.portlet.social.NoSuchActivityException;
142 
143     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
144     public com.liferay.portlet.social.model.SocialActivity findByCompanyId_Last(
145         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
146         throws com.liferay.portal.SystemException,
147             com.liferay.portlet.social.NoSuchActivityException;
148 
149     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
150     public com.liferay.portlet.social.model.SocialActivity[] findByCompanyId_PrevAndNext(
151         long activityId, long companyId,
152         com.liferay.portal.kernel.util.OrderByComparator obc)
153         throws com.liferay.portal.SystemException,
154             com.liferay.portlet.social.NoSuchActivityException;
155 
156     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
157     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserId(
158         long userId) throws com.liferay.portal.SystemException;
159 
160     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
161     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserId(
162         long userId, int start, int end)
163         throws com.liferay.portal.SystemException;
164 
165     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
166     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserId(
167         long userId, int start, int end,
168         com.liferay.portal.kernel.util.OrderByComparator obc)
169         throws com.liferay.portal.SystemException;
170 
171     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
172     public com.liferay.portlet.social.model.SocialActivity findByUserId_First(
173         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.SystemException,
175             com.liferay.portlet.social.NoSuchActivityException;
176 
177     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
178     public com.liferay.portlet.social.model.SocialActivity findByUserId_Last(
179         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
180         throws com.liferay.portal.SystemException,
181             com.liferay.portlet.social.NoSuchActivityException;
182 
183     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
184     public com.liferay.portlet.social.model.SocialActivity[] findByUserId_PrevAndNext(
185         long activityId, long userId,
186         com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.SystemException,
188             com.liferay.portlet.social.NoSuchActivityException;
189 
190     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
191     public com.liferay.portlet.social.model.SocialActivity findByMirrorActivityId(
192         long mirrorActivityId)
193         throws com.liferay.portal.SystemException,
194             com.liferay.portlet.social.NoSuchActivityException;
195 
196     public com.liferay.portlet.social.model.SocialActivity fetchByMirrorActivityId(
197         long mirrorActivityId) throws com.liferay.portal.SystemException;
198 
199     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
200     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByClassNameId(
201         long classNameId) throws com.liferay.portal.SystemException;
202 
203     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
204     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByClassNameId(
205         long classNameId, int start, int end)
206         throws com.liferay.portal.SystemException;
207 
208     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
209     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByClassNameId(
210         long classNameId, int start, int end,
211         com.liferay.portal.kernel.util.OrderByComparator obc)
212         throws com.liferay.portal.SystemException;
213 
214     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
215     public com.liferay.portlet.social.model.SocialActivity findByClassNameId_First(
216         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
217         throws com.liferay.portal.SystemException,
218             com.liferay.portlet.social.NoSuchActivityException;
219 
220     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
221     public com.liferay.portlet.social.model.SocialActivity findByClassNameId_Last(
222         long classNameId, com.liferay.portal.kernel.util.OrderByComparator obc)
223         throws com.liferay.portal.SystemException,
224             com.liferay.portlet.social.NoSuchActivityException;
225 
226     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227     public com.liferay.portlet.social.model.SocialActivity[] findByClassNameId_PrevAndNext(
228         long activityId, long classNameId,
229         com.liferay.portal.kernel.util.OrderByComparator obc)
230         throws com.liferay.portal.SystemException,
231             com.liferay.portlet.social.NoSuchActivityException;
232 
233     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
234     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByReceiverUserId(
235         long receiverUserId) throws com.liferay.portal.SystemException;
236 
237     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
238     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByReceiverUserId(
239         long receiverUserId, int start, int end)
240         throws com.liferay.portal.SystemException;
241 
242     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
243     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByReceiverUserId(
244         long receiverUserId, int start, int end,
245         com.liferay.portal.kernel.util.OrderByComparator obc)
246         throws com.liferay.portal.SystemException;
247 
248     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
249     public com.liferay.portlet.social.model.SocialActivity findByReceiverUserId_First(
250         long receiverUserId,
251         com.liferay.portal.kernel.util.OrderByComparator obc)
252         throws com.liferay.portal.SystemException,
253             com.liferay.portlet.social.NoSuchActivityException;
254 
255     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
256     public com.liferay.portlet.social.model.SocialActivity findByReceiverUserId_Last(
257         long receiverUserId,
258         com.liferay.portal.kernel.util.OrderByComparator obc)
259         throws com.liferay.portal.SystemException,
260             com.liferay.portlet.social.NoSuchActivityException;
261 
262     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
263     public com.liferay.portlet.social.model.SocialActivity[] findByReceiverUserId_PrevAndNext(
264         long activityId, long receiverUserId,
265         com.liferay.portal.kernel.util.OrderByComparator obc)
266         throws com.liferay.portal.SystemException,
267             com.liferay.portlet.social.NoSuchActivityException;
268 
269     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
270     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByC_C(
271         long classNameId, long classPK)
272         throws com.liferay.portal.SystemException;
273 
274     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
275     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByC_C(
276         long classNameId, long classPK, int start, int end)
277         throws com.liferay.portal.SystemException;
278 
279     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
280     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByC_C(
281         long classNameId, long classPK, int start, int end,
282         com.liferay.portal.kernel.util.OrderByComparator obc)
283         throws com.liferay.portal.SystemException;
284 
285     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
286     public com.liferay.portlet.social.model.SocialActivity findByC_C_First(
287         long classNameId, long classPK,
288         com.liferay.portal.kernel.util.OrderByComparator obc)
289         throws com.liferay.portal.SystemException,
290             com.liferay.portlet.social.NoSuchActivityException;
291 
292     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
293     public com.liferay.portlet.social.model.SocialActivity findByC_C_Last(
294         long classNameId, long classPK,
295         com.liferay.portal.kernel.util.OrderByComparator obc)
296         throws com.liferay.portal.SystemException,
297             com.liferay.portlet.social.NoSuchActivityException;
298 
299     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
300     public com.liferay.portlet.social.model.SocialActivity[] findByC_C_PrevAndNext(
301         long activityId, long classNameId, long classPK,
302         com.liferay.portal.kernel.util.OrderByComparator obc)
303         throws com.liferay.portal.SystemException,
304             com.liferay.portlet.social.NoSuchActivityException;
305 
306     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
307     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByM_C_C(
308         long mirrorActivityId, long classNameId, long classPK)
309         throws com.liferay.portal.SystemException;
310 
311     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
312     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByM_C_C(
313         long mirrorActivityId, long classNameId, long classPK, int start,
314         int end) throws com.liferay.portal.SystemException;
315 
316     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
317     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findByM_C_C(
318         long mirrorActivityId, long classNameId, long classPK, int start,
319         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
320         throws com.liferay.portal.SystemException;
321 
322     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
323     public com.liferay.portlet.social.model.SocialActivity findByM_C_C_First(
324         long mirrorActivityId, long classNameId, long classPK,
325         com.liferay.portal.kernel.util.OrderByComparator obc)
326         throws com.liferay.portal.SystemException,
327             com.liferay.portlet.social.NoSuchActivityException;
328 
329     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
330     public com.liferay.portlet.social.model.SocialActivity findByM_C_C_Last(
331         long mirrorActivityId, long classNameId, long classPK,
332         com.liferay.portal.kernel.util.OrderByComparator obc)
333         throws com.liferay.portal.SystemException,
334             com.liferay.portlet.social.NoSuchActivityException;
335 
336     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
337     public com.liferay.portlet.social.model.SocialActivity[] findByM_C_C_PrevAndNext(
338         long activityId, long mirrorActivityId, long classNameId, long classPK,
339         com.liferay.portal.kernel.util.OrderByComparator obc)
340         throws com.liferay.portal.SystemException,
341             com.liferay.portlet.social.NoSuchActivityException;
342 
343     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
344     public com.liferay.portlet.social.model.SocialActivity findByG_U_CD_C_C_T_R(
345         long groupId, long userId, java.util.Date createDate, long classNameId,
346         long classPK, int type, long receiverUserId)
347         throws com.liferay.portal.SystemException,
348             com.liferay.portlet.social.NoSuchActivityException;
349 
350     public com.liferay.portlet.social.model.SocialActivity fetchByG_U_CD_C_C_T_R(
351         long groupId, long userId, java.util.Date createDate, long classNameId,
352         long classPK, int type, long receiverUserId)
353         throws com.liferay.portal.SystemException;
354 
355     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
356     public java.util.List<Object> findWithDynamicQuery(
357         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
358         throws com.liferay.portal.SystemException;
359 
360     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361     public java.util.List<Object> findWithDynamicQuery(
362         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
363         int end) throws com.liferay.portal.SystemException;
364 
365     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
366     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findAll()
367         throws com.liferay.portal.SystemException;
368 
369     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
370     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findAll(
371         int start, int end) throws com.liferay.portal.SystemException;
372 
373     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
374     public java.util.List<com.liferay.portlet.social.model.SocialActivity> findAll(
375         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
376         throws com.liferay.portal.SystemException;
377 
378     public void removeByGroupId(long groupId)
379         throws com.liferay.portal.SystemException;
380 
381     public void removeByCompanyId(long companyId)
382         throws com.liferay.portal.SystemException;
383 
384     public void removeByUserId(long userId)
385         throws com.liferay.portal.SystemException;
386 
387     public void removeByMirrorActivityId(long mirrorActivityId)
388         throws com.liferay.portal.SystemException,
389             com.liferay.portlet.social.NoSuchActivityException;
390 
391     public void removeByClassNameId(long classNameId)
392         throws com.liferay.portal.SystemException;
393 
394     public void removeByReceiverUserId(long receiverUserId)
395         throws com.liferay.portal.SystemException;
396 
397     public void removeByC_C(long classNameId, long classPK)
398         throws com.liferay.portal.SystemException;
399 
400     public void removeByM_C_C(long mirrorActivityId, long classNameId,
401         long classPK) throws com.liferay.portal.SystemException;
402 
403     public void removeByG_U_CD_C_C_T_R(long groupId, long userId,
404         java.util.Date createDate, long classNameId, long classPK, int type,
405         long receiverUserId)
406         throws com.liferay.portal.SystemException,
407             com.liferay.portlet.social.NoSuchActivityException;
408 
409     public void removeAll() throws com.liferay.portal.SystemException;
410 
411     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
412     public int countByGroupId(long groupId)
413         throws com.liferay.portal.SystemException;
414 
415     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
416     public int countByCompanyId(long companyId)
417         throws com.liferay.portal.SystemException;
418 
419     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
420     public int countByUserId(long userId)
421         throws com.liferay.portal.SystemException;
422 
423     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
424     public int countByMirrorActivityId(long mirrorActivityId)
425         throws com.liferay.portal.SystemException;
426 
427     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
428     public int countByClassNameId(long classNameId)
429         throws com.liferay.portal.SystemException;
430 
431     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
432     public int countByReceiverUserId(long receiverUserId)
433         throws com.liferay.portal.SystemException;
434 
435     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
436     public int countByC_C(long classNameId, long classPK)
437         throws com.liferay.portal.SystemException;
438 
439     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
440     public int countByM_C_C(long mirrorActivityId, long classNameId,
441         long classPK) throws com.liferay.portal.SystemException;
442 
443     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
444     public int countByG_U_CD_C_C_T_R(long groupId, long userId,
445         java.util.Date createDate, long classNameId, long classPK, int type,
446         long receiverUserId) throws com.liferay.portal.SystemException;
447 
448     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
449     public int countAll() throws com.liferay.portal.SystemException;
450 
451     public void registerListener(
452         com.liferay.portal.model.ModelListener listener);
453 
454     public void unregisterListener(
455         com.liferay.portal.model.ModelListener listener);
456 }