1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.social.service.persistence;
21  
22  import com.liferay.portal.service.persistence.BasePersistence;
23  
24  /**
25   * <a href="SocialRelationPersistence.java.html"><b><i>View Source</i></b></a>
26   *
27   * @author Brian Wing Shun Chan
28   *
29   */
30  public interface SocialRelationPersistence extends BasePersistence {
31      public void cacheResult(
32          com.liferay.portlet.social.model.SocialRelation socialRelation);
33  
34      public void cacheResult(
35          java.util.List<com.liferay.portlet.social.model.SocialRelation> socialRelations);
36  
37      public void clearCache();
38  
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      public com.liferay.portlet.social.model.SocialRelation findByPrimaryKey(
80          long relationId)
81          throws com.liferay.portal.SystemException,
82              com.liferay.portlet.social.NoSuchRelationException;
83  
84      public com.liferay.portlet.social.model.SocialRelation fetchByPrimaryKey(
85          long relationId) throws com.liferay.portal.SystemException;
86  
87      public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUuid(
88          java.lang.String uuid) throws com.liferay.portal.SystemException;
89  
90      public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUuid(
91          java.lang.String uuid, int start, int end)
92          throws com.liferay.portal.SystemException;
93  
94      public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUuid(
95          java.lang.String uuid, int start, int end,
96          com.liferay.portal.kernel.util.OrderByComparator obc)
97          throws com.liferay.portal.SystemException;
98  
99      public com.liferay.portlet.social.model.SocialRelation findByUuid_First(
100         java.lang.String uuid,
101         com.liferay.portal.kernel.util.OrderByComparator obc)
102         throws com.liferay.portal.SystemException,
103             com.liferay.portlet.social.NoSuchRelationException;
104 
105     public com.liferay.portlet.social.model.SocialRelation findByUuid_Last(
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     public com.liferay.portlet.social.model.SocialRelation[] findByUuid_PrevAndNext(
112         long relationId, 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     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByCompanyId(
118         long companyId) throws com.liferay.portal.SystemException;
119 
120     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByCompanyId(
121         long companyId, int start, int end)
122         throws com.liferay.portal.SystemException;
123 
124     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByCompanyId(
125         long companyId, int start, int end,
126         com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.SystemException;
128 
129     public com.liferay.portlet.social.model.SocialRelation findByCompanyId_First(
130         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portlet.social.NoSuchRelationException;
133 
134     public com.liferay.portlet.social.model.SocialRelation findByCompanyId_Last(
135         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
136         throws com.liferay.portal.SystemException,
137             com.liferay.portlet.social.NoSuchRelationException;
138 
139     public com.liferay.portlet.social.model.SocialRelation[] findByCompanyId_PrevAndNext(
140         long relationId, long companyId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.social.NoSuchRelationException;
144 
145     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId1(
146         long userId1) throws com.liferay.portal.SystemException;
147 
148     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId1(
149         long userId1, int start, int end)
150         throws com.liferay.portal.SystemException;
151 
152     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId1(
153         long userId1, int start, int end,
154         com.liferay.portal.kernel.util.OrderByComparator obc)
155         throws com.liferay.portal.SystemException;
156 
157     public com.liferay.portlet.social.model.SocialRelation findByUserId1_First(
158         long userId1, com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.SystemException,
160             com.liferay.portlet.social.NoSuchRelationException;
161 
162     public com.liferay.portlet.social.model.SocialRelation findByUserId1_Last(
163         long userId1, com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.SystemException,
165             com.liferay.portlet.social.NoSuchRelationException;
166 
167     public com.liferay.portlet.social.model.SocialRelation[] findByUserId1_PrevAndNext(
168         long relationId, long userId1,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException,
171             com.liferay.portlet.social.NoSuchRelationException;
172 
173     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId2(
174         long userId2) throws com.liferay.portal.SystemException;
175 
176     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId2(
177         long userId2, int start, int end)
178         throws com.liferay.portal.SystemException;
179 
180     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByUserId2(
181         long userId2, int start, int end,
182         com.liferay.portal.kernel.util.OrderByComparator obc)
183         throws com.liferay.portal.SystemException;
184 
185     public com.liferay.portlet.social.model.SocialRelation findByUserId2_First(
186         long userId2, com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.SystemException,
188             com.liferay.portlet.social.NoSuchRelationException;
189 
190     public com.liferay.portlet.social.model.SocialRelation findByUserId2_Last(
191         long userId2, com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.SystemException,
193             com.liferay.portlet.social.NoSuchRelationException;
194 
195     public com.liferay.portlet.social.model.SocialRelation[] findByUserId2_PrevAndNext(
196         long relationId, long userId2,
197         com.liferay.portal.kernel.util.OrderByComparator obc)
198         throws com.liferay.portal.SystemException,
199             com.liferay.portlet.social.NoSuchRelationException;
200 
201     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByType(
202         int type) throws com.liferay.portal.SystemException;
203 
204     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByType(
205         int type, int start, int end) throws com.liferay.portal.SystemException;
206 
207     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByType(
208         int type, int start, int end,
209         com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.SystemException;
211 
212     public com.liferay.portlet.social.model.SocialRelation findByType_First(
213         int type, com.liferay.portal.kernel.util.OrderByComparator obc)
214         throws com.liferay.portal.SystemException,
215             com.liferay.portlet.social.NoSuchRelationException;
216 
217     public com.liferay.portlet.social.model.SocialRelation findByType_Last(
218         int type, com.liferay.portal.kernel.util.OrderByComparator obc)
219         throws com.liferay.portal.SystemException,
220             com.liferay.portlet.social.NoSuchRelationException;
221 
222     public com.liferay.portlet.social.model.SocialRelation[] findByType_PrevAndNext(
223         long relationId, int type,
224         com.liferay.portal.kernel.util.OrderByComparator obc)
225         throws com.liferay.portal.SystemException,
226             com.liferay.portlet.social.NoSuchRelationException;
227 
228     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByC_T(
229         long companyId, int type) throws com.liferay.portal.SystemException;
230 
231     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByC_T(
232         long companyId, int type, int start, int end)
233         throws com.liferay.portal.SystemException;
234 
235     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByC_T(
236         long companyId, int type, int start, int end,
237         com.liferay.portal.kernel.util.OrderByComparator obc)
238         throws com.liferay.portal.SystemException;
239 
240     public com.liferay.portlet.social.model.SocialRelation findByC_T_First(
241         long companyId, int type,
242         com.liferay.portal.kernel.util.OrderByComparator obc)
243         throws com.liferay.portal.SystemException,
244             com.liferay.portlet.social.NoSuchRelationException;
245 
246     public com.liferay.portlet.social.model.SocialRelation findByC_T_Last(
247         long companyId, int type,
248         com.liferay.portal.kernel.util.OrderByComparator obc)
249         throws com.liferay.portal.SystemException,
250             com.liferay.portlet.social.NoSuchRelationException;
251 
252     public com.liferay.portlet.social.model.SocialRelation[] findByC_T_PrevAndNext(
253         long relationId, long companyId, int type,
254         com.liferay.portal.kernel.util.OrderByComparator obc)
255         throws com.liferay.portal.SystemException,
256             com.liferay.portlet.social.NoSuchRelationException;
257 
258     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU1_T(
259         long userId1, int type) throws com.liferay.portal.SystemException;
260 
261     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU1_T(
262         long userId1, int type, int start, int end)
263         throws com.liferay.portal.SystemException;
264 
265     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU1_T(
266         long userId1, int type, int start, int end,
267         com.liferay.portal.kernel.util.OrderByComparator obc)
268         throws com.liferay.portal.SystemException;
269 
270     public com.liferay.portlet.social.model.SocialRelation findByU1_T_First(
271         long userId1, int type,
272         com.liferay.portal.kernel.util.OrderByComparator obc)
273         throws com.liferay.portal.SystemException,
274             com.liferay.portlet.social.NoSuchRelationException;
275 
276     public com.liferay.portlet.social.model.SocialRelation findByU1_T_Last(
277         long userId1, int type,
278         com.liferay.portal.kernel.util.OrderByComparator obc)
279         throws com.liferay.portal.SystemException,
280             com.liferay.portlet.social.NoSuchRelationException;
281 
282     public com.liferay.portlet.social.model.SocialRelation[] findByU1_T_PrevAndNext(
283         long relationId, long userId1, int type,
284         com.liferay.portal.kernel.util.OrderByComparator obc)
285         throws com.liferay.portal.SystemException,
286             com.liferay.portlet.social.NoSuchRelationException;
287 
288     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU2_T(
289         long userId2, int type) throws com.liferay.portal.SystemException;
290 
291     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU2_T(
292         long userId2, int type, int start, int end)
293         throws com.liferay.portal.SystemException;
294 
295     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findByU2_T(
296         long userId2, int type, int start, int end,
297         com.liferay.portal.kernel.util.OrderByComparator obc)
298         throws com.liferay.portal.SystemException;
299 
300     public com.liferay.portlet.social.model.SocialRelation findByU2_T_First(
301         long userId2, int type,
302         com.liferay.portal.kernel.util.OrderByComparator obc)
303         throws com.liferay.portal.SystemException,
304             com.liferay.portlet.social.NoSuchRelationException;
305 
306     public com.liferay.portlet.social.model.SocialRelation findByU2_T_Last(
307         long userId2, int type,
308         com.liferay.portal.kernel.util.OrderByComparator obc)
309         throws com.liferay.portal.SystemException,
310             com.liferay.portlet.social.NoSuchRelationException;
311 
312     public com.liferay.portlet.social.model.SocialRelation[] findByU2_T_PrevAndNext(
313         long relationId, long userId2, int type,
314         com.liferay.portal.kernel.util.OrderByComparator obc)
315         throws com.liferay.portal.SystemException,
316             com.liferay.portlet.social.NoSuchRelationException;
317 
318     public com.liferay.portlet.social.model.SocialRelation findByU1_U2_T(
319         long userId1, long userId2, int type)
320         throws com.liferay.portal.SystemException,
321             com.liferay.portlet.social.NoSuchRelationException;
322 
323     public com.liferay.portlet.social.model.SocialRelation fetchByU1_U2_T(
324         long userId1, long userId2, int type)
325         throws com.liferay.portal.SystemException;
326 
327     public com.liferay.portlet.social.model.SocialRelation fetchByU1_U2_T(
328         long userId1, long userId2, int type, boolean retrieveFromCache)
329         throws com.liferay.portal.SystemException;
330 
331     public java.util.List<Object> findWithDynamicQuery(
332         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
333         throws com.liferay.portal.SystemException;
334 
335     public java.util.List<Object> findWithDynamicQuery(
336         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
337         int end) throws com.liferay.portal.SystemException;
338 
339     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findAll()
340         throws com.liferay.portal.SystemException;
341 
342     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findAll(
343         int start, int end) throws com.liferay.portal.SystemException;
344 
345     public java.util.List<com.liferay.portlet.social.model.SocialRelation> findAll(
346         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
347         throws com.liferay.portal.SystemException;
348 
349     public void removeByUuid(java.lang.String uuid)
350         throws com.liferay.portal.SystemException;
351 
352     public void removeByCompanyId(long companyId)
353         throws com.liferay.portal.SystemException;
354 
355     public void removeByUserId1(long userId1)
356         throws com.liferay.portal.SystemException;
357 
358     public void removeByUserId2(long userId2)
359         throws com.liferay.portal.SystemException;
360 
361     public void removeByType(int type)
362         throws com.liferay.portal.SystemException;
363 
364     public void removeByC_T(long companyId, int type)
365         throws com.liferay.portal.SystemException;
366 
367     public void removeByU1_T(long userId1, int type)
368         throws com.liferay.portal.SystemException;
369 
370     public void removeByU2_T(long userId2, int type)
371         throws com.liferay.portal.SystemException;
372 
373     public void removeByU1_U2_T(long userId1, long userId2, int type)
374         throws com.liferay.portal.SystemException,
375             com.liferay.portlet.social.NoSuchRelationException;
376 
377     public void removeAll() throws com.liferay.portal.SystemException;
378 
379     public int countByUuid(java.lang.String uuid)
380         throws com.liferay.portal.SystemException;
381 
382     public int countByCompanyId(long companyId)
383         throws com.liferay.portal.SystemException;
384 
385     public int countByUserId1(long userId1)
386         throws com.liferay.portal.SystemException;
387 
388     public int countByUserId2(long userId2)
389         throws com.liferay.portal.SystemException;
390 
391     public int countByType(int type) throws com.liferay.portal.SystemException;
392 
393     public int countByC_T(long companyId, int type)
394         throws com.liferay.portal.SystemException;
395 
396     public int countByU1_T(long userId1, int type)
397         throws com.liferay.portal.SystemException;
398 
399     public int countByU2_T(long userId2, int type)
400         throws com.liferay.portal.SystemException;
401 
402     public int countByU1_U2_T(long userId1, long userId2, int type)
403         throws com.liferay.portal.SystemException;
404 
405     public int countAll() throws com.liferay.portal.SystemException;
406 }