001
014
015 package com.liferay.portlet.blogs.service.base;
016
017 import com.liferay.counter.service.CounterLocalService;
018
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.bean.IdentifiableBean;
021 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
024 import com.liferay.portal.kernel.exception.PortalException;
025 import com.liferay.portal.kernel.exception.SystemException;
026 import com.liferay.portal.kernel.log.Log;
027 import com.liferay.portal.kernel.log.LogFactoryUtil;
028 import com.liferay.portal.kernel.search.Indexer;
029 import com.liferay.portal.kernel.search.IndexerRegistryUtil;
030 import com.liferay.portal.kernel.search.SearchException;
031 import com.liferay.portal.kernel.util.OrderByComparator;
032 import com.liferay.portal.model.PersistedModel;
033 import com.liferay.portal.service.GroupLocalService;
034 import com.liferay.portal.service.GroupService;
035 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
036 import com.liferay.portal.service.ResourceLocalService;
037 import com.liferay.portal.service.ResourceService;
038 import com.liferay.portal.service.UserLocalService;
039 import com.liferay.portal.service.UserService;
040 import com.liferay.portal.service.persistence.GroupFinder;
041 import com.liferay.portal.service.persistence.GroupPersistence;
042 import com.liferay.portal.service.persistence.ResourceFinder;
043 import com.liferay.portal.service.persistence.ResourcePersistence;
044 import com.liferay.portal.service.persistence.UserFinder;
045 import com.liferay.portal.service.persistence.UserPersistence;
046
047 import com.liferay.portlet.blogs.model.BlogsStatsUser;
048 import com.liferay.portlet.blogs.service.BlogsEntryLocalService;
049 import com.liferay.portlet.blogs.service.BlogsEntryService;
050 import com.liferay.portlet.blogs.service.BlogsStatsUserLocalService;
051 import com.liferay.portlet.blogs.service.persistence.BlogsEntryFinder;
052 import com.liferay.portlet.blogs.service.persistence.BlogsEntryPersistence;
053 import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserFinder;
054 import com.liferay.portlet.blogs.service.persistence.BlogsStatsUserPersistence;
055
056 import java.io.Serializable;
057
058 import java.util.List;
059
060 import javax.sql.DataSource;
061
062
074 public abstract class BlogsStatsUserLocalServiceBaseImpl
075 implements BlogsStatsUserLocalService, IdentifiableBean {
076
081
082
089 public BlogsStatsUser addBlogsStatsUser(BlogsStatsUser blogsStatsUser)
090 throws SystemException {
091 blogsStatsUser.setNew(true);
092
093 blogsStatsUser = blogsStatsUserPersistence.update(blogsStatsUser, false);
094
095 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
096
097 if (indexer != null) {
098 try {
099 indexer.reindex(blogsStatsUser);
100 }
101 catch (SearchException se) {
102 if (_log.isWarnEnabled()) {
103 _log.warn(se, se);
104 }
105 }
106 }
107
108 return blogsStatsUser;
109 }
110
111
117 public BlogsStatsUser createBlogsStatsUser(long statsUserId) {
118 return blogsStatsUserPersistence.create(statsUserId);
119 }
120
121
128 public void deleteBlogsStatsUser(long statsUserId)
129 throws PortalException, SystemException {
130 BlogsStatsUser blogsStatsUser = blogsStatsUserPersistence.remove(statsUserId);
131
132 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
133
134 if (indexer != null) {
135 try {
136 indexer.delete(blogsStatsUser);
137 }
138 catch (SearchException se) {
139 if (_log.isWarnEnabled()) {
140 _log.warn(se, se);
141 }
142 }
143 }
144 }
145
146
152 public void deleteBlogsStatsUser(BlogsStatsUser blogsStatsUser)
153 throws SystemException {
154 blogsStatsUserPersistence.remove(blogsStatsUser);
155
156 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
157
158 if (indexer != null) {
159 try {
160 indexer.delete(blogsStatsUser);
161 }
162 catch (SearchException se) {
163 if (_log.isWarnEnabled()) {
164 _log.warn(se, se);
165 }
166 }
167 }
168 }
169
170
177 @SuppressWarnings("rawtypes")
178 public List dynamicQuery(DynamicQuery dynamicQuery)
179 throws SystemException {
180 return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery);
181 }
182
183
196 @SuppressWarnings("rawtypes")
197 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
198 throws SystemException {
199 return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery,
200 start, end);
201 }
202
203
217 @SuppressWarnings("rawtypes")
218 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
219 OrderByComparator orderByComparator) throws SystemException {
220 return blogsStatsUserPersistence.findWithDynamicQuery(dynamicQuery,
221 start, end, orderByComparator);
222 }
223
224
231 public long dynamicQueryCount(DynamicQuery dynamicQuery)
232 throws SystemException {
233 return blogsStatsUserPersistence.countWithDynamicQuery(dynamicQuery);
234 }
235
236 public BlogsStatsUser fetchBlogsStatsUser(long statsUserId)
237 throws SystemException {
238 return blogsStatsUserPersistence.fetchByPrimaryKey(statsUserId);
239 }
240
241
249 public BlogsStatsUser getBlogsStatsUser(long statsUserId)
250 throws PortalException, SystemException {
251 return blogsStatsUserPersistence.findByPrimaryKey(statsUserId);
252 }
253
254 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
255 throws PortalException, SystemException {
256 return blogsStatsUserPersistence.findByPrimaryKey(primaryKeyObj);
257 }
258
259
271 public List<BlogsStatsUser> getBlogsStatsUsers(int start, int end)
272 throws SystemException {
273 return blogsStatsUserPersistence.findAll(start, end);
274 }
275
276
282 public int getBlogsStatsUsersCount() throws SystemException {
283 return blogsStatsUserPersistence.countAll();
284 }
285
286
293 public BlogsStatsUser updateBlogsStatsUser(BlogsStatsUser blogsStatsUser)
294 throws SystemException {
295 return updateBlogsStatsUser(blogsStatsUser, true);
296 }
297
298
306 public BlogsStatsUser updateBlogsStatsUser(BlogsStatsUser blogsStatsUser,
307 boolean merge) throws SystemException {
308 blogsStatsUser.setNew(false);
309
310 blogsStatsUser = blogsStatsUserPersistence.update(blogsStatsUser, merge);
311
312 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
313
314 if (indexer != null) {
315 try {
316 indexer.reindex(blogsStatsUser);
317 }
318 catch (SearchException se) {
319 if (_log.isWarnEnabled()) {
320 _log.warn(se, se);
321 }
322 }
323 }
324
325 return blogsStatsUser;
326 }
327
328
333 public BlogsEntryLocalService getBlogsEntryLocalService() {
334 return blogsEntryLocalService;
335 }
336
337
342 public void setBlogsEntryLocalService(
343 BlogsEntryLocalService blogsEntryLocalService) {
344 this.blogsEntryLocalService = blogsEntryLocalService;
345 }
346
347
352 public BlogsEntryService getBlogsEntryService() {
353 return blogsEntryService;
354 }
355
356
361 public void setBlogsEntryService(BlogsEntryService blogsEntryService) {
362 this.blogsEntryService = blogsEntryService;
363 }
364
365
370 public BlogsEntryPersistence getBlogsEntryPersistence() {
371 return blogsEntryPersistence;
372 }
373
374
379 public void setBlogsEntryPersistence(
380 BlogsEntryPersistence blogsEntryPersistence) {
381 this.blogsEntryPersistence = blogsEntryPersistence;
382 }
383
384
389 public BlogsEntryFinder getBlogsEntryFinder() {
390 return blogsEntryFinder;
391 }
392
393
398 public void setBlogsEntryFinder(BlogsEntryFinder blogsEntryFinder) {
399 this.blogsEntryFinder = blogsEntryFinder;
400 }
401
402
407 public BlogsStatsUserLocalService getBlogsStatsUserLocalService() {
408 return blogsStatsUserLocalService;
409 }
410
411
416 public void setBlogsStatsUserLocalService(
417 BlogsStatsUserLocalService blogsStatsUserLocalService) {
418 this.blogsStatsUserLocalService = blogsStatsUserLocalService;
419 }
420
421
426 public BlogsStatsUserPersistence getBlogsStatsUserPersistence() {
427 return blogsStatsUserPersistence;
428 }
429
430
435 public void setBlogsStatsUserPersistence(
436 BlogsStatsUserPersistence blogsStatsUserPersistence) {
437 this.blogsStatsUserPersistence = blogsStatsUserPersistence;
438 }
439
440
445 public BlogsStatsUserFinder getBlogsStatsUserFinder() {
446 return blogsStatsUserFinder;
447 }
448
449
454 public void setBlogsStatsUserFinder(
455 BlogsStatsUserFinder blogsStatsUserFinder) {
456 this.blogsStatsUserFinder = blogsStatsUserFinder;
457 }
458
459
464 public CounterLocalService getCounterLocalService() {
465 return counterLocalService;
466 }
467
468
473 public void setCounterLocalService(CounterLocalService counterLocalService) {
474 this.counterLocalService = counterLocalService;
475 }
476
477
482 public GroupLocalService getGroupLocalService() {
483 return groupLocalService;
484 }
485
486
491 public void setGroupLocalService(GroupLocalService groupLocalService) {
492 this.groupLocalService = groupLocalService;
493 }
494
495
500 public GroupService getGroupService() {
501 return groupService;
502 }
503
504
509 public void setGroupService(GroupService groupService) {
510 this.groupService = groupService;
511 }
512
513
518 public GroupPersistence getGroupPersistence() {
519 return groupPersistence;
520 }
521
522
527 public void setGroupPersistence(GroupPersistence groupPersistence) {
528 this.groupPersistence = groupPersistence;
529 }
530
531
536 public GroupFinder getGroupFinder() {
537 return groupFinder;
538 }
539
540
545 public void setGroupFinder(GroupFinder groupFinder) {
546 this.groupFinder = groupFinder;
547 }
548
549
554 public ResourceLocalService getResourceLocalService() {
555 return resourceLocalService;
556 }
557
558
563 public void setResourceLocalService(
564 ResourceLocalService resourceLocalService) {
565 this.resourceLocalService = resourceLocalService;
566 }
567
568
573 public ResourceService getResourceService() {
574 return resourceService;
575 }
576
577
582 public void setResourceService(ResourceService resourceService) {
583 this.resourceService = resourceService;
584 }
585
586
591 public ResourcePersistence getResourcePersistence() {
592 return resourcePersistence;
593 }
594
595
600 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
601 this.resourcePersistence = resourcePersistence;
602 }
603
604
609 public ResourceFinder getResourceFinder() {
610 return resourceFinder;
611 }
612
613
618 public void setResourceFinder(ResourceFinder resourceFinder) {
619 this.resourceFinder = resourceFinder;
620 }
621
622
627 public UserLocalService getUserLocalService() {
628 return userLocalService;
629 }
630
631
636 public void setUserLocalService(UserLocalService userLocalService) {
637 this.userLocalService = userLocalService;
638 }
639
640
645 public UserService getUserService() {
646 return userService;
647 }
648
649
654 public void setUserService(UserService userService) {
655 this.userService = userService;
656 }
657
658
663 public UserPersistence getUserPersistence() {
664 return userPersistence;
665 }
666
667
672 public void setUserPersistence(UserPersistence userPersistence) {
673 this.userPersistence = userPersistence;
674 }
675
676
681 public UserFinder getUserFinder() {
682 return userFinder;
683 }
684
685
690 public void setUserFinder(UserFinder userFinder) {
691 this.userFinder = userFinder;
692 }
693
694 public void afterPropertiesSet() {
695 persistedModelLocalServiceRegistry.register("com.liferay.portlet.blogs.model.BlogsStatsUser",
696 blogsStatsUserLocalService);
697 }
698
699 public void destroy() {
700 persistedModelLocalServiceRegistry.unregister(
701 "com.liferay.portlet.blogs.model.BlogsStatsUser");
702 }
703
704
709 public String getBeanIdentifier() {
710 return _beanIdentifier;
711 }
712
713
718 public void setBeanIdentifier(String beanIdentifier) {
719 _beanIdentifier = beanIdentifier;
720 }
721
722 protected ClassLoader getClassLoader() {
723 Class<?> clazz = getClass();
724
725 return clazz.getClassLoader();
726 }
727
728 protected Class<?> getModelClass() {
729 return BlogsStatsUser.class;
730 }
731
732 protected String getModelClassName() {
733 return BlogsStatsUser.class.getName();
734 }
735
736
741 protected void runSQL(String sql) throws SystemException {
742 try {
743 DataSource dataSource = blogsStatsUserPersistence.getDataSource();
744
745 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
746 sql, new int[0]);
747
748 sqlUpdate.update();
749 }
750 catch (Exception e) {
751 throw new SystemException(e);
752 }
753 }
754
755 @BeanReference(type = BlogsEntryLocalService.class)
756 protected BlogsEntryLocalService blogsEntryLocalService;
757 @BeanReference(type = BlogsEntryService.class)
758 protected BlogsEntryService blogsEntryService;
759 @BeanReference(type = BlogsEntryPersistence.class)
760 protected BlogsEntryPersistence blogsEntryPersistence;
761 @BeanReference(type = BlogsEntryFinder.class)
762 protected BlogsEntryFinder blogsEntryFinder;
763 @BeanReference(type = BlogsStatsUserLocalService.class)
764 protected BlogsStatsUserLocalService blogsStatsUserLocalService;
765 @BeanReference(type = BlogsStatsUserPersistence.class)
766 protected BlogsStatsUserPersistence blogsStatsUserPersistence;
767 @BeanReference(type = BlogsStatsUserFinder.class)
768 protected BlogsStatsUserFinder blogsStatsUserFinder;
769 @BeanReference(type = CounterLocalService.class)
770 protected CounterLocalService counterLocalService;
771 @BeanReference(type = GroupLocalService.class)
772 protected GroupLocalService groupLocalService;
773 @BeanReference(type = GroupService.class)
774 protected GroupService groupService;
775 @BeanReference(type = GroupPersistence.class)
776 protected GroupPersistence groupPersistence;
777 @BeanReference(type = GroupFinder.class)
778 protected GroupFinder groupFinder;
779 @BeanReference(type = ResourceLocalService.class)
780 protected ResourceLocalService resourceLocalService;
781 @BeanReference(type = ResourceService.class)
782 protected ResourceService resourceService;
783 @BeanReference(type = ResourcePersistence.class)
784 protected ResourcePersistence resourcePersistence;
785 @BeanReference(type = ResourceFinder.class)
786 protected ResourceFinder resourceFinder;
787 @BeanReference(type = UserLocalService.class)
788 protected UserLocalService userLocalService;
789 @BeanReference(type = UserService.class)
790 protected UserService userService;
791 @BeanReference(type = UserPersistence.class)
792 protected UserPersistence userPersistence;
793 @BeanReference(type = UserFinder.class)
794 protected UserFinder userFinder;
795 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
796 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
797 private static Log _log = LogFactoryUtil.getLog(BlogsStatsUserLocalServiceBaseImpl.class);
798 private String _beanIdentifier;
799 }