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.base;
21  
22  import com.liferay.counter.service.CounterLocalService;
23  import com.liferay.counter.service.CounterService;
24  
25  import com.liferay.portal.PortalException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.UserService;
31  import com.liferay.portal.service.persistence.UserFinder;
32  import com.liferay.portal.service.persistence.UserPersistence;
33  import com.liferay.portal.util.PortalUtil;
34  
35  import com.liferay.portlet.social.model.SocialRelation;
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="SocialRelationLocalServiceBaseImpl.java.html"><b><i>View Source</i></b></a>
50   *
51   * @author Brian Wing Shun Chan
52   *
53   */
54  public abstract class SocialRelationLocalServiceBaseImpl
55      implements SocialRelationLocalService {
56      public SocialRelation addSocialRelation(SocialRelation socialRelation)
57          throws SystemException {
58          socialRelation.setNew(true);
59  
60          return socialRelationPersistence.update(socialRelation, false);
61      }
62  
63      public SocialRelation createSocialRelation(long relationId) {
64          return socialRelationPersistence.create(relationId);
65      }
66  
67      public void deleteSocialRelation(long relationId)
68          throws PortalException, SystemException {
69          socialRelationPersistence.remove(relationId);
70      }
71  
72      public void deleteSocialRelation(SocialRelation socialRelation)
73          throws SystemException {
74          socialRelationPersistence.remove(socialRelation);
75      }
76  
77      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
78          throws SystemException {
79          return socialRelationPersistence.findWithDynamicQuery(dynamicQuery);
80      }
81  
82      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
83          int end) throws SystemException {
84          return socialRelationPersistence.findWithDynamicQuery(dynamicQuery,
85              start, end);
86      }
87  
88      public SocialRelation getSocialRelation(long relationId)
89          throws PortalException, SystemException {
90          return socialRelationPersistence.findByPrimaryKey(relationId);
91      }
92  
93      public List<SocialRelation> getSocialRelations(int start, int end)
94          throws SystemException {
95          return socialRelationPersistence.findAll(start, end);
96      }
97  
98      public int getSocialRelationsCount() throws SystemException {
99          return socialRelationPersistence.countAll();
100     }
101 
102     public SocialRelation updateSocialRelation(SocialRelation socialRelation)
103         throws SystemException {
104         socialRelation.setNew(false);
105 
106         return socialRelationPersistence.update(socialRelation, true);
107     }
108 
109     public SocialRelation updateSocialRelation(SocialRelation socialRelation,
110         boolean merge) throws SystemException {
111         socialRelation.setNew(false);
112 
113         return socialRelationPersistence.update(socialRelation, 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 UserLocalService getUserLocalService() {
214         return userLocalService;
215     }
216 
217     public void setUserLocalService(UserLocalService userLocalService) {
218         this.userLocalService = userLocalService;
219     }
220 
221     public UserService getUserService() {
222         return userService;
223     }
224 
225     public void setUserService(UserService userService) {
226         this.userService = userService;
227     }
228 
229     public UserPersistence getUserPersistence() {
230         return userPersistence;
231     }
232 
233     public void setUserPersistence(UserPersistence userPersistence) {
234         this.userPersistence = userPersistence;
235     }
236 
237     public UserFinder getUserFinder() {
238         return userFinder;
239     }
240 
241     public void setUserFinder(UserFinder userFinder) {
242         this.userFinder = userFinder;
243     }
244 
245     protected void runSQL(String sql) throws SystemException {
246         try {
247             PortalUtil.runSQL(sql);
248         }
249         catch (Exception e) {
250             throw new SystemException(e);
251         }
252     }
253 
254     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityLocalService.impl")
255     protected SocialActivityLocalService socialActivityLocalService;
256     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityPersistence.impl")
257     protected SocialActivityPersistence socialActivityPersistence;
258     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialActivityFinder.impl")
259     protected SocialActivityFinder socialActivityFinder;
260     @BeanReference(name = "com.liferay.portlet.social.service.SocialActivityInterpreterLocalService.impl")
261     protected SocialActivityInterpreterLocalService socialActivityInterpreterLocalService;
262     @BeanReference(name = "com.liferay.portlet.social.service.SocialRelationLocalService.impl")
263     protected SocialRelationLocalService socialRelationLocalService;
264     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRelationPersistence.impl")
265     protected SocialRelationPersistence socialRelationPersistence;
266     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestLocalService.impl")
267     protected SocialRequestLocalService socialRequestLocalService;
268     @BeanReference(name = "com.liferay.portlet.social.service.persistence.SocialRequestPersistence.impl")
269     protected SocialRequestPersistence socialRequestPersistence;
270     @BeanReference(name = "com.liferay.portlet.social.service.SocialRequestInterpreterLocalService.impl")
271     protected SocialRequestInterpreterLocalService socialRequestInterpreterLocalService;
272     @BeanReference(name = "com.liferay.counter.service.CounterLocalService.impl")
273     protected CounterLocalService counterLocalService;
274     @BeanReference(name = "com.liferay.counter.service.CounterService.impl")
275     protected CounterService counterService;
276     @BeanReference(name = "com.liferay.portal.service.UserLocalService.impl")
277     protected UserLocalService userLocalService;
278     @BeanReference(name = "com.liferay.portal.service.UserService.impl")
279     protected UserService userService;
280     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
281     protected UserPersistence userPersistence;
282     @BeanReference(name = "com.liferay.portal.service.persistence.UserFinder.impl")
283     protected UserFinder userFinder;
284 }