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