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="SocialRelationPersistence.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 SocialRelationPersistence {
39      public com.liferay.portlet.social.model.SocialRelation create(
40          long relationId);
41  
42      public com.liferay.portlet.social.model.SocialRelation remove(
43          long relationId)
44          throws com.liferay.portal.SystemException,
45              com.liferay.portlet.social.NoSuchRelationException;
46  
47      public com.liferay.portlet.social.model.SocialRelation remove(
48          com.liferay.portlet.social.model.SocialRelation socialRelation)
49          throws com.liferay.portal.SystemException;
50  
51      /**
52       * @deprecated Use <code>update(SocialRelation socialRelation, boolean merge)</code>.
53       */
54      public com.liferay.portlet.social.model.SocialRelation update(
55          com.liferay.portlet.social.model.SocialRelation socialRelation)
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        socialRelation 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 socialRelation 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.SocialRelation update(
72          com.liferay.portlet.social.model.SocialRelation socialRelation,
73          boolean merge) throws com.liferay.portal.SystemException;
74  
75      public com.liferay.portlet.social.model.SocialRelation updateImpl(
76          com.liferay.portlet.social.model.SocialRelation socialRelation,
77          boolean merge) throws com.liferay.portal.SystemException;
78  
79      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
80      public com.liferay.portlet.social.model.SocialRelation findByPrimaryKey(
81          long relationId)
82          throws com.liferay.portal.SystemException,
83              com.liferay.portlet.social.NoSuchRelationException;
84  
85      public com.liferay.portlet.social.model.SocialRelation fetchByPrimaryKey(
86          long relationId) throws com.liferay.portal.SystemException;
87  
88      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
89      public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUuid(
90          java.lang.String uuid) throws com.liferay.portal.SystemException;
91  
92      @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
93      public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUuid(
94          java.lang.String uuid, 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.SocialRelation> findByUuid(
99          java.lang.String uuid, 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.SocialRelation findByUuid_First(
105         java.lang.String uuid,
106         com.liferay.portal.kernel.util.OrderByComparator obc)
107         throws com.liferay.portal.SystemException,
108             com.liferay.portlet.social.NoSuchRelationException;
109 
110     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
111     public com.liferay.portlet.social.model.SocialRelation findByUuid_Last(
112         java.lang.String uuid,
113         com.liferay.portal.kernel.util.OrderByComparator obc)
114         throws com.liferay.portal.SystemException,
115             com.liferay.portlet.social.NoSuchRelationException;
116 
117     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
118     public com.liferay.portlet.social.model.SocialRelation[] findByUuid_PrevAndNext(
119         long relationId, java.lang.String uuid,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException,
122             com.liferay.portlet.social.NoSuchRelationException;
123 
124     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
125     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByCompanyId(
126         long companyId) throws com.liferay.portal.SystemException;
127 
128     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
129     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByCompanyId(
130         long companyId, int start, int end)
131         throws com.liferay.portal.SystemException;
132 
133     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
134     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByCompanyId(
135         long companyId, int start, int end,
136         com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException;
138 
139     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
140     public com.liferay.portlet.social.model.SocialRelation findByCompanyId_First(
141         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.social.NoSuchRelationException;
144 
145     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
146     public com.liferay.portlet.social.model.SocialRelation findByCompanyId_Last(
147         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
148         throws com.liferay.portal.SystemException,
149             com.liferay.portlet.social.NoSuchRelationException;
150 
151     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
152     public com.liferay.portlet.social.model.SocialRelation[] findByCompanyId_PrevAndNext(
153         long relationId, long companyId,
154         com.liferay.portal.kernel.util.OrderByComparator obc)
155         throws com.liferay.portal.SystemException,
156             com.liferay.portlet.social.NoSuchRelationException;
157 
158     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
159     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId1(
160         long userId1) throws com.liferay.portal.SystemException;
161 
162     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
163     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId1(
164         long userId1, int start, int end)
165         throws com.liferay.portal.SystemException;
166 
167     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
168     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId1(
169         long userId1, int start, int end,
170         com.liferay.portal.kernel.util.OrderByComparator obc)
171         throws com.liferay.portal.SystemException;
172 
173     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
174     public com.liferay.portlet.social.model.SocialRelation findByUserId1_First(
175         long userId1, com.liferay.portal.kernel.util.OrderByComparator obc)
176         throws com.liferay.portal.SystemException,
177             com.liferay.portlet.social.NoSuchRelationException;
178 
179     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
180     public com.liferay.portlet.social.model.SocialRelation findByUserId1_Last(
181         long userId1, com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.SystemException,
183             com.liferay.portlet.social.NoSuchRelationException;
184 
185     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
186     public com.liferay.portlet.social.model.SocialRelation[] findByUserId1_PrevAndNext(
187         long relationId, long userId1,
188         com.liferay.portal.kernel.util.OrderByComparator obc)
189         throws com.liferay.portal.SystemException,
190             com.liferay.portlet.social.NoSuchRelationException;
191 
192     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
193     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId2(
194         long userId2) throws com.liferay.portal.SystemException;
195 
196     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
197     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId2(
198         long userId2, int start, int end)
199         throws com.liferay.portal.SystemException;
200 
201     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
202     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId2(
203         long userId2, int start, int end,
204         com.liferay.portal.kernel.util.OrderByComparator obc)
205         throws com.liferay.portal.SystemException;
206 
207     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
208     public com.liferay.portlet.social.model.SocialRelation findByUserId2_First(
209         long userId2, com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.SystemException,
211             com.liferay.portlet.social.NoSuchRelationException;
212 
213     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
214     public com.liferay.portlet.social.model.SocialRelation findByUserId2_Last(
215         long userId2, com.liferay.portal.kernel.util.OrderByComparator obc)
216         throws com.liferay.portal.SystemException,
217             com.liferay.portlet.social.NoSuchRelationException;
218 
219     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
220     public com.liferay.portlet.social.model.SocialRelation[] findByUserId2_PrevAndNext(
221         long relationId, long userId2,
222         com.liferay.portal.kernel.util.OrderByComparator obc)
223         throws com.liferay.portal.SystemException,
224             com.liferay.portlet.social.NoSuchRelationException;
225 
226     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
227     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByType(
228         int type) throws com.liferay.portal.SystemException;
229 
230     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
231     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByType(
232         int type, int start, int end) throws com.liferay.portal.SystemException;
233 
234     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
235     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByType(
236         int type, int start, int end,
237         com.liferay.portal.kernel.util.OrderByComparator obc)
238         throws com.liferay.portal.SystemException;
239 
240     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
241     public com.liferay.portlet.social.model.SocialRelation findByType_First(
242         int type, com.liferay.portal.kernel.util.OrderByComparator obc)
243         throws com.liferay.portal.SystemException,
244             com.liferay.portlet.social.NoSuchRelationException;
245 
246     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
247     public com.liferay.portlet.social.model.SocialRelation findByType_Last(
248         int type, com.liferay.portal.kernel.util.OrderByComparator obc)
249         throws com.liferay.portal.SystemException,
250             com.liferay.portlet.social.NoSuchRelationException;
251 
252     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
253     public com.liferay.portlet.social.model.SocialRelation[] findByType_PrevAndNext(
254         long relationId, int type,
255         com.liferay.portal.kernel.util.OrderByComparator obc)
256         throws com.liferay.portal.SystemException,
257             com.liferay.portlet.social.NoSuchRelationException;
258 
259     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
260     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByC_T(
261         long companyId, int type) throws com.liferay.portal.SystemException;
262 
263     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
264     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByC_T(
265         long companyId, int type, int start, int end)
266         throws com.liferay.portal.SystemException;
267 
268     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
269     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByC_T(
270         long companyId, int type, int start, int end,
271         com.liferay.portal.kernel.util.OrderByComparator obc)
272         throws com.liferay.portal.SystemException;
273 
274     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
275     public com.liferay.portlet.social.model.SocialRelation findByC_T_First(
276         long companyId, int type,
277         com.liferay.portal.kernel.util.OrderByComparator obc)
278         throws com.liferay.portal.SystemException,
279             com.liferay.portlet.social.NoSuchRelationException;
280 
281     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
282     public com.liferay.portlet.social.model.SocialRelation findByC_T_Last(
283         long companyId, int type,
284         com.liferay.portal.kernel.util.OrderByComparator obc)
285         throws com.liferay.portal.SystemException,
286             com.liferay.portlet.social.NoSuchRelationException;
287 
288     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
289     public com.liferay.portlet.social.model.SocialRelation[] findByC_T_PrevAndNext(
290         long relationId, long companyId, int type,
291         com.liferay.portal.kernel.util.OrderByComparator obc)
292         throws com.liferay.portal.SystemException,
293             com.liferay.portlet.social.NoSuchRelationException;
294 
295     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
296     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU1_T(
297         long userId1, int type) throws com.liferay.portal.SystemException;
298 
299     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
300     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU1_T(
301         long userId1, int type, int start, int end)
302         throws com.liferay.portal.SystemException;
303 
304     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
305     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU1_T(
306         long userId1, int type, int start, int end,
307         com.liferay.portal.kernel.util.OrderByComparator obc)
308         throws com.liferay.portal.SystemException;
309 
310     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
311     public com.liferay.portlet.social.model.SocialRelation findByU1_T_First(
312         long userId1, int type,
313         com.liferay.portal.kernel.util.OrderByComparator obc)
314         throws com.liferay.portal.SystemException,
315             com.liferay.portlet.social.NoSuchRelationException;
316 
317     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
318     public com.liferay.portlet.social.model.SocialRelation findByU1_T_Last(
319         long userId1, int type,
320         com.liferay.portal.kernel.util.OrderByComparator obc)
321         throws com.liferay.portal.SystemException,
322             com.liferay.portlet.social.NoSuchRelationException;
323 
324     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
325     public com.liferay.portlet.social.model.SocialRelation[] findByU1_T_PrevAndNext(
326         long relationId, long userId1, int type,
327         com.liferay.portal.kernel.util.OrderByComparator obc)
328         throws com.liferay.portal.SystemException,
329             com.liferay.portlet.social.NoSuchRelationException;
330 
331     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
332     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU2_T(
333         long userId2, int type) throws com.liferay.portal.SystemException;
334 
335     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
336     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU2_T(
337         long userId2, int type, int start, int end)
338         throws com.liferay.portal.SystemException;
339 
340     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
341     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU2_T(
342         long userId2, int type, int start, int end,
343         com.liferay.portal.kernel.util.OrderByComparator obc)
344         throws com.liferay.portal.SystemException;
345 
346     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
347     public com.liferay.portlet.social.model.SocialRelation findByU2_T_First(
348         long userId2, int type,
349         com.liferay.portal.kernel.util.OrderByComparator obc)
350         throws com.liferay.portal.SystemException,
351             com.liferay.portlet.social.NoSuchRelationException;
352 
353     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
354     public com.liferay.portlet.social.model.SocialRelation findByU2_T_Last(
355         long userId2, int type,
356         com.liferay.portal.kernel.util.OrderByComparator obc)
357         throws com.liferay.portal.SystemException,
358             com.liferay.portlet.social.NoSuchRelationException;
359 
360     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
361     public com.liferay.portlet.social.model.SocialRelation[] findByU2_T_PrevAndNext(
362         long relationId, long userId2, int type,
363         com.liferay.portal.kernel.util.OrderByComparator obc)
364         throws com.liferay.portal.SystemException,
365             com.liferay.portlet.social.NoSuchRelationException;
366 
367     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
368     public com.liferay.portlet.social.model.SocialRelation findByU1_U2_T(
369         long userId1, long userId2, int type)
370         throws com.liferay.portal.SystemException,
371             com.liferay.portlet.social.NoSuchRelationException;
372 
373     public com.liferay.portlet.social.model.SocialRelation fetchByU1_U2_T(
374         long userId1, long userId2, int type)
375         throws com.liferay.portal.SystemException;
376 
377     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
378     public java.util.List<Object> findWithDynamicQuery(
379         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
380         throws com.liferay.portal.SystemException;
381 
382     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
383     public java.util.List<Object> findWithDynamicQuery(
384         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
385         int end) throws com.liferay.portal.SystemException;
386 
387     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
388     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findAll()
389         throws com.liferay.portal.SystemException;
390 
391     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
392     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findAll(
393         int start, int end) throws com.liferay.portal.SystemException;
394 
395     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
396     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findAll(
397         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
398         throws com.liferay.portal.SystemException;
399 
400     public void removeByUuid(java.lang.String uuid)
401         throws com.liferay.portal.SystemException;
402 
403     public void removeByCompanyId(long companyId)
404         throws com.liferay.portal.SystemException;
405 
406     public void removeByUserId1(long userId1)
407         throws com.liferay.portal.SystemException;
408 
409     public void removeByUserId2(long userId2)
410         throws com.liferay.portal.SystemException;
411 
412     public void removeByType(int type)
413         throws com.liferay.portal.SystemException;
414 
415     public void removeByC_T(long companyId, int type)
416         throws com.liferay.portal.SystemException;
417 
418     public void removeByU1_T(long userId1, int type)
419         throws com.liferay.portal.SystemException;
420 
421     public void removeByU2_T(long userId2, int type)
422         throws com.liferay.portal.SystemException;
423 
424     public void removeByU1_U2_T(long userId1, long userId2, int type)
425         throws com.liferay.portal.SystemException,
426             com.liferay.portlet.social.NoSuchRelationException;
427 
428     public void removeAll() throws com.liferay.portal.SystemException;
429 
430     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
431     public int countByUuid(java.lang.String uuid)
432         throws com.liferay.portal.SystemException;
433 
434     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
435     public int countByCompanyId(long companyId)
436         throws com.liferay.portal.SystemException;
437 
438     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
439     public int countByUserId1(long userId1)
440         throws com.liferay.portal.SystemException;
441 
442     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
443     public int countByUserId2(long userId2)
444         throws com.liferay.portal.SystemException;
445 
446     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
447     public int countByType(int type) throws com.liferay.portal.SystemException;
448 
449     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
450     public int countByC_T(long companyId, int type)
451         throws com.liferay.portal.SystemException;
452 
453     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
454     public int countByU1_T(long userId1, int type)
455         throws com.liferay.portal.SystemException;
456 
457     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
458     public int countByU2_T(long userId2, int type)
459         throws com.liferay.portal.SystemException;
460 
461     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
462     public int countByU1_U2_T(long userId1, long userId2, int type)
463         throws com.liferay.portal.SystemException;
464 
465     @Transactional(propagation = Propagation.SUPPORTS, readOnly = true)
466     public int countAll() throws com.liferay.portal.SystemException;
467 
468     public void registerListener(
469         com.liferay.portal.model.ModelListener listener);
470 
471     public void unregisterListener(
472         com.liferay.portal.model.ModelListener listener);
473 }