1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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.base;
24  
25  import com.liferay.counter.service.CounterLocalService;
26  import com.liferay.counter.service.CounterService;
27  
28  import com.liferay.portal.PortalException;
29  import com.liferay.portal.SystemException;
30  import com.liferay.portal.kernel.annotation.BeanReference;
31  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
32  import com.liferay.portal.service.ResourceLocalService;
33  import com.liferay.portal.service.ResourceService;
34  import com.liferay.portal.service.UserLocalService;
35  import com.liferay.portal.service.UserService;
36  import com.liferay.portal.service.persistence.ResourceFinder;
37  import com.liferay.portal.service.persistence.ResourcePersistence;
38  import com.liferay.portal.service.persistence.UserFinder;
39  import com.liferay.portal.service.persistence.UserPersistence;
40  import com.liferay.portal.util.PortalUtil;
41  
42  import com.liferay.portlet.social.model.SocialRelation;
43  import com.liferay.portlet.social.service.SocialActivityInterpreterLocalService;
44  import com.liferay.portlet.social.service.SocialActivityLocalService;
45  import com.liferay.portlet.social.service.SocialRelationLocalService;
46  import com.liferay.portlet.social.service.SocialRequestInterpreterLocalService;
47  import com.liferay.portlet.social.service.SocialRequestLocalService;
48  import com.liferay.portlet.social.service.persistence.SocialActivityFinder;
49  import com.liferay.portlet.social.service.persistence.SocialActivityPersistence;
50  import com.liferay.portlet.social.service.persistence.SocialRelationPersistence;
51  import com.liferay.portlet.social.service.persistence.SocialRequestPersistence;
52  
53  import java.util.List;
54  
55  /**
56   * <a href="SocialRelationLocalServiceBaseImpl.java.html"><b><i>View Source</i>
57   * </b></a>
58   *
59   * @author Brian Wing Shun Chan
60   */
61  public abstract class SocialRelationLocalServiceBaseImpl
62      implements SocialRelationLocalService {
63      public SocialRelation addSocialRelation(SocialRelation socialRelation)
64          throws SystemException {
65          socialRelation.setNew(true);
66  
67          return socialRelationPersistence.update(socialRelation, false);
68      }
69  
70      public SocialRelation createSocialRelation(long relationId) {
71          return socialRelationPersistence.create(relationId);
72      }
73  
74      public void deleteSocialRelation(long relationId)
75          throws PortalException, SystemException {
76          socialRelationPersistence.remove(relationId);
77      }
78  
79      public void deleteSocialRelation(SocialRelation socialRelation)
80          throws SystemException {
81          socialRelationPersistence.remove(socialRelation);
82      }
83  
84      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
85          throws SystemException {
86          return socialRelationPersistence.findWithDynamicQuery(dynamicQuery);
87      }
88  
89      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
90          int end) throws SystemException {
91          return socialRelationPersistence.findWithDynamicQuery(dynamicQuery,
92              start, end);
93      }
94  
95      public SocialRelation getSocialRelation(long relationId)
96          throws PortalException, SystemException {
97          return socialRelationPersistence.findByPrimaryKey(relationId);
98      }
99  
100     public List<SocialRelation> getSocialRelations(int start, int end)
101         throws SystemException {
102         return socialRelationPersistence.findAll(start, end);
103     }
104 
105     public int getSocialRelationsCount() throws SystemException {
106         return socialRelationPersistence.countAll();
107     }
108 
109     public SocialRelation updateSocialRelation(SocialRelation socialRelation)
110         throws SystemException {
111         socialRelation.setNew(false);
112 
113         return socialRelationPersistence.update(socialRelation, true);
114     }
115 
116     public SocialRelation updateSocialRelation(SocialRelation socialRelation,
117         boolean merge) throws SystemException {
118         socialRelation.setNew(false);
119 
120         return socialRelationPersistence.update(socialRelation, merge);
121     }
122 
123     public SocialActivityLocalService getSocialActivityLocalService() {
124         return socialActivityLocalService;
125     }
126 
127     public void setSocialActivityLocalService(
128         SocialActivityLocalService socialActivityLocalService) {
129         this.socialActivityLocalService = socialActivityLocalService;
130     }
131 
132     public SocialActivityPersistence getSocialActivityPersistence() {
133         return socialActivityPersistence;
134     }
135 
136     public void setSocialActivityPersistence(
137         SocialActivityPersistence socialActivityPersistence) {
138         this.socialActivityPersistence = socialActivityPersistence;
139     }
140 
141     public SocialActivityFinder getSocialActivityFinder() {
142         return socialActivityFinder;
143     }
144 
145     public void setSocialActivityFinder(
146         SocialActivityFinder socialActivityFinder) {
147         this.socialActivityFinder = socialActivityFinder;
148     }
149 
150     public SocialActivityInterpreterLocalService getSocialActivityInterpreterLocalService() {
151         return socialActivityInterpreterLocalService;
152     }
153 
154     public void setSocialActivityInterpreterLocalService(
155         SocialActivityInterpreterLocalService socialActivityInterpreterLocalService) {
156         this.socialActivityInterpreterLocalService = socialActivityInterpreterLocalService;
157     }
158 
159     public SocialRelationLocalService getSocialRelationLocalService() {
160         return socialRelationLocalService;
161     }
162 
163     public void setSocialRelationLocalService(
164         SocialRelationLocalService socialRelationLocalService) {
165         this.socialRelationLocalService = socialRelationLocalService;
166     }
167 
168     public SocialRelationPersistence getSocialRelationPersistence() {
169         return socialRelationPersistence;
170     }
171 
172     public void setSocialRelationPersistence(
173         SocialRelationPersistence socialRelationPersistence) {
174         this.socialRelationPersistence = socialRelationPersistence;
175     }
176 
177     public SocialRequestLocalService getSocialRequestLocalService() {
178         return socialRequestLocalService;
179     }
180 
181     public void setSocialRequestLocalService(
182         SocialRequestLocalService socialRequestLocalService) {
183         this.socialRequestLocalService = socialRequestLocalService;
184     }
185 
186     public SocialRequestPersistence getSocialRequestPersistence() {
187         return socialRequestPersistence;
188     }
189 
190     public void setSocialRequestPersistence(
191         SocialRequestPersistence socialRequestPersistence) {
192         this.socialRequestPersistence = socialRequestPersistence;
193     }
194 
195     public SocialRequestInterpreterLocalService getSocialRequestInterpreterLocalService() {
196         return socialRequestInterpreterLocalService;
197     }
198 
199     public void setSocialRequestInterpreterLocalService(
200         SocialRequestInterpreterLocalService socialRequestInterpreterLocalService) {
201         this.socialRequestInterpreterLocalService = socialRequestInterpreterLocalService;
202     }
203 
204     public CounterLocalService getCounterLocalService() {
205         return counterLocalService;
206     }
207 
208     public void setCounterLocalService(CounterLocalService counterLocalService) {
209         this.counterLocalService = counterLocalService;
210     }
211 
212     public CounterService getCounterService() {
213         return counterService;
214     }
215 
216     public void setCounterService(CounterService counterService) {
217         this.counterService = counterService;
218     }
219 
220     public ResourceLocalService getResourceLocalService() {
221         return resourceLocalService;
222     }
223 
224     public void setResourceLocalService(
225         ResourceLocalService resourceLocalService) {
226         this.resourceLocalService = resourceLocalService;
227     }
228 
229     public ResourceService getResourceService() {
230         return resourceService;
231     }
232 
233     public void setResourceService(ResourceService resourceService) {
234         this.resourceService = resourceService;
235     }
236 
237     public ResourcePersistence getResourcePersistence() {
238         return resourcePersistence;
239     }
240 
241     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
242         this.resourcePersistence = resourcePersistence;
243     }
244 
245     public ResourceFinder getResourceFinder() {
246         return resourceFinder;
247     }
248 
249     public void setResourceFinder(ResourceFinder resourceFinder) {
250         this.resourceFinder = resourceFinder;
251     }
252 
253     public UserLocalService getUserLocalService() {
254         return userLocalService;
255     }
256 
257     public void setUserLocalService(UserLocalService userLocalService) {
258         this.userLocalService = userLocalService;
259     }
260 
261     public UserService getUserService() {
262         return userService;
263     }
264 
265     public void setUserService(UserService userService) {
266         this.userService = userService;
267     }
268 
269     public UserPersistence getUserPersistence() {
270         return userPersistence;
271     }
272 
273     public void setUserPersistence(UserPersistence userPersistence) {
274         this.userPersistence = userPersistence;
275     }
276 
277     public UserFinder getUserFinder() {
278         return userFinder;
279     }
280 
281     public void setUserFinder(UserFinder userFinder) {
282         this.userFinder = userFinder;
283     }
284 
285     protected void runSQL(String sql) throws SystemException {
286         try {
287             PortalUtil.runSQL(sql);
288         }
289         catch (Exception e) {
290             throw new SystemException(e);
291         }
292     }
293 
294     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityLocalService.impl")
295     protected SocialActivityLocalService socialActivityLocalService;
296     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityPersistence.impl")
297     protected SocialActivityPersistence socialActivityPersistence;
298     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityFinder.impl")
299     protected SocialActivityFinder socialActivityFinder;
300     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityInterpreterLocalService.impl")
301     protected SocialActivityInterpreterLocalService socialActivityInterpreterLocalService;
302     @BeanReference(name = "com.liferay.portlet.social.service.SocialRelationLocalService.impl")
303     protected SocialRelationLocalService socialRelationLocalService;
304     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRelationPersistence.impl")
305     protected SocialRelationPersistence socialRelationPersistence;
306     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestLocalService.impl")
307     protected SocialRequestLocalService socialRequestLocalService;
308     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRequestPersistence.impl")
309     protected SocialRequestPersistence socialRequestPersistence;
310     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestInterpreterLocalService.impl")
311     protected SocialRequestInterpreterLocalService socialRequestInterpreterLocalService;
312     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
313     protected CounterLocalService counterLocalService;
314     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
315     protected CounterService counterService;
316     @BeanReference(name = "com.liferay.portal.service.ResourceLocalService.impl")
317     protected ResourceLocalService resourceLocalService;
318     @BeanReference(name = "com.liferay.portal.service.ResourceService.impl")
319     protected ResourceService resourceService;
320     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
321     protected ResourcePersistence resourcePersistence;
322     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceFinder.impl")
323     protected ResourceFinder resourceFinder;
324     @BeanReference(name = "com.liferay.portal.service.UserLocalService.impl")
325     protected UserLocalService userLocalService;
326     @BeanReference(name = "com.liferay.portal.service.UserService.impl")
327     protected UserService userService;
328     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
329     protected UserPersistence userPersistence;
330     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder.impl")
331     protected UserFinder userFinder;
332 }