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