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.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.shopping.model.ShoppingItemField;
044 import com.liferay.portlet.shopping.service.ShoppingCartLocalService;
045 import com.liferay.portlet.shopping.service.ShoppingCategoryLocalService;
046 import com.liferay.portlet.shopping.service.ShoppingCategoryService;
047 import com.liferay.portlet.shopping.service.ShoppingCouponLocalService;
048 import com.liferay.portlet.shopping.service.ShoppingCouponService;
049 import com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService;
050 import com.liferay.portlet.shopping.service.ShoppingItemLocalService;
051 import com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService;
052 import com.liferay.portlet.shopping.service.ShoppingItemService;
053 import com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService;
054 import com.liferay.portlet.shopping.service.ShoppingOrderLocalService;
055 import com.liferay.portlet.shopping.service.ShoppingOrderService;
056 import com.liferay.portlet.shopping.service.persistence.ShoppingCartPersistence;
057 import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
058 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponFinder;
059 import com.liferay.portlet.shopping.service.persistence.ShoppingCouponPersistence;
060 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFieldPersistence;
061 import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
062 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
063 import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
064 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderFinder;
065 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderItemPersistence;
066 import com.liferay.portlet.shopping.service.persistence.ShoppingOrderPersistence;
067
068 import java.io.Serializable;
069
070 import java.util.List;
071
072 import javax.sql.DataSource;
073
074
086 public abstract class ShoppingItemFieldLocalServiceBaseImpl
087 implements ShoppingItemFieldLocalService, IdentifiableBean {
088
093
094
101 public ShoppingItemField addShoppingItemField(
102 ShoppingItemField shoppingItemField) throws SystemException {
103 shoppingItemField.setNew(true);
104
105 shoppingItemField = shoppingItemFieldPersistence.update(shoppingItemField,
106 false);
107
108 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
109
110 if (indexer != null) {
111 try {
112 indexer.reindex(shoppingItemField);
113 }
114 catch (SearchException se) {
115 if (_log.isWarnEnabled()) {
116 _log.warn(se, se);
117 }
118 }
119 }
120
121 return shoppingItemField;
122 }
123
124
130 public ShoppingItemField createShoppingItemField(long itemFieldId) {
131 return shoppingItemFieldPersistence.create(itemFieldId);
132 }
133
134
141 public void deleteShoppingItemField(long itemFieldId)
142 throws PortalException, SystemException {
143 ShoppingItemField shoppingItemField = shoppingItemFieldPersistence.remove(itemFieldId);
144
145 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
146
147 if (indexer != null) {
148 try {
149 indexer.delete(shoppingItemField);
150 }
151 catch (SearchException se) {
152 if (_log.isWarnEnabled()) {
153 _log.warn(se, se);
154 }
155 }
156 }
157 }
158
159
165 public void deleteShoppingItemField(ShoppingItemField shoppingItemField)
166 throws SystemException {
167 shoppingItemFieldPersistence.remove(shoppingItemField);
168
169 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
170
171 if (indexer != null) {
172 try {
173 indexer.delete(shoppingItemField);
174 }
175 catch (SearchException se) {
176 if (_log.isWarnEnabled()) {
177 _log.warn(se, se);
178 }
179 }
180 }
181 }
182
183
190 @SuppressWarnings("rawtypes")
191 public List dynamicQuery(DynamicQuery dynamicQuery)
192 throws SystemException {
193 return shoppingItemFieldPersistence.findWithDynamicQuery(dynamicQuery);
194 }
195
196
209 @SuppressWarnings("rawtypes")
210 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
211 throws SystemException {
212 return shoppingItemFieldPersistence.findWithDynamicQuery(dynamicQuery,
213 start, end);
214 }
215
216
230 @SuppressWarnings("rawtypes")
231 public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
232 OrderByComparator orderByComparator) throws SystemException {
233 return shoppingItemFieldPersistence.findWithDynamicQuery(dynamicQuery,
234 start, end, orderByComparator);
235 }
236
237
244 public long dynamicQueryCount(DynamicQuery dynamicQuery)
245 throws SystemException {
246 return shoppingItemFieldPersistence.countWithDynamicQuery(dynamicQuery);
247 }
248
249 public ShoppingItemField fetchShoppingItemField(long itemFieldId)
250 throws SystemException {
251 return shoppingItemFieldPersistence.fetchByPrimaryKey(itemFieldId);
252 }
253
254
262 public ShoppingItemField getShoppingItemField(long itemFieldId)
263 throws PortalException, SystemException {
264 return shoppingItemFieldPersistence.findByPrimaryKey(itemFieldId);
265 }
266
267 public PersistedModel getPersistedModel(Serializable primaryKeyObj)
268 throws PortalException, SystemException {
269 return shoppingItemFieldPersistence.findByPrimaryKey(primaryKeyObj);
270 }
271
272
284 public List<ShoppingItemField> getShoppingItemFields(int start, int end)
285 throws SystemException {
286 return shoppingItemFieldPersistence.findAll(start, end);
287 }
288
289
295 public int getShoppingItemFieldsCount() throws SystemException {
296 return shoppingItemFieldPersistence.countAll();
297 }
298
299
306 public ShoppingItemField updateShoppingItemField(
307 ShoppingItemField shoppingItemField) throws SystemException {
308 return updateShoppingItemField(shoppingItemField, true);
309 }
310
311
319 public ShoppingItemField updateShoppingItemField(
320 ShoppingItemField shoppingItemField, boolean merge)
321 throws SystemException {
322 shoppingItemField.setNew(false);
323
324 shoppingItemField = shoppingItemFieldPersistence.update(shoppingItemField,
325 merge);
326
327 Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
328
329 if (indexer != null) {
330 try {
331 indexer.reindex(shoppingItemField);
332 }
333 catch (SearchException se) {
334 if (_log.isWarnEnabled()) {
335 _log.warn(se, se);
336 }
337 }
338 }
339
340 return shoppingItemField;
341 }
342
343
348 public ShoppingCartLocalService getShoppingCartLocalService() {
349 return shoppingCartLocalService;
350 }
351
352
357 public void setShoppingCartLocalService(
358 ShoppingCartLocalService shoppingCartLocalService) {
359 this.shoppingCartLocalService = shoppingCartLocalService;
360 }
361
362
367 public ShoppingCartPersistence getShoppingCartPersistence() {
368 return shoppingCartPersistence;
369 }
370
371
376 public void setShoppingCartPersistence(
377 ShoppingCartPersistence shoppingCartPersistence) {
378 this.shoppingCartPersistence = shoppingCartPersistence;
379 }
380
381
386 public ShoppingCategoryLocalService getShoppingCategoryLocalService() {
387 return shoppingCategoryLocalService;
388 }
389
390
395 public void setShoppingCategoryLocalService(
396 ShoppingCategoryLocalService shoppingCategoryLocalService) {
397 this.shoppingCategoryLocalService = shoppingCategoryLocalService;
398 }
399
400
405 public ShoppingCategoryService getShoppingCategoryService() {
406 return shoppingCategoryService;
407 }
408
409
414 public void setShoppingCategoryService(
415 ShoppingCategoryService shoppingCategoryService) {
416 this.shoppingCategoryService = shoppingCategoryService;
417 }
418
419
424 public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
425 return shoppingCategoryPersistence;
426 }
427
428
433 public void setShoppingCategoryPersistence(
434 ShoppingCategoryPersistence shoppingCategoryPersistence) {
435 this.shoppingCategoryPersistence = shoppingCategoryPersistence;
436 }
437
438
443 public ShoppingCouponLocalService getShoppingCouponLocalService() {
444 return shoppingCouponLocalService;
445 }
446
447
452 public void setShoppingCouponLocalService(
453 ShoppingCouponLocalService shoppingCouponLocalService) {
454 this.shoppingCouponLocalService = shoppingCouponLocalService;
455 }
456
457
462 public ShoppingCouponService getShoppingCouponService() {
463 return shoppingCouponService;
464 }
465
466
471 public void setShoppingCouponService(
472 ShoppingCouponService shoppingCouponService) {
473 this.shoppingCouponService = shoppingCouponService;
474 }
475
476
481 public ShoppingCouponPersistence getShoppingCouponPersistence() {
482 return shoppingCouponPersistence;
483 }
484
485
490 public void setShoppingCouponPersistence(
491 ShoppingCouponPersistence shoppingCouponPersistence) {
492 this.shoppingCouponPersistence = shoppingCouponPersistence;
493 }
494
495
500 public ShoppingCouponFinder getShoppingCouponFinder() {
501 return shoppingCouponFinder;
502 }
503
504
509 public void setShoppingCouponFinder(
510 ShoppingCouponFinder shoppingCouponFinder) {
511 this.shoppingCouponFinder = shoppingCouponFinder;
512 }
513
514
519 public ShoppingItemLocalService getShoppingItemLocalService() {
520 return shoppingItemLocalService;
521 }
522
523
528 public void setShoppingItemLocalService(
529 ShoppingItemLocalService shoppingItemLocalService) {
530 this.shoppingItemLocalService = shoppingItemLocalService;
531 }
532
533
538 public ShoppingItemService getShoppingItemService() {
539 return shoppingItemService;
540 }
541
542
547 public void setShoppingItemService(ShoppingItemService shoppingItemService) {
548 this.shoppingItemService = shoppingItemService;
549 }
550
551
556 public ShoppingItemPersistence getShoppingItemPersistence() {
557 return shoppingItemPersistence;
558 }
559
560
565 public void setShoppingItemPersistence(
566 ShoppingItemPersistence shoppingItemPersistence) {
567 this.shoppingItemPersistence = shoppingItemPersistence;
568 }
569
570
575 public ShoppingItemFinder getShoppingItemFinder() {
576 return shoppingItemFinder;
577 }
578
579
584 public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
585 this.shoppingItemFinder = shoppingItemFinder;
586 }
587
588
593 public ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
594 return shoppingItemFieldLocalService;
595 }
596
597
602 public void setShoppingItemFieldLocalService(
603 ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
604 this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
605 }
606
607
612 public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
613 return shoppingItemFieldPersistence;
614 }
615
616
621 public void setShoppingItemFieldPersistence(
622 ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
623 this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
624 }
625
626
631 public ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
632 return shoppingItemPriceLocalService;
633 }
634
635
640 public void setShoppingItemPriceLocalService(
641 ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
642 this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
643 }
644
645
650 public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
651 return shoppingItemPricePersistence;
652 }
653
654
659 public void setShoppingItemPricePersistence(
660 ShoppingItemPricePersistence shoppingItemPricePersistence) {
661 this.shoppingItemPricePersistence = shoppingItemPricePersistence;
662 }
663
664
669 public ShoppingOrderLocalService getShoppingOrderLocalService() {
670 return shoppingOrderLocalService;
671 }
672
673
678 public void setShoppingOrderLocalService(
679 ShoppingOrderLocalService shoppingOrderLocalService) {
680 this.shoppingOrderLocalService = shoppingOrderLocalService;
681 }
682
683
688 public ShoppingOrderService getShoppingOrderService() {
689 return shoppingOrderService;
690 }
691
692
697 public void setShoppingOrderService(
698 ShoppingOrderService shoppingOrderService) {
699 this.shoppingOrderService = shoppingOrderService;
700 }
701
702
707 public ShoppingOrderPersistence getShoppingOrderPersistence() {
708 return shoppingOrderPersistence;
709 }
710
711
716 public void setShoppingOrderPersistence(
717 ShoppingOrderPersistence shoppingOrderPersistence) {
718 this.shoppingOrderPersistence = shoppingOrderPersistence;
719 }
720
721
726 public ShoppingOrderFinder getShoppingOrderFinder() {
727 return shoppingOrderFinder;
728 }
729
730
735 public void setShoppingOrderFinder(ShoppingOrderFinder shoppingOrderFinder) {
736 this.shoppingOrderFinder = shoppingOrderFinder;
737 }
738
739
744 public ShoppingOrderItemLocalService getShoppingOrderItemLocalService() {
745 return shoppingOrderItemLocalService;
746 }
747
748
753 public void setShoppingOrderItemLocalService(
754 ShoppingOrderItemLocalService shoppingOrderItemLocalService) {
755 this.shoppingOrderItemLocalService = shoppingOrderItemLocalService;
756 }
757
758
763 public ShoppingOrderItemPersistence getShoppingOrderItemPersistence() {
764 return shoppingOrderItemPersistence;
765 }
766
767
772 public void setShoppingOrderItemPersistence(
773 ShoppingOrderItemPersistence shoppingOrderItemPersistence) {
774 this.shoppingOrderItemPersistence = shoppingOrderItemPersistence;
775 }
776
777
782 public CounterLocalService getCounterLocalService() {
783 return counterLocalService;
784 }
785
786
791 public void setCounterLocalService(CounterLocalService counterLocalService) {
792 this.counterLocalService = counterLocalService;
793 }
794
795
800 public ResourceLocalService getResourceLocalService() {
801 return resourceLocalService;
802 }
803
804
809 public void setResourceLocalService(
810 ResourceLocalService resourceLocalService) {
811 this.resourceLocalService = resourceLocalService;
812 }
813
814
819 public ResourceService getResourceService() {
820 return resourceService;
821 }
822
823
828 public void setResourceService(ResourceService resourceService) {
829 this.resourceService = resourceService;
830 }
831
832
837 public ResourcePersistence getResourcePersistence() {
838 return resourcePersistence;
839 }
840
841
846 public void setResourcePersistence(ResourcePersistence resourcePersistence) {
847 this.resourcePersistence = resourcePersistence;
848 }
849
850
855 public ResourceFinder getResourceFinder() {
856 return resourceFinder;
857 }
858
859
864 public void setResourceFinder(ResourceFinder resourceFinder) {
865 this.resourceFinder = resourceFinder;
866 }
867
868
873 public UserLocalService getUserLocalService() {
874 return userLocalService;
875 }
876
877
882 public void setUserLocalService(UserLocalService userLocalService) {
883 this.userLocalService = userLocalService;
884 }
885
886
891 public UserService getUserService() {
892 return userService;
893 }
894
895
900 public void setUserService(UserService userService) {
901 this.userService = userService;
902 }
903
904
909 public UserPersistence getUserPersistence() {
910 return userPersistence;
911 }
912
913
918 public void setUserPersistence(UserPersistence userPersistence) {
919 this.userPersistence = userPersistence;
920 }
921
922
927 public UserFinder getUserFinder() {
928 return userFinder;
929 }
930
931
936 public void setUserFinder(UserFinder userFinder) {
937 this.userFinder = userFinder;
938 }
939
940 public void afterPropertiesSet() {
941 persistedModelLocalServiceRegistry.register("com.liferay.portlet.shopping.model.ShoppingItemField",
942 shoppingItemFieldLocalService);
943 }
944
945 public void destroy() {
946 persistedModelLocalServiceRegistry.unregister(
947 "com.liferay.portlet.shopping.model.ShoppingItemField");
948 }
949
950
955 public String getBeanIdentifier() {
956 return _beanIdentifier;
957 }
958
959
964 public void setBeanIdentifier(String beanIdentifier) {
965 _beanIdentifier = beanIdentifier;
966 }
967
968 protected ClassLoader getClassLoader() {
969 Class<?> clazz = getClass();
970
971 return clazz.getClassLoader();
972 }
973
974 protected Class<?> getModelClass() {
975 return ShoppingItemField.class;
976 }
977
978 protected String getModelClassName() {
979 return ShoppingItemField.class.getName();
980 }
981
982
987 protected void runSQL(String sql) throws SystemException {
988 try {
989 DataSource dataSource = shoppingItemFieldPersistence.getDataSource();
990
991 SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
992 sql, new int[0]);
993
994 sqlUpdate.update();
995 }
996 catch (Exception e) {
997 throw new SystemException(e);
998 }
999 }
1000
1001 @BeanReference(type = ShoppingCartLocalService.class)
1002 protected ShoppingCartLocalService shoppingCartLocalService;
1003 @BeanReference(type = ShoppingCartPersistence.class)
1004 protected ShoppingCartPersistence shoppingCartPersistence;
1005 @BeanReference(type = ShoppingCategoryLocalService.class)
1006 protected ShoppingCategoryLocalService shoppingCategoryLocalService;
1007 @BeanReference(type = ShoppingCategoryService.class)
1008 protected ShoppingCategoryService shoppingCategoryService;
1009 @BeanReference(type = ShoppingCategoryPersistence.class)
1010 protected ShoppingCategoryPersistence shoppingCategoryPersistence;
1011 @BeanReference(type = ShoppingCouponLocalService.class)
1012 protected ShoppingCouponLocalService shoppingCouponLocalService;
1013 @BeanReference(type = ShoppingCouponService.class)
1014 protected ShoppingCouponService shoppingCouponService;
1015 @BeanReference(type = ShoppingCouponPersistence.class)
1016 protected ShoppingCouponPersistence shoppingCouponPersistence;
1017 @BeanReference(type = ShoppingCouponFinder.class)
1018 protected ShoppingCouponFinder shoppingCouponFinder;
1019 @BeanReference(type = ShoppingItemLocalService.class)
1020 protected ShoppingItemLocalService shoppingItemLocalService;
1021 @BeanReference(type = ShoppingItemService.class)
1022 protected ShoppingItemService shoppingItemService;
1023 @BeanReference(type = ShoppingItemPersistence.class)
1024 protected ShoppingItemPersistence shoppingItemPersistence;
1025 @BeanReference(type = ShoppingItemFinder.class)
1026 protected ShoppingItemFinder shoppingItemFinder;
1027 @BeanReference(type = ShoppingItemFieldLocalService.class)
1028 protected ShoppingItemFieldLocalService shoppingItemFieldLocalService;
1029 @BeanReference(type = ShoppingItemFieldPersistence.class)
1030 protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
1031 @BeanReference(type = ShoppingItemPriceLocalService.class)
1032 protected ShoppingItemPriceLocalService shoppingItemPriceLocalService;
1033 @BeanReference(type = ShoppingItemPricePersistence.class)
1034 protected ShoppingItemPricePersistence shoppingItemPricePersistence;
1035 @BeanReference(type = ShoppingOrderLocalService.class)
1036 protected ShoppingOrderLocalService shoppingOrderLocalService;
1037 @BeanReference(type = ShoppingOrderService.class)
1038 protected ShoppingOrderService shoppingOrderService;
1039 @BeanReference(type = ShoppingOrderPersistence.class)
1040 protected ShoppingOrderPersistence shoppingOrderPersistence;
1041 @BeanReference(type = ShoppingOrderFinder.class)
1042 protected ShoppingOrderFinder shoppingOrderFinder;
1043 @BeanReference(type = ShoppingOrderItemLocalService.class)
1044 protected ShoppingOrderItemLocalService shoppingOrderItemLocalService;
1045 @BeanReference(type = ShoppingOrderItemPersistence.class)
1046 protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
1047 @BeanReference(type = CounterLocalService.class)
1048 protected CounterLocalService counterLocalService;
1049 @BeanReference(type = ResourceLocalService.class)
1050 protected ResourceLocalService resourceLocalService;
1051 @BeanReference(type = ResourceService.class)
1052 protected ResourceService resourceService;
1053 @BeanReference(type = ResourcePersistence.class)
1054 protected ResourcePersistence resourcePersistence;
1055 @BeanReference(type = ResourceFinder.class)
1056 protected ResourceFinder resourceFinder;
1057 @BeanReference(type = UserLocalService.class)
1058 protected UserLocalService userLocalService;
1059 @BeanReference(type = UserService.class)
1060 protected UserService userService;
1061 @BeanReference(type = UserPersistence.class)
1062 protected UserPersistence userPersistence;
1063 @BeanReference(type = UserFinder.class)
1064 protected UserFinder userFinder;
1065 @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1066 protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1067 private static Log _log = LogFactoryUtil.getLog(ShoppingItemFieldLocalServiceBaseImpl.class);
1068 private String _beanIdentifier;
1069 }