001
014
015 package com.liferay.portlet.shopping.service.base;
016
017 import com.liferay.portal.kernel.bean.BeanReference;
018 import com.liferay.portal.kernel.bean.IdentifiableBean;
019 import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
020 import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
021 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
022 import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
023 import com.liferay.portal.kernel.dao.orm.Projection;
024 import com.liferay.portal.kernel.exception.PortalException;
025 import com.liferay.portal.kernel.exception.SystemException;
026 import com.liferay.portal.kernel.search.Indexable;
027 import com.liferay.portal.kernel.search.IndexableType;
028 import com.liferay.portal.kernel.util.OrderByComparator;
029 import com.liferay.portal.model.PersistedModel;
030 import com.liferay.portal.service.BaseLocalServiceImpl;
031 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
032 import com.liferay.portal.service.persistence.ImagePersistence;
033 import com.liferay.portal.service.persistence.UserFinder;
034 import com.liferay.portal.service.persistence.UserPersistence;
035
036 import com.liferay.portlet.shopping.model.ShoppingItem;
037 import com.liferay.portlet.shopping.service.ShoppingItemLocalService;
038 import com.liferay.portlet.shopping.service.persistence.ShoppingCartPersistence;
039 import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
040 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponFinder;
041 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponPersistence;
042 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFieldPersistence;
043 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
044 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
045 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
046 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderFinder;
047 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderItemPersistence;
048 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderPersistence;
049
050 import java.io.Serializable;
051
052 import java.util.List;
053
054 import javax.sql.DataSource;
055
056
068 public abstract class ShoppingItemLocalServiceBaseImpl
069 extends BaseLocalServiceImpl implements ShoppingItemLocalService,
070 IdentifiableBean {
071
076
077
084 @Indexable(type = IndexableType.REINDEX)
085 @Override
086 public ShoppingItem addShoppingItem(ShoppingItem shoppingItem)
087 throws SystemException {
088 shoppingItem.setNew(true);
089
090 return shoppingItemPersistence.update(shoppingItem);
091 }
092
093
099 @Override
100 public ShoppingItem createShoppingItem(long itemId) {
101 return shoppingItemPersistence.create(itemId);
102 }
103
104
112 @Indexable(type = IndexableType.DELETE)
113 @Override
114 public ShoppingItem deleteShoppingItem(long itemId)
115 throws PortalException, SystemException {
116 return shoppingItemPersistence.remove(itemId);
117 }
118
119
126 @Indexable(type = IndexableType.DELETE)
127 @Override
128 public ShoppingItem deleteShoppingItem(ShoppingItem shoppingItem)
129 throws SystemException {
130 return shoppingItemPersistence.remove(shoppingItem);
131 }
132
133 @Override
134 public DynamicQuery dynamicQuery() {
135 Class<?> clazz = getClass();
136
137 return DynamicQueryFactoryUtil.forClass(ShoppingItem.class,
138 clazz.getClassLoader());
139 }
140
141
148 @Override
149 @SuppressWarnings("rawtypes")
150 public List dynamicQuery(DynamicQuery dynamicQuery)
151 throws SystemException {
152 return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery);
153 }
154
155
168 @Override
169 @SuppressWarnings("rawtypes")
170 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
171 throws SystemException {
172 return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery,
173 start, end);
174 }
175
176
190 @Override
191 @SuppressWarnings("rawtypes")
192 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
193 OrderByComparator orderByComparator) throws SystemException {
194 return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery,
195 start, end, orderByComparator);
196 }
197
198
205 @Override
206 public long dynamicQueryCount(DynamicQuery dynamicQuery)
207 throws SystemException {
208 return shoppingItemPersistence.countWithDynamicQuery(dynamicQuery);
209 }
210
211
219 @Override
220 public long dynamicQueryCount(DynamicQuery dynamicQuery,
221 Projection projection) throws SystemException {
222 return shoppingItemPersistence.countWithDynamicQuery(dynamicQuery,
223 projection);
224 }
225
226 @Override
227 public ShoppingItem fetchShoppingItem(long itemId)
228 throws SystemException {
229 return shoppingItemPersistence.fetchByPrimaryKey(itemId);
230 }
231
232
240 @Override
241 public ShoppingItem getShoppingItem(long itemId)
242 throws PortalException, SystemException {
243 return shoppingItemPersistence.findByPrimaryKey(itemId);
244 }
245
246 @Override
247 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
248 throws PortalException, SystemException {
249 return shoppingItemPersistence.findByPrimaryKey(primaryKeyObj);
250 }
251
252
264 @Override
265 public List<ShoppingItem> getShoppingItems(int start, int end)
266 throws SystemException {
267 return shoppingItemPersistence.findAll(start, end);
268 }
269
270
276 @Override
277 public int getShoppingItemsCount() throws SystemException {
278 return shoppingItemPersistence.countAll();
279 }
280
281
288 @Indexable(type = IndexableType.REINDEX)
289 @Override
290 public ShoppingItem updateShoppingItem(ShoppingItem shoppingItem)
291 throws SystemException {
292 return shoppingItemPersistence.update(shoppingItem);
293 }
294
295
300 public com.liferay.portlet.shopping.service.ShoppingCartLocalService getShoppingCartLocalService() {
301 return shoppingCartLocalService;
302 }
303
304
309 public void setShoppingCartLocalService(
310 com.liferay.portlet.shopping.service.ShoppingCartLocalService shoppingCartLocalService) {
311 this.shoppingCartLocalService = shoppingCartLocalService;
312 }
313
314
319 public ShoppingCartPersistence getShoppingCartPersistence() {
320 return shoppingCartPersistence;
321 }
322
323
328 public void setShoppingCartPersistence(
329 ShoppingCartPersistence shoppingCartPersistence) {
330 this.shoppingCartPersistence = shoppingCartPersistence;
331 }
332
333
338 public com.liferay.portlet.shopping.service.ShoppingCategoryLocalService getShoppingCategoryLocalService() {
339 return shoppingCategoryLocalService;
340 }
341
342
347 public void setShoppingCategoryLocalService(
348 com.liferay.portlet.shopping.service.ShoppingCategoryLocalService shoppingCategoryLocalService) {
349 this.shoppingCategoryLocalService = shoppingCategoryLocalService;
350 }
351
352
357 public com.liferay.portlet.shopping.service.ShoppingCategoryService getShoppingCategoryService() {
358 return shoppingCategoryService;
359 }
360
361
366 public void setShoppingCategoryService(
367 com.liferay.portlet.shopping.service.ShoppingCategoryService shoppingCategoryService) {
368 this.shoppingCategoryService = shoppingCategoryService;
369 }
370
371
376 public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
377 return shoppingCategoryPersistence;
378 }
379
380
385 public void setShoppingCategoryPersistence(
386 ShoppingCategoryPersistence shoppingCategoryPersistence) {
387 this.shoppingCategoryPersistence = shoppingCategoryPersistence;
388 }
389
390
395 public com.liferay.portlet.shopping.service.ShoppingCouponLocalService getShoppingCouponLocalService() {
396 return shoppingCouponLocalService;
397 }
398
399
404 public void setShoppingCouponLocalService(
405 com.liferay.portlet.shopping.service.ShoppingCouponLocalService shoppingCouponLocalService) {
406 this.shoppingCouponLocalService = shoppingCouponLocalService;
407 }
408
409
414 public com.liferay.portlet.shopping.service.ShoppingCouponService getShoppingCouponService() {
415 return shoppingCouponService;
416 }
417
418
423 public void setShoppingCouponService(
424 com.liferay.portlet.shopping.service.ShoppingCouponService shoppingCouponService) {
425 this.shoppingCouponService = shoppingCouponService;
426 }
427
428
433 public ShoppingCouponPersistence getShoppingCouponPersistence() {
434 return shoppingCouponPersistence;
435 }
436
437
442 public void setShoppingCouponPersistence(
443 ShoppingCouponPersistence shoppingCouponPersistence) {
444 this.shoppingCouponPersistence = shoppingCouponPersistence;
445 }
446
447
452 public ShoppingCouponFinder getShoppingCouponFinder() {
453 return shoppingCouponFinder;
454 }
455
456
461 public void setShoppingCouponFinder(
462 ShoppingCouponFinder shoppingCouponFinder) {
463 this.shoppingCouponFinder = shoppingCouponFinder;
464 }
465
466
471 public com.liferay.portlet.shopping.service.ShoppingItemLocalService getShoppingItemLocalService() {
472 return shoppingItemLocalService;
473 }
474
475
480 public void setShoppingItemLocalService(
481 com.liferay.portlet.shopping.service.ShoppingItemLocalService shoppingItemLocalService) {
482 this.shoppingItemLocalService = shoppingItemLocalService;
483 }
484
485
490 public com.liferay.portlet.shopping.service.ShoppingItemService getShoppingItemService() {
491 return shoppingItemService;
492 }
493
494
499 public void setShoppingItemService(
500 com.liferay.portlet.shopping.service.ShoppingItemService shoppingItemService) {
501 this.shoppingItemService = shoppingItemService;
502 }
503
504
509 public ShoppingItemPersistence getShoppingItemPersistence() {
510 return shoppingItemPersistence;
511 }
512
513
518 public void setShoppingItemPersistence(
519 ShoppingItemPersistence shoppingItemPersistence) {
520 this.shoppingItemPersistence = shoppingItemPersistence;
521 }
522
523
528 public ShoppingItemFinder getShoppingItemFinder() {
529 return shoppingItemFinder;
530 }
531
532
537 public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
538 this.shoppingItemFinder = shoppingItemFinder;
539 }
540
541
546 public com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
547 return shoppingItemFieldLocalService;
548 }
549
550
555 public void setShoppingItemFieldLocalService(
556 com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
557 this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
558 }
559
560
565 public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
566 return shoppingItemFieldPersistence;
567 }
568
569
574 public void setShoppingItemFieldPersistence(
575 ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
576 this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
577 }
578
579
584 public com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
585 return shoppingItemPriceLocalService;
586 }
587
588
593 public void setShoppingItemPriceLocalService(
594 com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
595 this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
596 }
597
598
603 public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
604 return shoppingItemPricePersistence;
605 }
606
607
612 public void setShoppingItemPricePersistence(
613 ShoppingItemPricePersistence shoppingItemPricePersistence) {
614 this.shoppingItemPricePersistence = shoppingItemPricePersistence;
615 }
616
617
622 public com.liferay.portlet.shopping.service.ShoppingOrderLocalService getShoppingOrderLocalService() {
623 return shoppingOrderLocalService;
624 }
625
626
631 public void setShoppingOrderLocalService(
632 com.liferay.portlet.shopping.service.ShoppingOrderLocalService shoppingOrderLocalService) {
633 this.shoppingOrderLocalService = shoppingOrderLocalService;
634 }
635
636
641 public com.liferay.portlet.shopping.service.ShoppingOrderService getShoppingOrderService() {
642 return shoppingOrderService;
643 }
644
645
650 public void setShoppingOrderService(
651 com.liferay.portlet.shopping.service.ShoppingOrderService shoppingOrderService) {
652 this.shoppingOrderService = shoppingOrderService;
653 }
654
655
660 public ShoppingOrderPersistence getShoppingOrderPersistence() {
661 return shoppingOrderPersistence;
662 }
663
664
669 public void setShoppingOrderPersistence(
670 ShoppingOrderPersistence shoppingOrderPersistence) {
671 this.shoppingOrderPersistence = shoppingOrderPersistence;
672 }
673
674
679 public ShoppingOrderFinder getShoppingOrderFinder() {
680 return shoppingOrderFinder;
681 }
682
683
688 public void setShoppingOrderFinder(ShoppingOrderFinder shoppingOrderFinder) {
689 this.shoppingOrderFinder = shoppingOrderFinder;
690 }
691
692
697 public com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService getShoppingOrderItemLocalService() {
698 return shoppingOrderItemLocalService;
699 }
700
701
706 public void setShoppingOrderItemLocalService(
707 com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService shoppingOrderItemLocalService) {
708 this.shoppingOrderItemLocalService = shoppingOrderItemLocalService;
709 }
710
711
716 public ShoppingOrderItemPersistence getShoppingOrderItemPersistence() {
717 return shoppingOrderItemPersistence;
718 }
719
720
725 public void setShoppingOrderItemPersistence(
726 ShoppingOrderItemPersistence shoppingOrderItemPersistence) {
727 this.shoppingOrderItemPersistence = shoppingOrderItemPersistence;
728 }
729
730
735 public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
736 return counterLocalService;
737 }
738
739
744 public void setCounterLocalService(
745 com.liferay.counter.service.CounterLocalService counterLocalService) {
746 this.counterLocalService = counterLocalService;
747 }
748
749
754 public com.liferay.portal.service.ImageLocalService getImageLocalService() {
755 return imageLocalService;
756 }
757
758
763 public void setImageLocalService(
764 com.liferay.portal.service.ImageLocalService imageLocalService) {
765 this.imageLocalService = imageLocalService;
766 }
767
768
773 public com.liferay.portal.service.ImageService getImageService() {
774 return imageService;
775 }
776
777
782 public void setImageService(
783 com.liferay.portal.service.ImageService imageService) {
784 this.imageService = imageService;
785 }
786
787
792 public ImagePersistence getImagePersistence() {
793 return imagePersistence;
794 }
795
796
801 public void setImagePersistence(ImagePersistence imagePersistence) {
802 this.imagePersistence = imagePersistence;
803 }
804
805
810 public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
811 return resourceLocalService;
812 }
813
814
819 public void setResourceLocalService(
820 com.liferay.portal.service.ResourceLocalService resourceLocalService) {
821 this.resourceLocalService = resourceLocalService;
822 }
823
824
829 public com.liferay.portal.service.UserLocalService getUserLocalService() {
830 return userLocalService;
831 }
832
833
838 public void setUserLocalService(
839 com.liferay.portal.service.UserLocalService userLocalService) {
840 this.userLocalService = userLocalService;
841 }
842
843
848 public com.liferay.portal.service.UserService getUserService() {
849 return userService;
850 }
851
852
857 public void setUserService(
858 com.liferay.portal.service.UserService userService) {
859 this.userService = userService;
860 }
861
862
867 public UserPersistence getUserPersistence() {
868 return userPersistence;
869 }
870
871
876 public void setUserPersistence(UserPersistence userPersistence) {
877 this.userPersistence = userPersistence;
878 }
879
880
885 public UserFinder getUserFinder() {
886 return userFinder;
887 }
888
889
894 public void setUserFinder(UserFinder userFinder) {
895 this.userFinder = userFinder;
896 }
897
898 public void afterPropertiesSet() {
899 persistedModelLocalServiceRegistry.register("com.liferay.portlet.shopping.model.ShoppingItem",
900 shoppingItemLocalService);
901 }
902
903 public void destroy() {
904 persistedModelLocalServiceRegistry.unregister(
905 "com.liferay.portlet.shopping.model.ShoppingItem");
906 }
907
908
913 @Override
914 public String getBeanIdentifier() {
915 return _beanIdentifier;
916 }
917
918
923 @Override
924 public void setBeanIdentifier(String beanIdentifier) {
925 _beanIdentifier = beanIdentifier;
926 }
927
928 protected Class<?> getModelClass() {
929 return ShoppingItem.class;
930 }
931
932 protected String getModelClassName() {
933 return ShoppingItem.class.getName();
934 }
935
936
941 protected void runSQL(String sql) throws SystemException {
942 try {
943 DataSource dataSource = shoppingItemPersistence.getDataSource();
944
945 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
946 sql, new int[0]);
947
948 sqlUpdate.update();
949 }
950 catch (Exception e) {
951 throw new SystemException(e);
952 }
953 }
954
955 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCartLocalService.class)
956 protected com.liferay.portlet.shopping.service.ShoppingCartLocalService shoppingCartLocalService;
957 @BeanReference(type = ShoppingCartPersistence.class)
958 protected ShoppingCartPersistence shoppingCartPersistence;
959 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCategoryLocalService.class)
960 protected com.liferay.portlet.shopping.service.ShoppingCategoryLocalService shoppingCategoryLocalService;
961 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCategoryService.class)
962 protected com.liferay.portlet.shopping.service.ShoppingCategoryService shoppingCategoryService;
963 @BeanReference(type = ShoppingCategoryPersistence.class)
964 protected ShoppingCategoryPersistence shoppingCategoryPersistence;
965 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCouponLocalService.class)
966 protected com.liferay.portlet.shopping.service.ShoppingCouponLocalService shoppingCouponLocalService;
967 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCouponService.class)
968 protected com.liferay.portlet.shopping.service.ShoppingCouponService shoppingCouponService;
969 @BeanReference(type = ShoppingCouponPersistence.class)
970 protected ShoppingCouponPersistence shoppingCouponPersistence;
971 @BeanReference(type = ShoppingCouponFinder.class)
972 protected ShoppingCouponFinder shoppingCouponFinder;
973 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemLocalService.class)
974 protected com.liferay.portlet.shopping.service.ShoppingItemLocalService shoppingItemLocalService;
975 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemService.class)
976 protected com.liferay.portlet.shopping.service.ShoppingItemService shoppingItemService;
977 @BeanReference(type = ShoppingItemPersistence.class)
978 protected ShoppingItemPersistence shoppingItemPersistence;
979 @BeanReference(type = ShoppingItemFinder.class)
980 protected ShoppingItemFinder shoppingItemFinder;
981 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService.class)
982 protected com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService shoppingItemFieldLocalService;
983 @BeanReference(type = ShoppingItemFieldPersistence.class)
984 protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
985 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService.class)
986 protected com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService shoppingItemPriceLocalService;
987 @BeanReference(type = ShoppingItemPricePersistence.class)
988 protected ShoppingItemPricePersistence shoppingItemPricePersistence;
989 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingOrderLocalService.class)
990 protected com.liferay.portlet.shopping.service.ShoppingOrderLocalService shoppingOrderLocalService;
991 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingOrderService.class)
992 protected com.liferay.portlet.shopping.service.ShoppingOrderService shoppingOrderService;
993 @BeanReference(type = ShoppingOrderPersistence.class)
994 protected ShoppingOrderPersistence shoppingOrderPersistence;
995 @BeanReference(type = ShoppingOrderFinder.class)
996 protected ShoppingOrderFinder shoppingOrderFinder;
997 @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService.class)
998 protected com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService shoppingOrderItemLocalService;
999 @BeanReference(type = ShoppingOrderItemPersistence.class)
1000 protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
1001 @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
1002 protected com.liferay.counter.service.CounterLocalService counterLocalService;
1003 @BeanReference(type = com.liferay.portal.service.ImageLocalService.class)
1004 protected com.liferay.portal.service.ImageLocalService imageLocalService;
1005 @BeanReference(type = com.liferay.portal.service.ImageService.class)
1006 protected com.liferay.portal.service.ImageService imageService;
1007 @BeanReference(type = ImagePersistence.class)
1008 protected ImagePersistence imagePersistence;
1009 @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
1010 protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
1011 @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
1012 protected com.liferay.portal.service.UserLocalService userLocalService;
1013 @BeanReference(type = com.liferay.portal.service.UserService.class)
1014 protected com.liferay.portal.service.UserService userService;
1015 @BeanReference(type = UserPersistence.class)
1016 protected UserPersistence userPersistence;
1017 @BeanReference(type = UserFinder.class)
1018 protected UserFinder userFinder;
1019 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1020 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1021 private String _beanIdentifier;
1022 }