001
014
015 package com.liferay.portlet.shopping.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.dao.orm.DynamicQueryFactoryUtil;
025 import com.liferay.portal.kernel.exception.PortalException;
026 import com.liferay.portal.kernel.exception.SystemException;
027 import com.liferay.portal.kernel.search.Indexable;
028 import com.liferay.portal.kernel.search.IndexableType;
029 import com.liferay.portal.kernel.util.OrderByComparator;
030 import com.liferay.portal.model.PersistedModel;
031 import com.liferay.portal.service.BaseLocalServiceImpl;
032 import com.liferay.portal.service.ImageLocalService;
033 import com.liferay.portal.service.ImageService;
034 import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
035 import com.liferay.portal.service.ResourceLocalService;
036 import com.liferay.portal.service.ResourceService;
037 import com.liferay.portal.service.UserLocalService;
038 import com.liferay.portal.service.UserService;
039 import com.liferay.portal.service.persistence.ImagePersistence;
040 import com.liferay.portal.service.persistence.ResourceFinder;
041 import com.liferay.portal.service.persistence.ResourcePersistence;
042 import com.liferay.portal.service.persistence.UserFinder;
043 import com.liferay.portal.service.persistence.UserPersistence;
044
045 import com.liferay.portlet.shopping.model.ShoppingItem;
046 import com.liferay.portlet.shopping.service.ShoppingCartLocalService;
047 import com.liferay.portlet.shopping.service.ShoppingCategoryLocalService;
048 import com.liferay.portlet.shopping.service.ShoppingCategoryService;
049 import com.liferay.portlet.shopping.service.ShoppingCouponLocalService;
050 import com.liferay.portlet.shopping.service.ShoppingCouponService;
051 import com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService;
052 import com.liferay.portlet.shopping.service.ShoppingItemLocalService;
053 import com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService;
054 import com.liferay.portlet.shopping.service.ShoppingItemService;
055 import com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService;
056 import com.liferay.portlet.shopping.service.ShoppingOrderLocalService;
057 import com.liferay.portlet.shopping.service.ShoppingOrderService;
058 import com.liferay.portlet.shopping.service.persistence.ShoppingCartPersistence;
059 import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
060 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponFinder;
061 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponPersistence;
062 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFieldPersistence;
063 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
064 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
065 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
066 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderFinder;
067 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderItemPersistence;
068 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderPersistence;
069
070 import java.io.Serializable;
071
072 import java.util.List;
073
074 import javax.sql.DataSource;
075
076
088 public abstract class ShoppingItemLocalServiceBaseImpl
089 extends BaseLocalServiceImpl implements ShoppingItemLocalService,
090 IdentifiableBean {
091
096
097
104 @Indexable(type = IndexableType.REINDEX)
105 public ShoppingItem addShoppingItem(ShoppingItem shoppingItem)
106 throws SystemException {
107 shoppingItem.setNew(true);
108
109 return shoppingItemPersistence.update(shoppingItem, false);
110 }
111
112
118 public ShoppingItem createShoppingItem(long itemId) {
119 return shoppingItemPersistence.create(itemId);
120 }
121
122
130 @Indexable(type = IndexableType.DELETE)
131 public ShoppingItem deleteShoppingItem(long itemId)
132 throws PortalException, SystemException {
133 return shoppingItemPersistence.remove(itemId);
134 }
135
136
143 @Indexable(type = IndexableType.DELETE)
144 public ShoppingItem deleteShoppingItem(ShoppingItem shoppingItem)
145 throws SystemException {
146 return shoppingItemPersistence.remove(shoppingItem);
147 }
148
149 public DynamicQuery dynamicQuery() {
150 Class<?> clazz = getClass();
151
152 return DynamicQueryFactoryUtil.forClass(ShoppingItem.class,
153 clazz.getClassLoader());
154 }
155
156
163 @SuppressWarnings("rawtypes")
164 public List dynamicQuery(DynamicQuery dynamicQuery)
165 throws SystemException {
166 return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery);
167 }
168
169
182 @SuppressWarnings("rawtypes")
183 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
184 throws SystemException {
185 return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery,
186 start, end);
187 }
188
189
203 @SuppressWarnings("rawtypes")
204 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
205 OrderByComparator orderByComparator) throws SystemException {
206 return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery,
207 start, end, orderByComparator);
208 }
209
210
217 public long dynamicQueryCount(DynamicQuery dynamicQuery)
218 throws SystemException {
219 return shoppingItemPersistence.countWithDynamicQuery(dynamicQuery);
220 }
221
222 public ShoppingItem fetchShoppingItem(long itemId)
223 throws SystemException {
224 return shoppingItemPersistence.fetchByPrimaryKey(itemId);
225 }
226
227
235 public ShoppingItem getShoppingItem(long itemId)
236 throws PortalException, SystemException {
237 return shoppingItemPersistence.findByPrimaryKey(itemId);
238 }
239
240 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
241 throws PortalException, SystemException {
242 return shoppingItemPersistence.findByPrimaryKey(primaryKeyObj);
243 }
244
245
257 public List<ShoppingItem> getShoppingItems(int start, int end)
258 throws SystemException {
259 return shoppingItemPersistence.findAll(start, end);
260 }
261
262
268 public int getShoppingItemsCount() throws SystemException {
269 return shoppingItemPersistence.countAll();
270 }
271
272
279 @Indexable(type = IndexableType.REINDEX)
280 public ShoppingItem updateShoppingItem(ShoppingItem shoppingItem)
281 throws SystemException {
282 return updateShoppingItem(shoppingItem, true);
283 }
284
285
293 @Indexable(type = IndexableType.REINDEX)
294 public ShoppingItem updateShoppingItem(ShoppingItem shoppingItem,
295 boolean merge) throws SystemException {
296 shoppingItem.setNew(false);
297
298 return shoppingItemPersistence.update(shoppingItem, merge);
299 }
300
301
306 public ShoppingCartLocalService getShoppingCartLocalService() {
307 return shoppingCartLocalService;
308 }
309
310
315 public void setShoppingCartLocalService(
316 ShoppingCartLocalService shoppingCartLocalService) {
317 this.shoppingCartLocalService = shoppingCartLocalService;
318 }
319
320
325 public ShoppingCartPersistence getShoppingCartPersistence() {
326 return shoppingCartPersistence;
327 }
328
329
334 public void setShoppingCartPersistence(
335 ShoppingCartPersistence shoppingCartPersistence) {
336 this.shoppingCartPersistence = shoppingCartPersistence;
337 }
338
339
344 public ShoppingCategoryLocalService getShoppingCategoryLocalService() {
345 return shoppingCategoryLocalService;
346 }
347
348
353 public void setShoppingCategoryLocalService(
354 ShoppingCategoryLocalService shoppingCategoryLocalService) {
355 this.shoppingCategoryLocalService = shoppingCategoryLocalService;
356 }
357
358
363 public ShoppingCategoryService getShoppingCategoryService() {
364 return shoppingCategoryService;
365 }
366
367
372 public void setShoppingCategoryService(
373 ShoppingCategoryService shoppingCategoryService) {
374 this.shoppingCategoryService = shoppingCategoryService;
375 }
376
377
382 public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
383 return shoppingCategoryPersistence;
384 }
385
386
391 public void setShoppingCategoryPersistence(
392 ShoppingCategoryPersistence shoppingCategoryPersistence) {
393 this.shoppingCategoryPersistence = shoppingCategoryPersistence;
394 }
395
396
401 public ShoppingCouponLocalService getShoppingCouponLocalService() {
402 return shoppingCouponLocalService;
403 }
404
405
410 public void setShoppingCouponLocalService(
411 ShoppingCouponLocalService shoppingCouponLocalService) {
412 this.shoppingCouponLocalService = shoppingCouponLocalService;
413 }
414
415
420 public ShoppingCouponService getShoppingCouponService() {
421 return shoppingCouponService;
422 }
423
424
429 public void setShoppingCouponService(
430 ShoppingCouponService shoppingCouponService) {
431 this.shoppingCouponService = shoppingCouponService;
432 }
433
434
439 public ShoppingCouponPersistence getShoppingCouponPersistence() {
440 return shoppingCouponPersistence;
441 }
442
443
448 public void setShoppingCouponPersistence(
449 ShoppingCouponPersistence shoppingCouponPersistence) {
450 this.shoppingCouponPersistence = shoppingCouponPersistence;
451 }
452
453
458 public ShoppingCouponFinder getShoppingCouponFinder() {
459 return shoppingCouponFinder;
460 }
461
462
467 public void setShoppingCouponFinder(
468 ShoppingCouponFinder shoppingCouponFinder) {
469 this.shoppingCouponFinder = shoppingCouponFinder;
470 }
471
472
477 public ShoppingItemLocalService getShoppingItemLocalService() {
478 return shoppingItemLocalService;
479 }
480
481
486 public void setShoppingItemLocalService(
487 ShoppingItemLocalService shoppingItemLocalService) {
488 this.shoppingItemLocalService = shoppingItemLocalService;
489 }
490
491
496 public ShoppingItemService getShoppingItemService() {
497 return shoppingItemService;
498 }
499
500
505 public void setShoppingItemService(ShoppingItemService shoppingItemService) {
506 this.shoppingItemService = shoppingItemService;
507 }
508
509
514 public ShoppingItemPersistence getShoppingItemPersistence() {
515 return shoppingItemPersistence;
516 }
517
518
523 public void setShoppingItemPersistence(
524 ShoppingItemPersistence shoppingItemPersistence) {
525 this.shoppingItemPersistence = shoppingItemPersistence;
526 }
527
528
533 public ShoppingItemFinder getShoppingItemFinder() {
534 return shoppingItemFinder;
535 }
536
537
542 public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
543 this.shoppingItemFinder = shoppingItemFinder;
544 }
545
546
551 public ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
552 return shoppingItemFieldLocalService;
553 }
554
555
560 public void setShoppingItemFieldLocalService(
561 ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
562 this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
563 }
564
565
570 public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
571 return shoppingItemFieldPersistence;
572 }
573
574
579 public void setShoppingItemFieldPersistence(
580 ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
581 this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
582 }
583
584
589 public ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
590 return shoppingItemPriceLocalService;
591 }
592
593
598 public void setShoppingItemPriceLocalService(
599 ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
600 this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
601 }
602
603
608 public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
609 return shoppingItemPricePersistence;
610 }
611
612
617 public void setShoppingItemPricePersistence(
618 ShoppingItemPricePersistence shoppingItemPricePersistence) {
619 this.shoppingItemPricePersistence = shoppingItemPricePersistence;
620 }
621
622
627 public ShoppingOrderLocalService getShoppingOrderLocalService() {
628 return shoppingOrderLocalService;
629 }
630
631
636 public void setShoppingOrderLocalService(
637 ShoppingOrderLocalService shoppingOrderLocalService) {
638 this.shoppingOrderLocalService = shoppingOrderLocalService;
639 }
640
641
646 public ShoppingOrderService getShoppingOrderService() {
647 return shoppingOrderService;
648 }
649
650
655 public void setShoppingOrderService(
656 ShoppingOrderService shoppingOrderService) {
657 this.shoppingOrderService = shoppingOrderService;
658 }
659
660
665 public ShoppingOrderPersistence getShoppingOrderPersistence() {
666 return shoppingOrderPersistence;
667 }
668
669
674 public void setShoppingOrderPersistence(
675 ShoppingOrderPersistence shoppingOrderPersistence) {
676 this.shoppingOrderPersistence = shoppingOrderPersistence;
677 }
678
679
684 public ShoppingOrderFinder getShoppingOrderFinder() {
685 return shoppingOrderFinder;
686 }
687
688
693 public void setShoppingOrderFinder(ShoppingOrderFinder shoppingOrderFinder) {
694 this.shoppingOrderFinder = shoppingOrderFinder;
695 }
696
697
702 public ShoppingOrderItemLocalService getShoppingOrderItemLocalService() {
703 return shoppingOrderItemLocalService;
704 }
705
706
711 public void setShoppingOrderItemLocalService(
712 ShoppingOrderItemLocalService shoppingOrderItemLocalService) {
713 this.shoppingOrderItemLocalService = shoppingOrderItemLocalService;
714 }
715
716
721 public ShoppingOrderItemPersistence getShoppingOrderItemPersistence() {
722 return shoppingOrderItemPersistence;
723 }
724
725
730 public void setShoppingOrderItemPersistence(
731 ShoppingOrderItemPersistence shoppingOrderItemPersistence) {
732 this.shoppingOrderItemPersistence = shoppingOrderItemPersistence;
733 }
734
735
740 public CounterLocalService getCounterLocalService() {
741 return counterLocalService;
742 }
743
744
749 public void setCounterLocalService(CounterLocalService counterLocalService) {
750 this.counterLocalService = counterLocalService;
751 }
752
753
758 public ImageLocalService getImageLocalService() {
759 return imageLocalService;
760 }
761
762
767 public void setImageLocalService(ImageLocalService imageLocalService) {
768 this.imageLocalService = imageLocalService;
769 }
770
771
776 public ImageService getImageService() {
777 return imageService;
778 }
779
780
785 public void setImageService(ImageService imageService) {
786 this.imageService = imageService;
787 }
788
789
794 public ImagePersistence getImagePersistence() {
795 return imagePersistence;
796 }
797
798
803 public void setImagePersistence(ImagePersistence imagePersistence) {
804 this.imagePersistence = imagePersistence;
805 }
806
807
812 public ResourceLocalService getResourceLocalService() {
813 return resourceLocalService;
814 }
815
816
821 public void setResourceLocalService(
822 ResourceLocalService resourceLocalService) {
823 this.resourceLocalService = resourceLocalService;
824 }
825
826
831 public ResourceService getResourceService() {
832 return resourceService;
833 }
834
835
840 public void setResourceService(ResourceService resourceService) {
841 this.resourceService = resourceService;
842 }
843
844
849 public ResourcePersistence getResourcePersistence() {
850 return resourcePersistence;
851 }
852
853
858 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
859 this.resourcePersistence = resourcePersistence;
860 }
861
862
867 public ResourceFinder getResourceFinder() {
868 return resourceFinder;
869 }
870
871
876 public void setResourceFinder(ResourceFinder resourceFinder) {
877 this.resourceFinder = resourceFinder;
878 }
879
880
885 public UserLocalService getUserLocalService() {
886 return userLocalService;
887 }
888
889
894 public void setUserLocalService(UserLocalService userLocalService) {
895 this.userLocalService = userLocalService;
896 }
897
898
903 public UserService getUserService() {
904 return userService;
905 }
906
907
912 public void setUserService(UserService userService) {
913 this.userService = userService;
914 }
915
916
921 public UserPersistence getUserPersistence() {
922 return userPersistence;
923 }
924
925
930 public void setUserPersistence(UserPersistence userPersistence) {
931 this.userPersistence = userPersistence;
932 }
933
934
939 public UserFinder getUserFinder() {
940 return userFinder;
941 }
942
943
948 public void setUserFinder(UserFinder userFinder) {
949 this.userFinder = userFinder;
950 }
951
952 public void afterPropertiesSet() {
953 persistedModelLocalServiceRegistry.register("com.liferay.portlet.shopping.model.ShoppingItem",
954 shoppingItemLocalService);
955 }
956
957 public void destroy() {
958 persistedModelLocalServiceRegistry.unregister(
959 "com.liferay.portlet.shopping.model.ShoppingItem");
960 }
961
962
967 public String getBeanIdentifier() {
968 return _beanIdentifier;
969 }
970
971
976 public void setBeanIdentifier(String beanIdentifier) {
977 _beanIdentifier = beanIdentifier;
978 }
979
980 protected Class<?> getModelClass() {
981 return ShoppingItem.class;
982 }
983
984 protected String getModelClassName() {
985 return ShoppingItem.class.getName();
986 }
987
988
993 protected void runSQL(String sql) throws SystemException {
994 try {
995 DataSource dataSource = shoppingItemPersistence.getDataSource();
996
997 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
998 sql, new int[0]);
999
1000 sqlUpdate.update();
1001 }
1002 catch (Exception e) {
1003 throw new SystemException(e);
1004 }
1005 }
1006
1007 @BeanReference(type = ShoppingCartLocalService.class)
1008 protected ShoppingCartLocalService shoppingCartLocalService;
1009 @BeanReference(type = ShoppingCartPersistence.class)
1010 protected ShoppingCartPersistence shoppingCartPersistence;
1011 @BeanReference(type = ShoppingCategoryLocalService.class)
1012 protected ShoppingCategoryLocalService shoppingCategoryLocalService;
1013 @BeanReference(type = ShoppingCategoryService.class)
1014 protected ShoppingCategoryService shoppingCategoryService;
1015 @BeanReference(type = ShoppingCategoryPersistence.class)
1016 protected ShoppingCategoryPersistence shoppingCategoryPersistence;
1017 @BeanReference(type = ShoppingCouponLocalService.class)
1018 protected ShoppingCouponLocalService shoppingCouponLocalService;
1019 @BeanReference(type = ShoppingCouponService.class)
1020 protected ShoppingCouponService shoppingCouponService;
1021 @BeanReference(type = ShoppingCouponPersistence.class)
1022 protected ShoppingCouponPersistence shoppingCouponPersistence;
1023 @BeanReference(type = ShoppingCouponFinder.class)
1024 protected ShoppingCouponFinder shoppingCouponFinder;
1025 @BeanReference(type = ShoppingItemLocalService.class)
1026 protected ShoppingItemLocalService shoppingItemLocalService;
1027 @BeanReference(type = ShoppingItemService.class)
1028 protected ShoppingItemService shoppingItemService;
1029 @BeanReference(type = ShoppingItemPersistence.class)
1030 protected ShoppingItemPersistence shoppingItemPersistence;
1031 @BeanReference(type = ShoppingItemFinder.class)
1032 protected ShoppingItemFinder shoppingItemFinder;
1033 @BeanReference(type = ShoppingItemFieldLocalService.class)
1034 protected ShoppingItemFieldLocalService shoppingItemFieldLocalService;
1035 @BeanReference(type = ShoppingItemFieldPersistence.class)
1036 protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
1037 @BeanReference(type = ShoppingItemPriceLocalService.class)
1038 protected ShoppingItemPriceLocalService shoppingItemPriceLocalService;
1039 @BeanReference(type = ShoppingItemPricePersistence.class)
1040 protected ShoppingItemPricePersistence shoppingItemPricePersistence;
1041 @BeanReference(type = ShoppingOrderLocalService.class)
1042 protected ShoppingOrderLocalService shoppingOrderLocalService;
1043 @BeanReference(type = ShoppingOrderService.class)
1044 protected ShoppingOrderService shoppingOrderService;
1045 @BeanReference(type = ShoppingOrderPersistence.class)
1046 protected ShoppingOrderPersistence shoppingOrderPersistence;
1047 @BeanReference(type = ShoppingOrderFinder.class)
1048 protected ShoppingOrderFinder shoppingOrderFinder;
1049 @BeanReference(type = ShoppingOrderItemLocalService.class)
1050 protected ShoppingOrderItemLocalService shoppingOrderItemLocalService;
1051 @BeanReference(type = ShoppingOrderItemPersistence.class)
1052 protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
1053 @BeanReference(type = CounterLocalService.class)
1054 protected CounterLocalService counterLocalService;
1055 @BeanReference(type = ImageLocalService.class)
1056 protected ImageLocalService imageLocalService;
1057 @BeanReference(type = ImageService.class)
1058 protected ImageService imageService;
1059 @BeanReference(type = ImagePersistence.class)
1060 protected ImagePersistence imagePersistence;
1061 @BeanReference(type = ResourceLocalService.class)
1062 protected ResourceLocalService resourceLocalService;
1063 @BeanReference(type = ResourceService.class)
1064 protected ResourceService resourceService;
1065 @BeanReference(type = ResourcePersistence.class)
1066 protected ResourcePersistence resourcePersistence;
1067 @BeanReference(type = ResourceFinder.class)
1068 protected ResourceFinder resourceFinder;
1069 @BeanReference(type = UserLocalService.class)
1070 protected UserLocalService userLocalService;
1071 @BeanReference(type = UserService.class)
1072 protected UserService userService;
1073 @BeanReference(type = UserPersistence.class)
1074 protected UserPersistence userPersistence;
1075 @BeanReference(type = UserFinder.class)
1076 protected UserFinder userFinder;
1077 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1078 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1079 private String _beanIdentifier;
1080 }