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.PersistedModelLocalServiceRegistry;
033 import com.liferay.portal.service.ResourceLocalService;
034 import com.liferay.portal.service.ResourceService;
035 import com.liferay.portal.service.UserLocalService;
036 import com.liferay.portal.service.UserService;
037 import com.liferay.portal.service.persistence.ResourceFinder;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserFinder;
040 import com.liferay.portal.service.persistence.UserPersistence;
041
042 import com.liferay.portlet.shopping.model.ShoppingCoupon;
043 import com.liferay.portlet.shopping.service.ShoppingCartLocalService;
044 import com.liferay.portlet.shopping.service.ShoppingCategoryLocalService;
045 import com.liferay.portlet.shopping.service.ShoppingCategoryService;
046 import com.liferay.portlet.shopping.service.ShoppingCouponLocalService;
047 import com.liferay.portlet.shopping.service.ShoppingCouponService;
048 import com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService;
049 import com.liferay.portlet.shopping.service.ShoppingItemLocalService;
050 import com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService;
051 import com.liferay.portlet.shopping.service.ShoppingItemService;
052 import com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService;
053 import com.liferay.portlet.shopping.service.ShoppingOrderLocalService;
054 import com.liferay.portlet.shopping.service.ShoppingOrderService;
055 import com.liferay.portlet.shopping.service.persistence.ShoppingCartPersistence;
056 import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
057 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponFinder;
058 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponPersistence;
059 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFieldPersistence;
060 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
061 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
062 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
063 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderFinder;
064 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderItemPersistence;
065 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderPersistence;
066
067 import java.io.Serializable;
068
069 import java.util.List;
070
071 import javax.sql.DataSource;
072
073
085 public abstract class ShoppingCouponLocalServiceBaseImpl
086 extends BaseLocalServiceImpl implements ShoppingCouponLocalService,
087 IdentifiableBean {
088
093
094
101 @Indexable(type = IndexableType.REINDEX)
102 public ShoppingCoupon addShoppingCoupon(ShoppingCoupon shoppingCoupon)
103 throws SystemException {
104 shoppingCoupon.setNew(true);
105
106 return shoppingCouponPersistence.update(shoppingCoupon, false);
107 }
108
109
115 public ShoppingCoupon createShoppingCoupon(long couponId) {
116 return shoppingCouponPersistence.create(couponId);
117 }
118
119
127 @Indexable(type = IndexableType.DELETE)
128 public ShoppingCoupon deleteShoppingCoupon(long couponId)
129 throws PortalException, SystemException {
130 return shoppingCouponPersistence.remove(couponId);
131 }
132
133
140 @Indexable(type = IndexableType.DELETE)
141 public ShoppingCoupon deleteShoppingCoupon(ShoppingCoupon shoppingCoupon)
142 throws SystemException {
143 return shoppingCouponPersistence.remove(shoppingCoupon);
144 }
145
146 public DynamicQuery dynamicQuery() {
147 Class<?> clazz = getClass();
148
149 return DynamicQueryFactoryUtil.forClass(ShoppingCoupon.class,
150 clazz.getClassLoader());
151 }
152
153
160 @SuppressWarnings("rawtypes")
161 public List dynamicQuery(DynamicQuery dynamicQuery)
162 throws SystemException {
163 return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery);
164 }
165
166
179 @SuppressWarnings("rawtypes")
180 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
181 throws SystemException {
182 return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery,
183 start, end);
184 }
185
186
200 @SuppressWarnings("rawtypes")
201 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
202 OrderByComparator orderByComparator) throws SystemException {
203 return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery,
204 start, end, orderByComparator);
205 }
206
207
214 public long dynamicQueryCount(DynamicQuery dynamicQuery)
215 throws SystemException {
216 return shoppingCouponPersistence.countWithDynamicQuery(dynamicQuery);
217 }
218
219 public ShoppingCoupon fetchShoppingCoupon(long couponId)
220 throws SystemException {
221 return shoppingCouponPersistence.fetchByPrimaryKey(couponId);
222 }
223
224
232 public ShoppingCoupon getShoppingCoupon(long couponId)
233 throws PortalException, SystemException {
234 return shoppingCouponPersistence.findByPrimaryKey(couponId);
235 }
236
237 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
238 throws PortalException, SystemException {
239 return shoppingCouponPersistence.findByPrimaryKey(primaryKeyObj);
240 }
241
242
254 public List<ShoppingCoupon> getShoppingCoupons(int start, int end)
255 throws SystemException {
256 return shoppingCouponPersistence.findAll(start, end);
257 }
258
259
265 public int getShoppingCouponsCount() throws SystemException {
266 return shoppingCouponPersistence.countAll();
267 }
268
269
276 @Indexable(type = IndexableType.REINDEX)
277 public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon)
278 throws SystemException {
279 return updateShoppingCoupon(shoppingCoupon, true);
280 }
281
282
290 @Indexable(type = IndexableType.REINDEX)
291 public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon,
292 boolean merge) throws SystemException {
293 shoppingCoupon.setNew(false);
294
295 return shoppingCouponPersistence.update(shoppingCoupon, merge);
296 }
297
298
303 public ShoppingCartLocalService getShoppingCartLocalService() {
304 return shoppingCartLocalService;
305 }
306
307
312 public void setShoppingCartLocalService(
313 ShoppingCartLocalService shoppingCartLocalService) {
314 this.shoppingCartLocalService = shoppingCartLocalService;
315 }
316
317
322 public ShoppingCartPersistence getShoppingCartPersistence() {
323 return shoppingCartPersistence;
324 }
325
326
331 public void setShoppingCartPersistence(
332 ShoppingCartPersistence shoppingCartPersistence) {
333 this.shoppingCartPersistence = shoppingCartPersistence;
334 }
335
336
341 public ShoppingCategoryLocalService getShoppingCategoryLocalService() {
342 return shoppingCategoryLocalService;
343 }
344
345
350 public void setShoppingCategoryLocalService(
351 ShoppingCategoryLocalService shoppingCategoryLocalService) {
352 this.shoppingCategoryLocalService = shoppingCategoryLocalService;
353 }
354
355
360 public ShoppingCategoryService getShoppingCategoryService() {
361 return shoppingCategoryService;
362 }
363
364
369 public void setShoppingCategoryService(
370 ShoppingCategoryService shoppingCategoryService) {
371 this.shoppingCategoryService = shoppingCategoryService;
372 }
373
374
379 public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
380 return shoppingCategoryPersistence;
381 }
382
383
388 public void setShoppingCategoryPersistence(
389 ShoppingCategoryPersistence shoppingCategoryPersistence) {
390 this.shoppingCategoryPersistence = shoppingCategoryPersistence;
391 }
392
393
398 public ShoppingCouponLocalService getShoppingCouponLocalService() {
399 return shoppingCouponLocalService;
400 }
401
402
407 public void setShoppingCouponLocalService(
408 ShoppingCouponLocalService shoppingCouponLocalService) {
409 this.shoppingCouponLocalService = shoppingCouponLocalService;
410 }
411
412
417 public ShoppingCouponService getShoppingCouponService() {
418 return shoppingCouponService;
419 }
420
421
426 public void setShoppingCouponService(
427 ShoppingCouponService shoppingCouponService) {
428 this.shoppingCouponService = shoppingCouponService;
429 }
430
431
436 public ShoppingCouponPersistence getShoppingCouponPersistence() {
437 return shoppingCouponPersistence;
438 }
439
440
445 public void setShoppingCouponPersistence(
446 ShoppingCouponPersistence shoppingCouponPersistence) {
447 this.shoppingCouponPersistence = shoppingCouponPersistence;
448 }
449
450
455 public ShoppingCouponFinder getShoppingCouponFinder() {
456 return shoppingCouponFinder;
457 }
458
459
464 public void setShoppingCouponFinder(
465 ShoppingCouponFinder shoppingCouponFinder) {
466 this.shoppingCouponFinder = shoppingCouponFinder;
467 }
468
469
474 public ShoppingItemLocalService getShoppingItemLocalService() {
475 return shoppingItemLocalService;
476 }
477
478
483 public void setShoppingItemLocalService(
484 ShoppingItemLocalService shoppingItemLocalService) {
485 this.shoppingItemLocalService = shoppingItemLocalService;
486 }
487
488
493 public ShoppingItemService getShoppingItemService() {
494 return shoppingItemService;
495 }
496
497
502 public void setShoppingItemService(ShoppingItemService shoppingItemService) {
503 this.shoppingItemService = shoppingItemService;
504 }
505
506
511 public ShoppingItemPersistence getShoppingItemPersistence() {
512 return shoppingItemPersistence;
513 }
514
515
520 public void setShoppingItemPersistence(
521 ShoppingItemPersistence shoppingItemPersistence) {
522 this.shoppingItemPersistence = shoppingItemPersistence;
523 }
524
525
530 public ShoppingItemFinder getShoppingItemFinder() {
531 return shoppingItemFinder;
532 }
533
534
539 public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
540 this.shoppingItemFinder = shoppingItemFinder;
541 }
542
543
548 public ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
549 return shoppingItemFieldLocalService;
550 }
551
552
557 public void setShoppingItemFieldLocalService(
558 ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
559 this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
560 }
561
562
567 public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
568 return shoppingItemFieldPersistence;
569 }
570
571
576 public void setShoppingItemFieldPersistence(
577 ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
578 this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
579 }
580
581
586 public ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
587 return shoppingItemPriceLocalService;
588 }
589
590
595 public void setShoppingItemPriceLocalService(
596 ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
597 this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
598 }
599
600
605 public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
606 return shoppingItemPricePersistence;
607 }
608
609
614 public void setShoppingItemPricePersistence(
615 ShoppingItemPricePersistence shoppingItemPricePersistence) {
616 this.shoppingItemPricePersistence = shoppingItemPricePersistence;
617 }
618
619
624 public ShoppingOrderLocalService getShoppingOrderLocalService() {
625 return shoppingOrderLocalService;
626 }
627
628
633 public void setShoppingOrderLocalService(
634 ShoppingOrderLocalService shoppingOrderLocalService) {
635 this.shoppingOrderLocalService = shoppingOrderLocalService;
636 }
637
638
643 public ShoppingOrderService getShoppingOrderService() {
644 return shoppingOrderService;
645 }
646
647
652 public void setShoppingOrderService(
653 ShoppingOrderService shoppingOrderService) {
654 this.shoppingOrderService = shoppingOrderService;
655 }
656
657
662 public ShoppingOrderPersistence getShoppingOrderPersistence() {
663 return shoppingOrderPersistence;
664 }
665
666
671 public void setShoppingOrderPersistence(
672 ShoppingOrderPersistence shoppingOrderPersistence) {
673 this.shoppingOrderPersistence = shoppingOrderPersistence;
674 }
675
676
681 public ShoppingOrderFinder getShoppingOrderFinder() {
682 return shoppingOrderFinder;
683 }
684
685
690 public void setShoppingOrderFinder(ShoppingOrderFinder shoppingOrderFinder) {
691 this.shoppingOrderFinder = shoppingOrderFinder;
692 }
693
694
699 public ShoppingOrderItemLocalService getShoppingOrderItemLocalService() {
700 return shoppingOrderItemLocalService;
701 }
702
703
708 public void setShoppingOrderItemLocalService(
709 ShoppingOrderItemLocalService shoppingOrderItemLocalService) {
710 this.shoppingOrderItemLocalService = shoppingOrderItemLocalService;
711 }
712
713
718 public ShoppingOrderItemPersistence getShoppingOrderItemPersistence() {
719 return shoppingOrderItemPersistence;
720 }
721
722
727 public void setShoppingOrderItemPersistence(
728 ShoppingOrderItemPersistence shoppingOrderItemPersistence) {
729 this.shoppingOrderItemPersistence = shoppingOrderItemPersistence;
730 }
731
732
737 public CounterLocalService getCounterLocalService() {
738 return counterLocalService;
739 }
740
741
746 public void setCounterLocalService(CounterLocalService counterLocalService) {
747 this.counterLocalService = counterLocalService;
748 }
749
750
755 public ResourceLocalService getResourceLocalService() {
756 return resourceLocalService;
757 }
758
759
764 public void setResourceLocalService(
765 ResourceLocalService resourceLocalService) {
766 this.resourceLocalService = resourceLocalService;
767 }
768
769
774 public ResourceService getResourceService() {
775 return resourceService;
776 }
777
778
783 public void setResourceService(ResourceService resourceService) {
784 this.resourceService = resourceService;
785 }
786
787
792 public ResourcePersistence getResourcePersistence() {
793 return resourcePersistence;
794 }
795
796
801 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
802 this.resourcePersistence = resourcePersistence;
803 }
804
805
810 public ResourceFinder getResourceFinder() {
811 return resourceFinder;
812 }
813
814
819 public void setResourceFinder(ResourceFinder resourceFinder) {
820 this.resourceFinder = resourceFinder;
821 }
822
823
828 public UserLocalService getUserLocalService() {
829 return userLocalService;
830 }
831
832
837 public void setUserLocalService(UserLocalService userLocalService) {
838 this.userLocalService = userLocalService;
839 }
840
841
846 public UserService getUserService() {
847 return userService;
848 }
849
850
855 public void setUserService(UserService userService) {
856 this.userService = userService;
857 }
858
859
864 public UserPersistence getUserPersistence() {
865 return userPersistence;
866 }
867
868
873 public void setUserPersistence(UserPersistence userPersistence) {
874 this.userPersistence = userPersistence;
875 }
876
877
882 public UserFinder getUserFinder() {
883 return userFinder;
884 }
885
886
891 public void setUserFinder(UserFinder userFinder) {
892 this.userFinder = userFinder;
893 }
894
895 public void afterPropertiesSet() {
896 persistedModelLocalServiceRegistry.register("com.liferay.portlet.shopping.model.ShoppingCoupon",
897 shoppingCouponLocalService);
898 }
899
900 public void destroy() {
901 persistedModelLocalServiceRegistry.unregister(
902 "com.liferay.portlet.shopping.model.ShoppingCoupon");
903 }
904
905
910 public String getBeanIdentifier() {
911 return _beanIdentifier;
912 }
913
914
919 public void setBeanIdentifier(String beanIdentifier) {
920 _beanIdentifier = beanIdentifier;
921 }
922
923 protected Class<?> getModelClass() {
924 return ShoppingCoupon.class;
925 }
926
927 protected String getModelClassName() {
928 return ShoppingCoupon.class.getName();
929 }
930
931
936 protected void runSQL(String sql) throws SystemException {
937 try {
938 DataSource dataSource = shoppingCouponPersistence.getDataSource();
939
940 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
941 sql, new int[0]);
942
943 sqlUpdate.update();
944 }
945 catch (Exception e) {
946 throw new SystemException(e);
947 }
948 }
949
950 @BeanReference(type = ShoppingCartLocalService.class)
951 protected ShoppingCartLocalService shoppingCartLocalService;
952 @BeanReference(type = ShoppingCartPersistence.class)
953 protected ShoppingCartPersistence shoppingCartPersistence;
954 @BeanReference(type = ShoppingCategoryLocalService.class)
955 protected ShoppingCategoryLocalService shoppingCategoryLocalService;
956 @BeanReference(type = ShoppingCategoryService.class)
957 protected ShoppingCategoryService shoppingCategoryService;
958 @BeanReference(type = ShoppingCategoryPersistence.class)
959 protected ShoppingCategoryPersistence shoppingCategoryPersistence;
960 @BeanReference(type = ShoppingCouponLocalService.class)
961 protected ShoppingCouponLocalService shoppingCouponLocalService;
962 @BeanReference(type = ShoppingCouponService.class)
963 protected ShoppingCouponService shoppingCouponService;
964 @BeanReference(type = ShoppingCouponPersistence.class)
965 protected ShoppingCouponPersistence shoppingCouponPersistence;
966 @BeanReference(type = ShoppingCouponFinder.class)
967 protected ShoppingCouponFinder shoppingCouponFinder;
968 @BeanReference(type = ShoppingItemLocalService.class)
969 protected ShoppingItemLocalService shoppingItemLocalService;
970 @BeanReference(type = ShoppingItemService.class)
971 protected ShoppingItemService shoppingItemService;
972 @BeanReference(type = ShoppingItemPersistence.class)
973 protected ShoppingItemPersistence shoppingItemPersistence;
974 @BeanReference(type = ShoppingItemFinder.class)
975 protected ShoppingItemFinder shoppingItemFinder;
976 @BeanReference(type = ShoppingItemFieldLocalService.class)
977 protected ShoppingItemFieldLocalService shoppingItemFieldLocalService;
978 @BeanReference(type = ShoppingItemFieldPersistence.class)
979 protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
980 @BeanReference(type = ShoppingItemPriceLocalService.class)
981 protected ShoppingItemPriceLocalService shoppingItemPriceLocalService;
982 @BeanReference(type = ShoppingItemPricePersistence.class)
983 protected ShoppingItemPricePersistence shoppingItemPricePersistence;
984 @BeanReference(type = ShoppingOrderLocalService.class)
985 protected ShoppingOrderLocalService shoppingOrderLocalService;
986 @BeanReference(type = ShoppingOrderService.class)
987 protected ShoppingOrderService shoppingOrderService;
988 @BeanReference(type = ShoppingOrderPersistence.class)
989 protected ShoppingOrderPersistence shoppingOrderPersistence;
990 @BeanReference(type = ShoppingOrderFinder.class)
991 protected ShoppingOrderFinder shoppingOrderFinder;
992 @BeanReference(type = ShoppingOrderItemLocalService.class)
993 protected ShoppingOrderItemLocalService shoppingOrderItemLocalService;
994 @BeanReference(type = ShoppingOrderItemPersistence.class)
995 protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
996 @BeanReference(type = CounterLocalService.class)
997 protected CounterLocalService counterLocalService;
998 @BeanReference(type = ResourceLocalService.class)
999 protected ResourceLocalService resourceLocalService;
1000 @BeanReference(type = ResourceService.class)
1001 protected ResourceService resourceService;
1002 @BeanReference(type = ResourcePersistence.class)
1003 protected ResourcePersistence resourcePersistence;
1004 @BeanReference(type = ResourceFinder.class)
1005 protected ResourceFinder resourceFinder;
1006 @BeanReference(type = UserLocalService.class)
1007 protected UserLocalService userLocalService;
1008 @BeanReference(type = UserService.class)
1009 protected UserService userService;
1010 @BeanReference(type = UserPersistence.class)
1011 protected UserPersistence userPersistence;
1012 @BeanReference(type = UserFinder.class)
1013 protected UserFinder userFinder;
1014 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1015 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1016 private String _beanIdentifier;
1017 }