001
014
015 package com.liferay.portlet.bookmarks.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.PersistedModelLocalServiceRegistry;
034 import com.liferay.portal.service.ResourceLocalService;
035 import com.liferay.portal.service.ResourceService;
036 import com.liferay.portal.service.UserLocalService;
037 import com.liferay.portal.service.UserService;
038 import com.liferay.portal.service.persistence.ResourceFinder;
039 import com.liferay.portal.service.persistence.ResourcePersistence;
040 import com.liferay.portal.service.persistence.UserFinder;
041 import com.liferay.portal.service.persistence.UserPersistence;
042
043 import com.liferay.portlet.asset.service.AssetEntryLocalService;
044 import com.liferay.portlet.asset.service.AssetEntryService;
045 import com.liferay.portlet.asset.service.AssetLinkLocalService;
046 import com.liferay.portlet.asset.service.AssetTagLocalService;
047 import com.liferay.portlet.asset.service.AssetTagService;
048 import com.liferay.portlet.asset.service.persistence.AssetEntryFinder;
049 import com.liferay.portlet.asset.service.persistence.AssetEntryPersistence;
050 import com.liferay.portlet.asset.service.persistence.AssetLinkPersistence;
051 import com.liferay.portlet.asset.service.persistence.AssetTagFinder;
052 import com.liferay.portlet.asset.service.persistence.AssetTagPersistence;
053 import com.liferay.portlet.bookmarks.model.BookmarksEntry;
054 import com.liferay.portlet.bookmarks.service.BookmarksEntryLocalService;
055 import com.liferay.portlet.bookmarks.service.BookmarksEntryService;
056 import com.liferay.portlet.bookmarks.service.BookmarksFolderLocalService;
057 import com.liferay.portlet.bookmarks.service.BookmarksFolderService;
058 import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryFinder;
059 import com.liferay.portlet.bookmarks.service.persistence.BookmarksEntryPersistence;
060 import com.liferay.portlet.bookmarks.service.persistence.BookmarksFolderPersistence;
061 import com.liferay.portlet.expando.service.ExpandoValueLocalService;
062 import com.liferay.portlet.expando.service.ExpandoValueService;
063 import com.liferay.portlet.expando.service.persistence.ExpandoValuePersistence;
064
065 import java.io.Serializable;
066
067 import java.util.List;
068
069 import javax.sql.DataSource;
070
071
083 public abstract class BookmarksEntryLocalServiceBaseImpl
084 implements BookmarksEntryLocalService, IdentifiableBean {
085
090
091
098 public BookmarksEntry addBookmarksEntry(BookmarksEntry bookmarksEntry)
099 throws SystemException {
100 bookmarksEntry.setNew(true);
101
102 bookmarksEntry = bookmarksEntryPersistence.update(bookmarksEntry, false);
103
104 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
105
106 if (indexer != null) {
107 try {
108 indexer.reindex(bookmarksEntry);
109 }
110 catch (SearchException se) {
111 if (_log.isWarnEnabled()) {
112 _log.warn(se, se);
113 }
114 }
115 }
116
117 return bookmarksEntry;
118 }
119
120
126 public BookmarksEntry createBookmarksEntry(long entryId) {
127 return bookmarksEntryPersistence.create(entryId);
128 }
129
130
137 public void deleteBookmarksEntry(long entryId)
138 throws PortalException, SystemException {
139 BookmarksEntry bookmarksEntry = bookmarksEntryPersistence.remove(entryId);
140
141 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
142
143 if (indexer != null) {
144 try {
145 indexer.delete(bookmarksEntry);
146 }
147 catch (SearchException se) {
148 if (_log.isWarnEnabled()) {
149 _log.warn(se, se);
150 }
151 }
152 }
153 }
154
155
161 public void deleteBookmarksEntry(BookmarksEntry bookmarksEntry)
162 throws SystemException {
163 bookmarksEntryPersistence.remove(bookmarksEntry);
164
165 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
166
167 if (indexer != null) {
168 try {
169 indexer.delete(bookmarksEntry);
170 }
171 catch (SearchException se) {
172 if (_log.isWarnEnabled()) {
173 _log.warn(se, se);
174 }
175 }
176 }
177 }
178
179
186 @SuppressWarnings("rawtypes")
187 public List dynamicQuery(DynamicQuery dynamicQuery)
188 throws SystemException {
189 return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery);
190 }
191
192
205 @SuppressWarnings("rawtypes")
206 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
207 throws SystemException {
208 return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery,
209 start, end);
210 }
211
212
226 @SuppressWarnings("rawtypes")
227 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
228 OrderByComparator orderByComparator) throws SystemException {
229 return bookmarksEntryPersistence.findWithDynamicQuery(dynamicQuery,
230 start, end, orderByComparator);
231 }
232
233
240 public long dynamicQueryCount(DynamicQuery dynamicQuery)
241 throws SystemException {
242 return bookmarksEntryPersistence.countWithDynamicQuery(dynamicQuery);
243 }
244
245 public BookmarksEntry fetchBookmarksEntry(long entryId)
246 throws SystemException {
247 return bookmarksEntryPersistence.fetchByPrimaryKey(entryId);
248 }
249
250
258 public BookmarksEntry getBookmarksEntry(long entryId)
259 throws PortalException, SystemException {
260 return bookmarksEntryPersistence.findByPrimaryKey(entryId);
261 }
262
263 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
264 throws PortalException, SystemException {
265 return bookmarksEntryPersistence.findByPrimaryKey(primaryKeyObj);
266 }
267
268
277 public BookmarksEntry getBookmarksEntryByUuidAndGroupId(String uuid,
278 long groupId) throws PortalException, SystemException {
279 return bookmarksEntryPersistence.findByUUID_G(uuid, groupId);
280 }
281
282
294 public List<BookmarksEntry> getBookmarksEntries(int start, int end)
295 throws SystemException {
296 return bookmarksEntryPersistence.findAll(start, end);
297 }
298
299
305 public int getBookmarksEntriesCount() throws SystemException {
306 return bookmarksEntryPersistence.countAll();
307 }
308
309
316 public BookmarksEntry updateBookmarksEntry(BookmarksEntry bookmarksEntry)
317 throws SystemException {
318 return updateBookmarksEntry(bookmarksEntry, true);
319 }
320
321
329 public BookmarksEntry updateBookmarksEntry(BookmarksEntry bookmarksEntry,
330 boolean merge) throws SystemException {
331 bookmarksEntry.setNew(false);
332
333 bookmarksEntry = bookmarksEntryPersistence.update(bookmarksEntry, merge);
334
335 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
336
337 if (indexer != null) {
338 try {
339 indexer.reindex(bookmarksEntry);
340 }
341 catch (SearchException se) {
342 if (_log.isWarnEnabled()) {
343 _log.warn(se, se);
344 }
345 }
346 }
347
348 return bookmarksEntry;
349 }
350
351
356 public BookmarksEntryLocalService getBookmarksEntryLocalService() {
357 return bookmarksEntryLocalService;
358 }
359
360
365 public void setBookmarksEntryLocalService(
366 BookmarksEntryLocalService bookmarksEntryLocalService) {
367 this.bookmarksEntryLocalService = bookmarksEntryLocalService;
368 }
369
370
375 public BookmarksEntryService getBookmarksEntryService() {
376 return bookmarksEntryService;
377 }
378
379
384 public void setBookmarksEntryService(
385 BookmarksEntryService bookmarksEntryService) {
386 this.bookmarksEntryService = bookmarksEntryService;
387 }
388
389
394 public BookmarksEntryPersistence getBookmarksEntryPersistence() {
395 return bookmarksEntryPersistence;
396 }
397
398
403 public void setBookmarksEntryPersistence(
404 BookmarksEntryPersistence bookmarksEntryPersistence) {
405 this.bookmarksEntryPersistence = bookmarksEntryPersistence;
406 }
407
408
413 public BookmarksEntryFinder getBookmarksEntryFinder() {
414 return bookmarksEntryFinder;
415 }
416
417
422 public void setBookmarksEntryFinder(
423 BookmarksEntryFinder bookmarksEntryFinder) {
424 this.bookmarksEntryFinder = bookmarksEntryFinder;
425 }
426
427
432 public BookmarksFolderLocalService getBookmarksFolderLocalService() {
433 return bookmarksFolderLocalService;
434 }
435
436
441 public void setBookmarksFolderLocalService(
442 BookmarksFolderLocalService bookmarksFolderLocalService) {
443 this.bookmarksFolderLocalService = bookmarksFolderLocalService;
444 }
445
446
451 public BookmarksFolderService getBookmarksFolderService() {
452 return bookmarksFolderService;
453 }
454
455
460 public void setBookmarksFolderService(
461 BookmarksFolderService bookmarksFolderService) {
462 this.bookmarksFolderService = bookmarksFolderService;
463 }
464
465
470 public BookmarksFolderPersistence getBookmarksFolderPersistence() {
471 return bookmarksFolderPersistence;
472 }
473
474
479 public void setBookmarksFolderPersistence(
480 BookmarksFolderPersistence bookmarksFolderPersistence) {
481 this.bookmarksFolderPersistence = bookmarksFolderPersistence;
482 }
483
484
489 public CounterLocalService getCounterLocalService() {
490 return counterLocalService;
491 }
492
493
498 public void setCounterLocalService(CounterLocalService counterLocalService) {
499 this.counterLocalService = counterLocalService;
500 }
501
502
507 public ResourceLocalService getResourceLocalService() {
508 return resourceLocalService;
509 }
510
511
516 public void setResourceLocalService(
517 ResourceLocalService resourceLocalService) {
518 this.resourceLocalService = resourceLocalService;
519 }
520
521
526 public ResourceService getResourceService() {
527 return resourceService;
528 }
529
530
535 public void setResourceService(ResourceService resourceService) {
536 this.resourceService = resourceService;
537 }
538
539
544 public ResourcePersistence getResourcePersistence() {
545 return resourcePersistence;
546 }
547
548
553 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
554 this.resourcePersistence = resourcePersistence;
555 }
556
557
562 public ResourceFinder getResourceFinder() {
563 return resourceFinder;
564 }
565
566
571 public void setResourceFinder(ResourceFinder resourceFinder) {
572 this.resourceFinder = resourceFinder;
573 }
574
575
580 public UserLocalService getUserLocalService() {
581 return userLocalService;
582 }
583
584
589 public void setUserLocalService(UserLocalService userLocalService) {
590 this.userLocalService = userLocalService;
591 }
592
593
598 public UserService getUserService() {
599 return userService;
600 }
601
602
607 public void setUserService(UserService userService) {
608 this.userService = userService;
609 }
610
611
616 public UserPersistence getUserPersistence() {
617 return userPersistence;
618 }
619
620
625 public void setUserPersistence(UserPersistence userPersistence) {
626 this.userPersistence = userPersistence;
627 }
628
629
634 public UserFinder getUserFinder() {
635 return userFinder;
636 }
637
638
643 public void setUserFinder(UserFinder userFinder) {
644 this.userFinder = userFinder;
645 }
646
647
652 public AssetEntryLocalService getAssetEntryLocalService() {
653 return assetEntryLocalService;
654 }
655
656
661 public void setAssetEntryLocalService(
662 AssetEntryLocalService assetEntryLocalService) {
663 this.assetEntryLocalService = assetEntryLocalService;
664 }
665
666
671 public AssetEntryService getAssetEntryService() {
672 return assetEntryService;
673 }
674
675
680 public void setAssetEntryService(AssetEntryService assetEntryService) {
681 this.assetEntryService = assetEntryService;
682 }
683
684
689 public AssetEntryPersistence getAssetEntryPersistence() {
690 return assetEntryPersistence;
691 }
692
693
698 public void setAssetEntryPersistence(
699 AssetEntryPersistence assetEntryPersistence) {
700 this.assetEntryPersistence = assetEntryPersistence;
701 }
702
703
708 public AssetEntryFinder getAssetEntryFinder() {
709 return assetEntryFinder;
710 }
711
712
717 public void setAssetEntryFinder(AssetEntryFinder assetEntryFinder) {
718 this.assetEntryFinder = assetEntryFinder;
719 }
720
721
726 public AssetLinkLocalService getAssetLinkLocalService() {
727 return assetLinkLocalService;
728 }
729
730
735 public void setAssetLinkLocalService(
736 AssetLinkLocalService assetLinkLocalService) {
737 this.assetLinkLocalService = assetLinkLocalService;
738 }
739
740
745 public AssetLinkPersistence getAssetLinkPersistence() {
746 return assetLinkPersistence;
747 }
748
749
754 public void setAssetLinkPersistence(
755 AssetLinkPersistence assetLinkPersistence) {
756 this.assetLinkPersistence = assetLinkPersistence;
757 }
758
759
764 public AssetTagLocalService getAssetTagLocalService() {
765 return assetTagLocalService;
766 }
767
768
773 public void setAssetTagLocalService(
774 AssetTagLocalService assetTagLocalService) {
775 this.assetTagLocalService = assetTagLocalService;
776 }
777
778
783 public AssetTagService getAssetTagService() {
784 return assetTagService;
785 }
786
787
792 public void setAssetTagService(AssetTagService assetTagService) {
793 this.assetTagService = assetTagService;
794 }
795
796
801 public AssetTagPersistence getAssetTagPersistence() {
802 return assetTagPersistence;
803 }
804
805
810 public void setAssetTagPersistence(AssetTagPersistence assetTagPersistence) {
811 this.assetTagPersistence = assetTagPersistence;
812 }
813
814
819 public AssetTagFinder getAssetTagFinder() {
820 return assetTagFinder;
821 }
822
823
828 public void setAssetTagFinder(AssetTagFinder assetTagFinder) {
829 this.assetTagFinder = assetTagFinder;
830 }
831
832
837 public ExpandoValueLocalService getExpandoValueLocalService() {
838 return expandoValueLocalService;
839 }
840
841
846 public void setExpandoValueLocalService(
847 ExpandoValueLocalService expandoValueLocalService) {
848 this.expandoValueLocalService = expandoValueLocalService;
849 }
850
851
856 public ExpandoValueService getExpandoValueService() {
857 return expandoValueService;
858 }
859
860
865 public void setExpandoValueService(ExpandoValueService expandoValueService) {
866 this.expandoValueService = expandoValueService;
867 }
868
869
874 public ExpandoValuePersistence getExpandoValuePersistence() {
875 return expandoValuePersistence;
876 }
877
878
883 public void setExpandoValuePersistence(
884 ExpandoValuePersistence expandoValuePersistence) {
885 this.expandoValuePersistence = expandoValuePersistence;
886 }
887
888 public void afterPropertiesSet() {
889 persistedModelLocalServiceRegistry.register("com.liferay.portlet.bookmarks.model.BookmarksEntry",
890 bookmarksEntryLocalService);
891 }
892
893 public void destroy() {
894 persistedModelLocalServiceRegistry.unregister(
895 "com.liferay.portlet.bookmarks.model.BookmarksEntry");
896 }
897
898
903 public String getBeanIdentifier() {
904 return _beanIdentifier;
905 }
906
907
912 public void setBeanIdentifier(String beanIdentifier) {
913 _beanIdentifier = beanIdentifier;
914 }
915
916 protected Class<?> getModelClass() {
917 return BookmarksEntry.class;
918 }
919
920 protected String getModelClassName() {
921 return BookmarksEntry.class.getName();
922 }
923
924
929 protected void runSQL(String sql) throws SystemException {
930 try {
931 DataSource dataSource = bookmarksEntryPersistence.getDataSource();
932
933 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
934 sql, new int[0]);
935
936 sqlUpdate.update();
937 }
938 catch (Exception e) {
939 throw new SystemException(e);
940 }
941 }
942
943 @BeanReference(type = BookmarksEntryLocalService.class)
944 protected BookmarksEntryLocalService bookmarksEntryLocalService;
945 @BeanReference(type = BookmarksEntryService.class)
946 protected BookmarksEntryService bookmarksEntryService;
947 @BeanReference(type = BookmarksEntryPersistence.class)
948 protected BookmarksEntryPersistence bookmarksEntryPersistence;
949 @BeanReference(type = BookmarksEntryFinder.class)
950 protected BookmarksEntryFinder bookmarksEntryFinder;
951 @BeanReference(type = BookmarksFolderLocalService.class)
952 protected BookmarksFolderLocalService bookmarksFolderLocalService;
953 @BeanReference(type = BookmarksFolderService.class)
954 protected BookmarksFolderService bookmarksFolderService;
955 @BeanReference(type = BookmarksFolderPersistence.class)
956 protected BookmarksFolderPersistence bookmarksFolderPersistence;
957 @BeanReference(type = CounterLocalService.class)
958 protected CounterLocalService counterLocalService;
959 @BeanReference(type = ResourceLocalService.class)
960 protected ResourceLocalService resourceLocalService;
961 @BeanReference(type = ResourceService.class)
962 protected ResourceService resourceService;
963 @BeanReference(type = ResourcePersistence.class)
964 protected ResourcePersistence resourcePersistence;
965 @BeanReference(type = ResourceFinder.class)
966 protected ResourceFinder resourceFinder;
967 @BeanReference(type = UserLocalService.class)
968 protected UserLocalService userLocalService;
969 @BeanReference(type = UserService.class)
970 protected UserService userService;
971 @BeanReference(type = UserPersistence.class)
972 protected UserPersistence userPersistence;
973 @BeanReference(type = UserFinder.class)
974 protected UserFinder userFinder;
975 @BeanReference(type = AssetEntryLocalService.class)
976 protected AssetEntryLocalService assetEntryLocalService;
977 @BeanReference(type = AssetEntryService.class)
978 protected AssetEntryService assetEntryService;
979 @BeanReference(type = AssetEntryPersistence.class)
980 protected AssetEntryPersistence assetEntryPersistence;
981 @BeanReference(type = AssetEntryFinder.class)
982 protected AssetEntryFinder assetEntryFinder;
983 @BeanReference(type = AssetLinkLocalService.class)
984 protected AssetLinkLocalService assetLinkLocalService;
985 @BeanReference(type = AssetLinkPersistence.class)
986 protected AssetLinkPersistence assetLinkPersistence;
987 @BeanReference(type = AssetTagLocalService.class)
988 protected AssetTagLocalService assetTagLocalService;
989 @BeanReference(type = AssetTagService.class)
990 protected AssetTagService assetTagService;
991 @BeanReference(type = AssetTagPersistence.class)
992 protected AssetTagPersistence assetTagPersistence;
993 @BeanReference(type = AssetTagFinder.class)
994 protected AssetTagFinder assetTagFinder;
995 @BeanReference(type = ExpandoValueLocalService.class)
996 protected ExpandoValueLocalService expandoValueLocalService;
997 @BeanReference(type = ExpandoValueService.class)
998 protected ExpandoValueService expandoValueService;
999 @BeanReference(type = ExpandoValuePersistence.class)
1000 protected ExpandoValuePersistence expandoValuePersistence;
1001 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1002 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1003 private static Log _log = LogFactoryUtil.getLog(BookmarksEntryLocalServiceBaseImpl.class);
1004 private String _beanIdentifier;
1005 }