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="SocialActivityUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class SocialActivityUtil {
32      public static com.liferay.portlet.social.model.SocialActivity create(
33          long activityId) {
34          return getPersistence().create(activityId);
35      }
36  
37      public static com.liferay.portlet.social.model.SocialActivity remove(
38          long activityId)
39          throws com.liferay.portal.SystemException,
40              com.liferay.portlet.social.NoSuchActivityException {
41          return getPersistence().remove(activityId);
42      }
43  
44      public static com.liferay.portlet.social.model.SocialActivity remove(
45          com.liferay.portlet.social.model.SocialActivity socialActivity)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(socialActivity);
48      }
49  
50      /**
51       * @deprecated Use <code>update(SocialActivity socialActivity, boolean merge)</code>.
52       */
53      public static com.liferay.portlet.social.model.SocialActivity update(
54          com.liferay.portlet.social.model.SocialActivity socialActivity)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().update(socialActivity);
57      }
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        socialActivity 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 socialActivity 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 static com.liferay.portlet.social.model.SocialActivity update(
73          com.liferay.portlet.social.model.SocialActivity socialActivity,
74          boolean merge) throws com.liferay.portal.SystemException {
75          return getPersistence().update(socialActivity, merge);
76      }
77  
78      public static com.liferay.portlet.social.model.SocialActivity updateImpl(
79          com.liferay.portlet.social.model.SocialActivity socialActivity,
80          boolean merge) throws com.liferay.portal.SystemException {
81          return getPersistence().updateImpl(socialActivity, merge);
82      }
83  
84      public static com.liferay.portlet.social.model.SocialActivity findByPrimaryKey(
85          long activityId)
86          throws com.liferay.portal.SystemException,
87              com.liferay.portlet.social.NoSuchActivityException {
88          return getPersistence().findByPrimaryKey(activityId);
89      }
90  
91      public static com.liferay.portlet.social.model.SocialActivity fetchByPrimaryKey(
92          long activityId) throws com.liferay.portal.SystemException {
93          return getPersistence().fetchByPrimaryKey(activityId);
94      }
95  
96      public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
97          long groupId) throws com.liferay.portal.SystemException {
98          return getPersistence().findByGroupId(groupId);
99      }
100 
101     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
102         long groupId, int begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByGroupId(groupId, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByGroupId(
108         long groupId, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByGroupId(groupId, begin, end, obc);
112     }
113 
114     public static com.liferay.portlet.social.model.SocialActivity findByGroupId_First(
115         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
116         throws com.liferay.portal.SystemException,
117             com.liferay.portlet.social.NoSuchActivityException {
118         return getPersistence().findByGroupId_First(groupId, obc);
119     }
120 
121     public static com.liferay.portlet.social.model.SocialActivity findByGroupId_Last(
122         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
123         throws com.liferay.portal.SystemException,
124             com.liferay.portlet.social.NoSuchActivityException {
125         return getPersistence().findByGroupId_Last(groupId, obc);
126     }
127 
128     public static com.liferay.portlet.social.model.SocialActivity[] findByGroupId_PrevAndNext(
129         long activityId, long groupId,
130         com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.SystemException,
132             com.liferay.portlet.social.NoSuchActivityException {
133         return getPersistence()
134                    .findByGroupId_PrevAndNext(activityId, groupId, obc);
135     }
136 
137     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByCompanyId(
138         long companyId) throws com.liferay.portal.SystemException {
139         return getPersistence().findByCompanyId(companyId);
140     }
141 
142     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByCompanyId(
143         long companyId, int begin, int end)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findByCompanyId(companyId, begin, end);
146     }
147 
148     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByCompanyId(
149         long companyId, int begin, int end,
150         com.liferay.portal.kernel.util.OrderByComparator obc)
151         throws com.liferay.portal.SystemException {
152         return getPersistence().findByCompanyId(companyId, begin, end, obc);
153     }
154 
155     public static com.liferay.portlet.social.model.SocialActivity findByCompanyId_First(
156         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
157         throws com.liferay.portal.SystemException,
158             com.liferay.portlet.social.NoSuchActivityException {
159         return getPersistence().findByCompanyId_First(companyId, obc);
160     }
161 
162     public static com.liferay.portlet.social.model.SocialActivity findByCompanyId_Last(
163         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
164         throws com.liferay.portal.SystemException,
165             com.liferay.portlet.social.NoSuchActivityException {
166         return getPersistence().findByCompanyId_Last(companyId, obc);
167     }
168 
169     public static com.liferay.portlet.social.model.SocialActivity[] findByCompanyId_PrevAndNext(
170         long activityId, long companyId,
171         com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portlet.social.NoSuchActivityException {
174         return getPersistence()
175                    .findByCompanyId_PrevAndNext(activityId, companyId, obc);
176     }
177 
178     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserId(
179         long userId) throws com.liferay.portal.SystemException {
180         return getPersistence().findByUserId(userId);
181     }
182 
183     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserId(
184         long userId, int begin, int end)
185         throws com.liferay.portal.SystemException {
186         return getPersistence().findByUserId(userId, begin, end);
187     }
188 
189     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByUserId(
190         long userId, int begin, int end,
191         com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.SystemException {
193         return getPersistence().findByUserId(userId, begin, end, obc);
194     }
195 
196     public static com.liferay.portlet.social.model.SocialActivity findByUserId_First(
197         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
198         throws com.liferay.portal.SystemException,
199             com.liferay.portlet.social.NoSuchActivityException {
200         return getPersistence().findByUserId_First(userId, obc);
201     }
202 
203     public static com.liferay.portlet.social.model.SocialActivity findByUserId_Last(
204         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
205         throws com.liferay.portal.SystemException,
206             com.liferay.portlet.social.NoSuchActivityException {
207         return getPersistence().findByUserId_Last(userId, obc);
208     }
209 
210     public static com.liferay.portlet.social.model.SocialActivity[] findByUserId_PrevAndNext(
211         long activityId, long userId,
212         com.liferay.portal.kernel.util.OrderByComparator obc)
213         throws com.liferay.portal.SystemException,
214             com.liferay.portlet.social.NoSuchActivityException {
215         return getPersistence().findByUserId_PrevAndNext(activityId, userId, obc);
216     }
217 
218     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByReceiverUserId(
219         long receiverUserId) throws com.liferay.portal.SystemException {
220         return getPersistence().findByReceiverUserId(receiverUserId);
221     }
222 
223     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByReceiverUserId(
224         long receiverUserId, int begin, int end)
225         throws com.liferay.portal.SystemException {
226         return getPersistence().findByReceiverUserId(receiverUserId, begin, end);
227     }
228 
229     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByReceiverUserId(
230         long receiverUserId, int begin, int end,
231         com.liferay.portal.kernel.util.OrderByComparator obc)
232         throws com.liferay.portal.SystemException {
233         return getPersistence()
234                    .findByReceiverUserId(receiverUserId, begin, end, obc);
235     }
236 
237     public static com.liferay.portlet.social.model.SocialActivity findByReceiverUserId_First(
238         long receiverUserId,
239         com.liferay.portal.kernel.util.OrderByComparator obc)
240         throws com.liferay.portal.SystemException,
241             com.liferay.portlet.social.NoSuchActivityException {
242         return getPersistence().findByReceiverUserId_First(receiverUserId, obc);
243     }
244 
245     public static com.liferay.portlet.social.model.SocialActivity findByReceiverUserId_Last(
246         long receiverUserId,
247         com.liferay.portal.kernel.util.OrderByComparator obc)
248         throws com.liferay.portal.SystemException,
249             com.liferay.portlet.social.NoSuchActivityException {
250         return getPersistence().findByReceiverUserId_Last(receiverUserId, obc);
251     }
252 
253     public static com.liferay.portlet.social.model.SocialActivity[] findByReceiverUserId_PrevAndNext(
254         long activityId, long receiverUserId,
255         com.liferay.portal.kernel.util.OrderByComparator obc)
256         throws com.liferay.portal.SystemException,
257             com.liferay.portlet.social.NoSuchActivityException {
258         return getPersistence()
259                    .findByReceiverUserId_PrevAndNext(activityId,
260             receiverUserId, obc);
261     }
262 
263     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByC_C(
264         long classNameId, long classPK)
265         throws com.liferay.portal.SystemException {
266         return getPersistence().findByC_C(classNameId, classPK);
267     }
268 
269     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByC_C(
270         long classNameId, long classPK, int begin, int end)
271         throws com.liferay.portal.SystemException {
272         return getPersistence().findByC_C(classNameId, classPK, begin, end);
273     }
274 
275     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findByC_C(
276         long classNameId, long classPK, int begin, int end,
277         com.liferay.portal.kernel.util.OrderByComparator obc)
278         throws com.liferay.portal.SystemException {
279         return getPersistence().findByC_C(classNameId, classPK, begin, end, obc);
280     }
281 
282     public static com.liferay.portlet.social.model.SocialActivity findByC_C_First(
283         long classNameId, long classPK,
284         com.liferay.portal.kernel.util.OrderByComparator obc)
285         throws com.liferay.portal.SystemException,
286             com.liferay.portlet.social.NoSuchActivityException {
287         return getPersistence().findByC_C_First(classNameId, classPK, obc);
288     }
289 
290     public static com.liferay.portlet.social.model.SocialActivity findByC_C_Last(
291         long classNameId, long classPK,
292         com.liferay.portal.kernel.util.OrderByComparator obc)
293         throws com.liferay.portal.SystemException,
294             com.liferay.portlet.social.NoSuchActivityException {
295         return getPersistence().findByC_C_Last(classNameId, classPK, obc);
296     }
297 
298     public static com.liferay.portlet.social.model.SocialActivity[] findByC_C_PrevAndNext(
299         long activityId, long classNameId, long classPK,
300         com.liferay.portal.kernel.util.OrderByComparator obc)
301         throws com.liferay.portal.SystemException,
302             com.liferay.portlet.social.NoSuchActivityException {
303         return getPersistence()
304                    .findByC_C_PrevAndNext(activityId, classNameId, classPK, obc);
305     }
306 
307     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findWithDynamicQuery(
308         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
309         throws com.liferay.portal.SystemException {
310         return getPersistence().findWithDynamicQuery(queryInitializer);
311     }
312 
313     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findWithDynamicQuery(
314         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
315         int begin, int end) throws com.liferay.portal.SystemException {
316         return getPersistence()
317                    .findWithDynamicQuery(queryInitializer, begin, end);
318     }
319 
320     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findAll()
321         throws com.liferay.portal.SystemException {
322         return getPersistence().findAll();
323     }
324 
325     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findAll(
326         int begin, int end) throws com.liferay.portal.SystemException {
327         return getPersistence().findAll(begin, end);
328     }
329 
330     public static java.util.List<com.liferay.portlet.social.model.SocialActivity> findAll(
331         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
332         throws com.liferay.portal.SystemException {
333         return getPersistence().findAll(begin, end, obc);
334     }
335 
336     public static void removeByGroupId(long groupId)
337         throws com.liferay.portal.SystemException {
338         getPersistence().removeByGroupId(groupId);
339     }
340 
341     public static void removeByCompanyId(long companyId)
342         throws com.liferay.portal.SystemException {
343         getPersistence().removeByCompanyId(companyId);
344     }
345 
346     public static void removeByUserId(long userId)
347         throws com.liferay.portal.SystemException {
348         getPersistence().removeByUserId(userId);
349     }
350 
351     public static void removeByReceiverUserId(long receiverUserId)
352         throws com.liferay.portal.SystemException {
353         getPersistence().removeByReceiverUserId(receiverUserId);
354     }
355 
356     public static void removeByC_C(long classNameId, long classPK)
357         throws com.liferay.portal.SystemException {
358         getPersistence().removeByC_C(classNameId, classPK);
359     }
360 
361     public static void removeAll() throws com.liferay.portal.SystemException {
362         getPersistence().removeAll();
363     }
364 
365     public static int countByGroupId(long groupId)
366         throws com.liferay.portal.SystemException {
367         return getPersistence().countByGroupId(groupId);
368     }
369 
370     public static int countByCompanyId(long companyId)
371         throws com.liferay.portal.SystemException {
372         return getPersistence().countByCompanyId(companyId);
373     }
374 
375     public static int countByUserId(long userId)
376         throws com.liferay.portal.SystemException {
377         return getPersistence().countByUserId(userId);
378     }
379 
380     public static int countByReceiverUserId(long receiverUserId)
381         throws com.liferay.portal.SystemException {
382         return getPersistence().countByReceiverUserId(receiverUserId);
383     }
384 
385     public static int countByC_C(long classNameId, long classPK)
386         throws com.liferay.portal.SystemException {
387         return getPersistence().countByC_C(classNameId, classPK);
388     }
389 
390     public static int countAll() throws com.liferay.portal.SystemException {
391         return getPersistence().countAll();
392     }
393 
394     public static SocialActivityPersistence getPersistence() {
395         return _getUtil()._persistence;
396     }
397 
398     public void setPersistence(SocialActivityPersistence persistence) {
399         _persistence = persistence;
400     }
401 
402     private static SocialActivityUtil _getUtil() {
403         if (_util == null) {
404             _util = (SocialActivityUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
405         }
406 
407         return _util;
408     }
409 
410     private static final String _UTIL = SocialActivityUtil.class.getName();
411     private static SocialActivityUtil _util;
412     private SocialActivityPersistence _persistence;
413 }