001
014
015 package com.liferay.portlet.blogs.service.base;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.dao.db.DB;
021 import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
023 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
024 import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
025 import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
026 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
027 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
028 import com.liferay.portal.kernel.dao.orm.Projection;
029 import com.liferay.portal.kernel.exception.PortalException;
030 import com.liferay.portal.kernel.exception.SystemException;
031 import com.liferay.portal.kernel.module.framework.service.IdentifiableOSGiService;
032 import com.liferay.portal.kernel.search.Indexable;
033 import com.liferay.portal.kernel.search.IndexableType;
034 import com.liferay.portal.kernel.util.OrderByComparator;
035 import com.liferay.portal.model.PersistedModel;
036 import com.liferay.portal.service.BaseLocalServiceImpl;
037 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
038 import com.liferay.portal.service.persistence.GroupFinder;
039 import com.liferay.portal.service.persistence.GroupPersistence;
040 import com.liferay.portal.util.PortalUtil;
041
042 import com.liferay.portlet.blogs.model.BlogsStatsUser;
043 import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
044 import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
045 import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
046 import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
047 import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
048
049 import java.io.Serializable;
050
051 import java.util.List;
052
053 import javax.sql.DataSource;
054
055
067 @ProviderType
068 public abstract class BlogsStatsUserLocalServiceBaseImpl
069 extends BaseLocalServiceImpl implements BlogsStatsUserLocalService,
070 IdentifiableOSGiService {
071
076
077
083 @Indexable(type = IndexableType.REINDEX)
084 @Override
085 public BlogsStatsUser addBlogsStatsUser(BlogsStatsUser blogsStatsUser) {
086 blogsStatsUser.setNew(true);
087
088 return blogsStatsUserPersistence.update(blogsStatsUser);
089 }
090
091
097 @Override
098 public BlogsStatsUser createBlogsStatsUser(long statsUserId) {
099 return blogsStatsUserPersistence.create(statsUserId);
100 }
101
102
109 @Indexable(type = IndexableType.DELETE)
110 @Override
111 public BlogsStatsUser deleteBlogsStatsUser(long statsUserId)
112 throws PortalException {
113 return blogsStatsUserPersistence.remove(statsUserId);
114 }
115
116
122 @Indexable(type = IndexableType.DELETE)
123 @Override
124 public BlogsStatsUser deleteBlogsStatsUser(BlogsStatsUser blogsStatsUser) {
125 return blogsStatsUserPersistence.remove(blogsStatsUser);
126 }
127
128 @Override
129 public DynamicQuery dynamicQuery() {
130 Class<?> clazz = getClass();
131
132 return DynamicQueryFactoryUtil.forClass(BlogsStatsUser.class,
133 clazz.getClassLoader());
134 }
135
136
142 @Override
143 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
144 return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery);
145 }
146
147
159 @Override
160 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
161 int end) {
162 return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery,
163 start, end);
164 }
165
166
179 @Override
180 public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
181 int end, OrderByComparator<T> orderByComparator) {
182 return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery,
183 start, end, orderByComparator);
184 }
185
186
192 @Override
193 public long dynamicQueryCount(DynamicQuery dynamicQuery) {
194 return blogsStatsUserPersistence.countWithDynamicQuery(dynamicQuery);
195 }
196
197
204 @Override
205 public long dynamicQueryCount(DynamicQuery dynamicQuery,
206 Projection projection) {
207 return blogsStatsUserPersistence.countWithDynamicQuery(dynamicQuery,
208 projection);
209 }
210
211 @Override
212 public BlogsStatsUser fetchBlogsStatsUser(long statsUserId) {
213 return blogsStatsUserPersistence.fetchByPrimaryKey(statsUserId);
214 }
215
216
223 @Override
224 public BlogsStatsUser getBlogsStatsUser(long statsUserId)
225 throws PortalException {
226 return blogsStatsUserPersistence.findByPrimaryKey(statsUserId);
227 }
228
229 @Override
230 public ActionableDynamicQuery getActionableDynamicQuery() {
231 ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
232
233 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.blogs.service.BlogsStatsUserLocalServiceUtil.getService());
234 actionableDynamicQuery.setClass(BlogsStatsUser.class);
235 actionableDynamicQuery.setClassLoader(getClassLoader());
236
237 actionableDynamicQuery.setPrimaryKeyPropertyName("statsUserId");
238
239 return actionableDynamicQuery;
240 }
241
242 protected void initActionableDynamicQuery(
243 ActionableDynamicQuery actionableDynamicQuery) {
244 actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.blogs.service.BlogsStatsUserLocalServiceUtil.getService());
245 actionableDynamicQuery.setClass(BlogsStatsUser.class);
246 actionableDynamicQuery.setClassLoader(getClassLoader());
247
248 actionableDynamicQuery.setPrimaryKeyPropertyName("statsUserId");
249 }
250
251
254 @Override
255 public PersistedModel deletePersistedModel(PersistedModel persistedModel)
256 throws PortalException {
257 return blogsStatsUserLocalService.deleteBlogsStatsUser((BlogsStatsUser)persistedModel);
258 }
259
260 @Override
261 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
262 throws PortalException {
263 return blogsStatsUserPersistence.findByPrimaryKey(primaryKeyObj);
264 }
265
266
277 @Override
278 public List<BlogsStatsUser> getBlogsStatsUsers(int start, int end) {
279 return blogsStatsUserPersistence.findAll(start, end);
280 }
281
282
287 @Override
288 public int getBlogsStatsUsersCount() {
289 return blogsStatsUserPersistence.countAll();
290 }
291
292
298 @Indexable(type = IndexableType.REINDEX)
299 @Override
300 public BlogsStatsUser updateBlogsStatsUser(BlogsStatsUser blogsStatsUser) {
301 return blogsStatsUserPersistence.update(blogsStatsUser);
302 }
303
304
309 public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
310 return blogsStatsUserLocalService;
311 }
312
313
318 public void setBlogsStatsUserLocalService(
319 BlogsStatsUserLocalService blogsStatsUserLocalService) {
320 this.blogsStatsUserLocalService = blogsStatsUserLocalService;
321 }
322
323
328 public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
329 return blogsStatsUserPersistence;
330 }
331
332
337 public void setBlogsStatsUserPersistence(
338 BlogsStatsUserPersistence blogsStatsUserPersistence) {
339 this.blogsStatsUserPersistence = blogsStatsUserPersistence;
340 }
341
342
347 public BlogsStatsUserFinder getBlogsStatsUserFinder() {
348 return blogsStatsUserFinder;
349 }
350
351
356 public void setBlogsStatsUserFinder(
357 BlogsStatsUserFinder blogsStatsUserFinder) {
358 this.blogsStatsUserFinder = blogsStatsUserFinder;
359 }
360
361
366 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
367 return counterLocalService;
368 }
369
370
375 public void setCounterLocalService(
376 com.liferay.counter.service.CounterLocalService counterLocalService) {
377 this.counterLocalService = counterLocalService;
378 }
379
380
385 public com.liferay.portal.service.GroupLocalService getGroupLocalService() {
386 return groupLocalService;
387 }
388
389
394 public void setGroupLocalService(
395 com.liferay.portal.service.GroupLocalService groupLocalService) {
396 this.groupLocalService = groupLocalService;
397 }
398
399
404 public com.liferay.portal.service.GroupService getGroupService() {
405 return groupService;
406 }
407
408
413 public void setGroupService(
414 com.liferay.portal.service.GroupService groupService) {
415 this.groupService = groupService;
416 }
417
418
423 public GroupPersistence getGroupPersistence() {
424 return groupPersistence;
425 }
426
427
432 public void setGroupPersistence(GroupPersistence groupPersistence) {
433 this.groupPersistence = groupPersistence;
434 }
435
436
441 public GroupFinder getGroupFinder() {
442 return groupFinder;
443 }
444
445
450 public void setGroupFinder(GroupFinder groupFinder) {
451 this.groupFinder = groupFinder;
452 }
453
454
459 public com.liferay.portlet.blogs.service.BlogsEntryLocalService getBlogsEntryLocalService() {
460 return blogsEntryLocalService;
461 }
462
463
468 public void setBlogsEntryLocalService(
469 com.liferay.portlet.blogs.service.BlogsEntryLocalService blogsEntryLocalService) {
470 this.blogsEntryLocalService = blogsEntryLocalService;
471 }
472
473
478 public com.liferay.portlet.blogs.service.BlogsEntryService getBlogsEntryService() {
479 return blogsEntryService;
480 }
481
482
487 public void setBlogsEntryService(
488 com.liferay.portlet.blogs.service.BlogsEntryService blogsEntryService) {
489 this.blogsEntryService = blogsEntryService;
490 }
491
492
497 public BlogsEntryPersistence getBlogsEntryPersistence() {
498 return blogsEntryPersistence;
499 }
500
501
506 public void setBlogsEntryPersistence(
507 BlogsEntryPersistence blogsEntryPersistence) {
508 this.blogsEntryPersistence = blogsEntryPersistence;
509 }
510
511
516 public BlogsEntryFinder getBlogsEntryFinder() {
517 return blogsEntryFinder;
518 }
519
520
525 public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
526 this.blogsEntryFinder = blogsEntryFinder;
527 }
528
529 public void afterPropertiesSet() {
530 persistedModelLocalServiceRegistry.register("com.liferay.portlet.blogs.model.BlogsStatsUser",
531 blogsStatsUserLocalService);
532 }
533
534 public void destroy() {
535 persistedModelLocalServiceRegistry.unregister(
536 "com.liferay.portlet.blogs.model.BlogsStatsUser");
537 }
538
539
544 @Override
545 public String getOSGiServiceIdentifier() {
546 return BlogsStatsUserLocalService.class.getName();
547 }
548
549 protected Class<?> getModelClass() {
550 return BlogsStatsUser.class;
551 }
552
553 protected String getModelClassName() {
554 return BlogsStatsUser.class.getName();
555 }
556
557
562 protected void runSQL(String sql) {
563 try {
564 DataSource dataSource = blogsStatsUserPersistence.getDataSource();
565
566 DB db = DBFactoryUtil.getDB();
567
568 sql = db.buildSQL(sql);
569 sql = PortalUtil.transformSQL(sql);
570
571 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
572 sql, new int[0]);
573
574 sqlUpdate.update();
575 }
576 catch (Exception e) {
577 throw new SystemException(e);
578 }
579 }
580
581 @BeanReference(type = com.liferay.portlet.blogs.service.BlogsStatsUserLocalService.class)
582 protected BlogsStatsUserLocalService blogsStatsUserLocalService;
583 @BeanReference(type = BlogsStatsUserPersistence.class)
584 protected BlogsStatsUserPersistence blogsStatsUserPersistence;
585 @BeanReference(type = BlogsStatsUserFinder.class)
586 protected BlogsStatsUserFinder blogsStatsUserFinder;
587 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
588 protected com.liferay.counter.service.CounterLocalService counterLocalService;
589 @BeanReference(type = com.liferay.portal.service.GroupLocalService.class)
590 protected com.liferay.portal.service.GroupLocalService groupLocalService;
591 @BeanReference(type = com.liferay.portal.service.GroupService.class)
592 protected com.liferay.portal.service.GroupService groupService;
593 @BeanReference(type = GroupPersistence.class)
594 protected GroupPersistence groupPersistence;
595 @BeanReference(type = GroupFinder.class)
596 protected GroupFinder groupFinder;
597 @BeanReference(type = com.liferay.portlet.blogs.service.BlogsEntryLocalService.class)
598 protected com.liferay.portlet.blogs.service.BlogsEntryLocalService blogsEntryLocalService;
599 @BeanReference(type = com.liferay.portlet.blogs.service.BlogsEntryService.class)
600 protected com.liferay.portlet.blogs.service.BlogsEntryService blogsEntryService;
601 @BeanReference(type = BlogsEntryPersistence.class)
602 protected BlogsEntryPersistence blogsEntryPersistence;
603 @BeanReference(type = BlogsEntryFinder.class)
604 protected BlogsEntryFinder blogsEntryFinder;
605 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
606 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
607 }