1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.social.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.kernel.annotation.BeanReference;
21  import com.liferay.portal.kernel.dao.db.DB;
22  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
23  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
24  import com.liferay.portal.kernel.exception.PortalException;
25  import com.liferay.portal.kernel.exception.SystemException;
26  import com.liferay.portal.service.ResourceLocalService;
27  import com.liferay.portal.service.ResourceService;
28  import com.liferay.portal.service.UserLocalService;
29  import com.liferay.portal.service.UserService;
30  import com.liferay.portal.service.persistence.ResourceFinder;
31  import com.liferay.portal.service.persistence.ResourcePersistence;
32  import com.liferay.portal.service.persistence.UserFinder;
33  import com.liferay.portal.service.persistence.UserPersistence;
34  
35  import com.liferay.portlet.social.model.SocialRequest;
36  import com.liferay.portlet.social.service.SocialActivityInterpreterLocalService;
37  import com.liferay.portlet.social.service.SocialActivityLocalService;
38  import com.liferay.portlet.social.service.SocialRelationLocalService;
39  import com.liferay.portlet.social.service.SocialRequestInterpreterLocalService;
40  import com.liferay.portlet.social.service.SocialRequestLocalService;
41  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
42  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
43  import com.liferay.portlet.social.service.persistence.SocialRelationPersistence;
44  import com.liferay.portlet.social.service.persistence.SocialRequestPersistence;
45  
46  import java.util.List;
47  
48  /**
49   * <a href="SocialRequestLocalServiceBaseImpl.java.html"><b><i>View Source</i>
50   * </b></a>
51   *
52   * @author Brian Wing Shun Chan
53   */
54  public abstract class SocialRequestLocalServiceBaseImpl
55      implements SocialRequestLocalService {
56      public SocialRequest addSocialRequest(SocialRequest socialRequest)
57          throws SystemException {
58          socialRequest.setNew(true);
59  
60          return socialRequestPersistence.update(socialRequest, false);
61      }
62  
63      public SocialRequest createSocialRequest(long requestId) {
64          return socialRequestPersistence.create(requestId);
65      }
66  
67      public void deleteSocialRequest(long requestId)
68          throws PortalException, SystemException {
69          socialRequestPersistence.remove(requestId);
70      }
71  
72      public void deleteSocialRequest(SocialRequest socialRequest)
73          throws SystemException {
74          socialRequestPersistence.remove(socialRequest);
75      }
76  
77      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
78          throws SystemException {
79          return socialRequestPersistence.findWithDynamicQuery(dynamicQuery);
80      }
81  
82      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
83          int end) throws SystemException {
84          return socialRequestPersistence.findWithDynamicQuery(dynamicQuery,
85              start, end);
86      }
87  
88      public SocialRequest getSocialRequest(long requestId)
89          throws PortalException, SystemException {
90          return socialRequestPersistence.findByPrimaryKey(requestId);
91      }
92  
93      public List<SocialRequest> getSocialRequests(int start, int end)
94          throws SystemException {
95          return socialRequestPersistence.findAll(start, end);
96      }
97  
98      public int getSocialRequestsCount() throws SystemException {
99          return socialRequestPersistence.countAll();
100     }
101 
102     public SocialRequest updateSocialRequest(SocialRequest socialRequest)
103         throws SystemException {
104         socialRequest.setNew(false);
105 
106         return socialRequestPersistence.update(socialRequest, true);
107     }
108 
109     public SocialRequest updateSocialRequest(SocialRequest socialRequest,
110         boolean merge) throws SystemException {
111         socialRequest.setNew(false);
112 
113         return socialRequestPersistence.update(socialRequest, merge);
114     }
115 
116     public SocialActivityLocalService getSocialActivityLocalService() {
117         return socialActivityLocalService;
118     }
119 
120     public void setSocialActivityLocalService(
121         SocialActivityLocalService socialActivityLocalService) {
122         this.socialActivityLocalService = socialActivityLocalService;
123     }
124 
125     public SocialActivityPersistence getSocialActivityPersistence() {
126         return socialActivityPersistence;
127     }
128 
129     public void setSocialActivityPersistence(
130         SocialActivityPersistence socialActivityPersistence) {
131         this.socialActivityPersistence = socialActivityPersistence;
132     }
133 
134     public SocialActivityFinder getSocialActivityFinder() {
135         return socialActivityFinder;
136     }
137 
138     public void setSocialActivityFinder(
139         SocialActivityFinder socialActivityFinder) {
140         this.socialActivityFinder = socialActivityFinder;
141     }
142 
143     public SocialActivityInterpreterLocalService getSocialActivityInterpreterLocalService() {
144         return socialActivityInterpreterLocalService;
145     }
146 
147     public void setSocialActivityInterpreterLocalService(
148         SocialActivityInterpreterLocalService socialActivityInterpreterLocalService) {
149         this.socialActivityInterpreterLocalService = socialActivityInterpreterLocalService;
150     }
151 
152     public SocialRelationLocalService getSocialRelationLocalService() {
153         return socialRelationLocalService;
154     }
155 
156     public void setSocialRelationLocalService(
157         SocialRelationLocalService socialRelationLocalService) {
158         this.socialRelationLocalService = socialRelationLocalService;
159     }
160 
161     public SocialRelationPersistence getSocialRelationPersistence() {
162         return socialRelationPersistence;
163     }
164 
165     public void setSocialRelationPersistence(
166         SocialRelationPersistence socialRelationPersistence) {
167         this.socialRelationPersistence = socialRelationPersistence;
168     }
169 
170     public SocialRequestLocalService getSocialRequestLocalService() {
171         return socialRequestLocalService;
172     }
173 
174     public void setSocialRequestLocalService(
175         SocialRequestLocalService socialRequestLocalService) {
176         this.socialRequestLocalService = socialRequestLocalService;
177     }
178 
179     public SocialRequestPersistence getSocialRequestPersistence() {
180         return socialRequestPersistence;
181     }
182 
183     public void setSocialRequestPersistence(
184         SocialRequestPersistence socialRequestPersistence) {
185         this.socialRequestPersistence = socialRequestPersistence;
186     }
187 
188     public SocialRequestInterpreterLocalService getSocialRequestInterpreterLocalService() {
189         return socialRequestInterpreterLocalService;
190     }
191 
192     public void setSocialRequestInterpreterLocalService(
193         SocialRequestInterpreterLocalService socialRequestInterpreterLocalService) {
194         this.socialRequestInterpreterLocalService = socialRequestInterpreterLocalService;
195     }
196 
197     public CounterLocalService getCounterLocalService() {
198         return counterLocalService;
199     }
200 
201     public void setCounterLocalService(CounterLocalService counterLocalService) {
202         this.counterLocalService = counterLocalService;
203     }
204 
205     public CounterService getCounterService() {
206         return counterService;
207     }
208 
209     public void setCounterService(CounterService counterService) {
210         this.counterService = counterService;
211     }
212 
213     public ResourceLocalService getResourceLocalService() {
214         return resourceLocalService;
215     }
216 
217     public void setResourceLocalService(
218         ResourceLocalService resourceLocalService) {
219         this.resourceLocalService = resourceLocalService;
220     }
221 
222     public ResourceService getResourceService() {
223         return resourceService;
224     }
225 
226     public void setResourceService(ResourceService resourceService) {
227         this.resourceService = resourceService;
228     }
229 
230     public ResourcePersistence getResourcePersistence() {
231         return resourcePersistence;
232     }
233 
234     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
235         this.resourcePersistence = resourcePersistence;
236     }
237 
238     public ResourceFinder getResourceFinder() {
239         return resourceFinder;
240     }
241 
242     public void setResourceFinder(ResourceFinder resourceFinder) {
243         this.resourceFinder = resourceFinder;
244     }
245 
246     public UserLocalService getUserLocalService() {
247         return userLocalService;
248     }
249 
250     public void setUserLocalService(UserLocalService userLocalService) {
251         this.userLocalService = userLocalService;
252     }
253 
254     public UserService getUserService() {
255         return userService;
256     }
257 
258     public void setUserService(UserService userService) {
259         this.userService = userService;
260     }
261 
262     public UserPersistence getUserPersistence() {
263         return userPersistence;
264     }
265 
266     public void setUserPersistence(UserPersistence userPersistence) {
267         this.userPersistence = userPersistence;
268     }
269 
270     public UserFinder getUserFinder() {
271         return userFinder;
272     }
273 
274     public void setUserFinder(UserFinder userFinder) {
275         this.userFinder = userFinder;
276     }
277 
278     protected void runSQL(String sql) throws SystemException {
279         try {
280             DB db = DBFactoryUtil.getDB();
281 
282             db.runSQL(sql);
283         }
284         catch (Exception e) {
285             throw new SystemException(e);
286         }
287     }
288 
289     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityLocalService")
290     protected SocialActivityLocalService socialActivityLocalService;
291     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityPersistence")
292     protected SocialActivityPersistence socialActivityPersistence;
293     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityFinder")
294     protected SocialActivityFinder socialActivityFinder;
295     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityInterpreterLocalService")
296     protected SocialActivityInterpreterLocalService socialActivityInterpreterLocalService;
297     @BeanReference(name = "com.liferay.portlet.social.service.SocialRelationLocalService")
298     protected SocialRelationLocalService socialRelationLocalService;
299     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRelationPersistence")
300     protected SocialRelationPersistence socialRelationPersistence;
301     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestLocalService")
302     protected SocialRequestLocalService socialRequestLocalService;
303     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRequestPersistence")
304     protected SocialRequestPersistence socialRequestPersistence;
305     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestInterpreterLocalService")
306     protected SocialRequestInterpreterLocalService socialRequestInterpreterLocalService;
307     @BeanReference(name = "com.liferay.counter.service.CounterLocalService")
308     protected CounterLocalService counterLocalService;
309     @BeanReference(name = "com.liferay.counter.service.CounterService")
310     protected CounterService counterService;
311     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService")
312     protected ResourceLocalService resourceLocalService;
313     @BeanReference(name = "com.liferay.portal.service.ResourceService")
314     protected ResourceService resourceService;
315     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
316     protected ResourcePersistence resourcePersistence;
317     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder")
318     protected ResourceFinder resourceFinder;
319     @BeanReference(name = "com.liferay.portal.service.UserLocalService")
320     protected UserLocalService userLocalService;
321     @BeanReference(name = "com.liferay.portal.service.UserService")
322     protected UserService userService;
323     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
324     protected UserPersistence userPersistence;
325     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder")
326     protected UserFinder userFinder;
327 }