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.blogs.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
21  import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
22  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
23  import com.liferay.portal.kernel.exception.PortalException;
24  import com.liferay.portal.kernel.exception.SystemException;
25  import com.liferay.portal.kernel.util.OrderByComparator;
26  import com.liferay.portal.service.GroupLocalService;
27  import com.liferay.portal.service.GroupService;
28  import com.liferay.portal.service.ResourceLocalService;
29  import com.liferay.portal.service.ResourceService;
30  import com.liferay.portal.service.UserLocalService;
31  import com.liferay.portal.service.UserService;
32  import com.liferay.portal.service.persistence.GroupFinder;
33  import com.liferay.portal.service.persistence.GroupPersistence;
34  import com.liferay.portal.service.persistence.ResourceFinder;
35  import com.liferay.portal.service.persistence.ResourcePersistence;
36  import com.liferay.portal.service.persistence.UserFinder;
37  import com.liferay.portal.service.persistence.UserPersistence;
38  
39  import com.liferay.portlet.blogs.model.BlogsStatsUser;
40  import com.liferay.portlet.blogs.service.BlogsEntryLocalService;
41  import com.liferay.portlet.blogs.service.BlogsEntryService;
42  import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
43  import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
44  import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
45  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
46  import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
47  
48  import java.util.List;
49  
50  import javax.sql.DataSource;
51  
52  /**
53   * <a href="BlogsStatsUserLocalServiceBaseImpl.java.html"><b><i>View Source</i>
54   * </b></a>
55   *
56   * @author Brian Wing Shun Chan
57   */
58  public abstract class BlogsStatsUserLocalServiceBaseImpl
59      implements BlogsStatsUserLocalService {
60      public BlogsStatsUser addBlogsStatsUser(BlogsStatsUser blogsStatsUser)
61          throws SystemException {
62          blogsStatsUser.setNew(true);
63  
64          return blogsStatsUserPersistence.update(blogsStatsUser, false);
65      }
66  
67      public BlogsStatsUser createBlogsStatsUser(long statsUserId) {
68          return blogsStatsUserPersistence.create(statsUserId);
69      }
70  
71      public void deleteBlogsStatsUser(long statsUserId)
72          throws PortalException, SystemException {
73          blogsStatsUserPersistence.remove(statsUserId);
74      }
75  
76      public void deleteBlogsStatsUser(BlogsStatsUser blogsStatsUser)
77          throws SystemException {
78          blogsStatsUserPersistence.remove(blogsStatsUser);
79      }
80  
81      @SuppressWarnings("unchecked")
82      public List dynamicQuery(DynamicQuery dynamicQuery)
83          throws SystemException {
84          return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery);
85      }
86  
87      @SuppressWarnings("unchecked")
88      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
89          throws SystemException {
90          return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery,
91              start, end);
92      }
93  
94      @SuppressWarnings("unchecked")
95      public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
96          OrderByComparator orderByComparator) throws SystemException {
97          return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery,
98              start, end, orderByComparator);
99      }
100 
101     public long dynamicQueryCount(DynamicQuery dynamicQuery)
102         throws SystemException {
103         return blogsStatsUserPersistence.countWithDynamicQuery(dynamicQuery);
104     }
105 
106     public BlogsStatsUser getBlogsStatsUser(long statsUserId)
107         throws PortalException, SystemException {
108         return blogsStatsUserPersistence.findByPrimaryKey(statsUserId);
109     }
110 
111     public List<BlogsStatsUser> getBlogsStatsUsers(int start, int end)
112         throws SystemException {
113         return blogsStatsUserPersistence.findAll(start, end);
114     }
115 
116     public int getBlogsStatsUsersCount() throws SystemException {
117         return blogsStatsUserPersistence.countAll();
118     }
119 
120     public BlogsStatsUser updateBlogsStatsUser(BlogsStatsUser blogsStatsUser)
121         throws SystemException {
122         blogsStatsUser.setNew(false);
123 
124         return blogsStatsUserPersistence.update(blogsStatsUser, true);
125     }
126 
127     public BlogsStatsUser updateBlogsStatsUser(BlogsStatsUser blogsStatsUser,
128         boolean merge) throws SystemException {
129         blogsStatsUser.setNew(false);
130 
131         return blogsStatsUserPersistence.update(blogsStatsUser, merge);
132     }
133 
134     public BlogsEntryLocalService getBlogsEntryLocalService() {
135         return blogsEntryLocalService;
136     }
137 
138     public void setBlogsEntryLocalService(
139         BlogsEntryLocalService blogsEntryLocalService) {
140         this.blogsEntryLocalService = blogsEntryLocalService;
141     }
142 
143     public BlogsEntryService getBlogsEntryService() {
144         return blogsEntryService;
145     }
146 
147     public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
148         this.blogsEntryService = blogsEntryService;
149     }
150 
151     public BlogsEntryPersistence getBlogsEntryPersistence() {
152         return blogsEntryPersistence;
153     }
154 
155     public void setBlogsEntryPersistence(
156         BlogsEntryPersistence blogsEntryPersistence) {
157         this.blogsEntryPersistence = blogsEntryPersistence;
158     }
159 
160     public BlogsEntryFinder getBlogsEntryFinder() {
161         return blogsEntryFinder;
162     }
163 
164     public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
165         this.blogsEntryFinder = blogsEntryFinder;
166     }
167 
168     public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
169         return blogsStatsUserLocalService;
170     }
171 
172     public void setBlogsStatsUserLocalService(
173         BlogsStatsUserLocalService blogsStatsUserLocalService) {
174         this.blogsStatsUserLocalService = blogsStatsUserLocalService;
175     }
176 
177     public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
178         return blogsStatsUserPersistence;
179     }
180 
181     public void setBlogsStatsUserPersistence(
182         BlogsStatsUserPersistence blogsStatsUserPersistence) {
183         this.blogsStatsUserPersistence = blogsStatsUserPersistence;
184     }
185 
186     public BlogsStatsUserFinder getBlogsStatsUserFinder() {
187         return blogsStatsUserFinder;
188     }
189 
190     public void setBlogsStatsUserFinder(
191         BlogsStatsUserFinder blogsStatsUserFinder) {
192         this.blogsStatsUserFinder = blogsStatsUserFinder;
193     }
194 
195     public CounterLocalService getCounterLocalService() {
196         return counterLocalService;
197     }
198 
199     public void setCounterLocalService(CounterLocalService counterLocalService) {
200         this.counterLocalService = counterLocalService;
201     }
202 
203     public GroupLocalService getGroupLocalService() {
204         return groupLocalService;
205     }
206 
207     public void setGroupLocalService(GroupLocalService groupLocalService) {
208         this.groupLocalService = groupLocalService;
209     }
210 
211     public GroupService getGroupService() {
212         return groupService;
213     }
214 
215     public void setGroupService(GroupService groupService) {
216         this.groupService = groupService;
217     }
218 
219     public GroupPersistence getGroupPersistence() {
220         return groupPersistence;
221     }
222 
223     public void setGroupPersistence(GroupPersistence groupPersistence) {
224         this.groupPersistence = groupPersistence;
225     }
226 
227     public GroupFinder getGroupFinder() {
228         return groupFinder;
229     }
230 
231     public void setGroupFinder(GroupFinder groupFinder) {
232         this.groupFinder = groupFinder;
233     }
234 
235     public ResourceLocalService getResourceLocalService() {
236         return resourceLocalService;
237     }
238 
239     public void setResourceLocalService(
240         ResourceLocalService resourceLocalService) {
241         this.resourceLocalService = resourceLocalService;
242     }
243 
244     public ResourceService getResourceService() {
245         return resourceService;
246     }
247 
248     public void setResourceService(ResourceService resourceService) {
249         this.resourceService = resourceService;
250     }
251 
252     public ResourcePersistence getResourcePersistence() {
253         return resourcePersistence;
254     }
255 
256     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
257         this.resourcePersistence = resourcePersistence;
258     }
259 
260     public ResourceFinder getResourceFinder() {
261         return resourceFinder;
262     }
263 
264     public void setResourceFinder(ResourceFinder resourceFinder) {
265         this.resourceFinder = resourceFinder;
266     }
267 
268     public UserLocalService getUserLocalService() {
269         return userLocalService;
270     }
271 
272     public void setUserLocalService(UserLocalService userLocalService) {
273         this.userLocalService = userLocalService;
274     }
275 
276     public UserService getUserService() {
277         return userService;
278     }
279 
280     public void setUserService(UserService userService) {
281         this.userService = userService;
282     }
283 
284     public UserPersistence getUserPersistence() {
285         return userPersistence;
286     }
287 
288     public void setUserPersistence(UserPersistence userPersistence) {
289         this.userPersistence = userPersistence;
290     }
291 
292     public UserFinder getUserFinder() {
293         return userFinder;
294     }
295 
296     public void setUserFinder(UserFinder userFinder) {
297         this.userFinder = userFinder;
298     }
299 
300     protected void runSQL(String sql) throws SystemException {
301         try {
302             DataSource dataSource = blogsStatsUserPersistence.getDataSource();
303 
304             SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
305                     sql, new int[0]);
306 
307             sqlUpdate.update();
308         }
309         catch (Exception e) {
310             throw new SystemException(e);
311         }
312     }
313 
314     @BeanReference(type = BlogsEntryLocalService.class)
315     protected BlogsEntryLocalService blogsEntryLocalService;
316     @BeanReference(type = BlogsEntryService.class)
317     protected BlogsEntryService blogsEntryService;
318     @BeanReference(type = BlogsEntryPersistence.class)
319     protected BlogsEntryPersistence blogsEntryPersistence;
320     @BeanReference(type = BlogsEntryFinder.class)
321     protected BlogsEntryFinder blogsEntryFinder;
322     @BeanReference(type = BlogsStatsUserLocalService.class)
323     protected BlogsStatsUserLocalService blogsStatsUserLocalService;
324     @BeanReference(type = BlogsStatsUserPersistence.class)
325     protected BlogsStatsUserPersistence blogsStatsUserPersistence;
326     @BeanReference(type = BlogsStatsUserFinder.class)
327     protected BlogsStatsUserFinder blogsStatsUserFinder;
328     @BeanReference(type = CounterLocalService.class)
329     protected CounterLocalService counterLocalService;
330     @BeanReference(type = GroupLocalService.class)
331     protected GroupLocalService groupLocalService;
332     @BeanReference(type = GroupService.class)
333     protected GroupService groupService;
334     @BeanReference(type = GroupPersistence.class)
335     protected GroupPersistence groupPersistence;
336     @BeanReference(type = GroupFinder.class)
337     protected GroupFinder groupFinder;
338     @BeanReference(type = ResourceLocalService.class)
339     protected ResourceLocalService resourceLocalService;
340     @BeanReference(type = ResourceService.class)
341     protected ResourceService resourceService;
342     @BeanReference(type = ResourcePersistence.class)
343     protected ResourcePersistence resourcePersistence;
344     @BeanReference(type = ResourceFinder.class)
345     protected ResourceFinder resourceFinder;
346     @BeanReference(type = UserLocalService.class)
347     protected UserLocalService userLocalService;
348     @BeanReference(type = UserService.class)
349     protected UserService userService;
350     @BeanReference(type = UserPersistence.class)
351     protected UserPersistence userPersistence;
352     @BeanReference(type = UserFinder.class)
353     protected UserFinder userFinder;
354 }