001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
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.ShoppingCoupon;
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    /**
075     * The base implementation of the shopping coupon local service.
076     *
077     * <p>
078     * This implementation exists only as a container for the default service methods generated by ServiceBuilder. All custom service methods should be put in {@link com.liferay.portlet.shopping.service.impl.ShoppingCouponLocalServiceImpl}.
079     * </p>
080     *
081     * @author Brian Wing Shun Chan
082     * @see com.liferay.portlet.shopping.service.impl.ShoppingCouponLocalServiceImpl
083     * @see com.liferay.portlet.shopping.service.ShoppingCouponLocalServiceUtil
084     * @generated
085     */
086    public abstract class ShoppingCouponLocalServiceBaseImpl
087            implements ShoppingCouponLocalService, IdentifiableBean {
088            /*
089             * NOTE FOR DEVELOPERS:
090             *
091             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.shopping.service.ShoppingCouponLocalServiceUtil} to access the shopping coupon local service.
092             */
093    
094            /**
095             * Adds the shopping coupon to the database. Also notifies the appropriate model listeners.
096             *
097             * @param shoppingCoupon the shopping coupon
098             * @return the shopping coupon that was added
099             * @throws SystemException if a system exception occurred
100             */
101            public ShoppingCoupon addShoppingCoupon(ShoppingCoupon shoppingCoupon)
102                    throws SystemException {
103                    shoppingCoupon.setNew(true);
104    
105                    shoppingCoupon = shoppingCouponPersistence.update(shoppingCoupon, false);
106    
107                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
108    
109                    if (indexer != null) {
110                            try {
111                                    indexer.reindex(shoppingCoupon);
112                            }
113                            catch (SearchException se) {
114                                    if (_log.isWarnEnabled()) {
115                                            _log.warn(se, se);
116                                    }
117                            }
118                    }
119    
120                    return shoppingCoupon;
121            }
122    
123            /**
124             * Creates a new shopping coupon with the primary key. Does not add the shopping coupon to the database.
125             *
126             * @param couponId the primary key for the new shopping coupon
127             * @return the new shopping coupon
128             */
129            public ShoppingCoupon createShoppingCoupon(long couponId) {
130                    return shoppingCouponPersistence.create(couponId);
131            }
132    
133            /**
134             * Deletes the shopping coupon with the primary key from the database. Also notifies the appropriate model listeners.
135             *
136             * @param couponId the primary key of the shopping coupon
137             * @throws PortalException if a shopping coupon with the primary key could not be found
138             * @throws SystemException if a system exception occurred
139             */
140            public void deleteShoppingCoupon(long couponId)
141                    throws PortalException, SystemException {
142                    ShoppingCoupon shoppingCoupon = shoppingCouponPersistence.remove(couponId);
143    
144                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
145    
146                    if (indexer != null) {
147                            try {
148                                    indexer.delete(shoppingCoupon);
149                            }
150                            catch (SearchException se) {
151                                    if (_log.isWarnEnabled()) {
152                                            _log.warn(se, se);
153                                    }
154                            }
155                    }
156            }
157    
158            /**
159             * Deletes the shopping coupon from the database. Also notifies the appropriate model listeners.
160             *
161             * @param shoppingCoupon the shopping coupon
162             * @throws SystemException if a system exception occurred
163             */
164            public void deleteShoppingCoupon(ShoppingCoupon shoppingCoupon)
165                    throws SystemException {
166                    shoppingCouponPersistence.remove(shoppingCoupon);
167    
168                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
169    
170                    if (indexer != null) {
171                            try {
172                                    indexer.delete(shoppingCoupon);
173                            }
174                            catch (SearchException se) {
175                                    if (_log.isWarnEnabled()) {
176                                            _log.warn(se, se);
177                                    }
178                            }
179                    }
180            }
181    
182            /**
183             * Performs a dynamic query on the database and returns the matching rows.
184             *
185             * @param dynamicQuery the dynamic query
186             * @return the matching rows
187             * @throws SystemException if a system exception occurred
188             */
189            @SuppressWarnings("rawtypes")
190            public List dynamicQuery(DynamicQuery dynamicQuery)
191                    throws SystemException {
192                    return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery);
193            }
194    
195            /**
196             * Performs a dynamic query on the database and returns a range of the matching rows.
197             *
198             * <p>
199             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
200             * </p>
201             *
202             * @param dynamicQuery the dynamic query
203             * @param start the lower bound of the range of model instances
204             * @param end the upper bound of the range of model instances (not inclusive)
205             * @return the range of matching rows
206             * @throws SystemException if a system exception occurred
207             */
208            @SuppressWarnings("rawtypes")
209            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
210                    throws SystemException {
211                    return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery,
212                            start, end);
213            }
214    
215            /**
216             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
217             *
218             * <p>
219             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
220             * </p>
221             *
222             * @param dynamicQuery the dynamic query
223             * @param start the lower bound of the range of model instances
224             * @param end the upper bound of the range of model instances (not inclusive)
225             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
226             * @return the ordered range of matching rows
227             * @throws SystemException if a system exception occurred
228             */
229            @SuppressWarnings("rawtypes")
230            public List dynamicQuery(DynamicQuery dynamicQuery, int start, int end,
231                    OrderByComparator orderByComparator) throws SystemException {
232                    return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery,
233                            start, end, orderByComparator);
234            }
235    
236            /**
237             * Returns the number of rows that match the dynamic query.
238             *
239             * @param dynamicQuery the dynamic query
240             * @return the number of rows that match the dynamic query
241             * @throws SystemException if a system exception occurred
242             */
243            public long dynamicQueryCount(DynamicQuery dynamicQuery)
244                    throws SystemException {
245                    return shoppingCouponPersistence.countWithDynamicQuery(dynamicQuery);
246            }
247    
248            public ShoppingCoupon fetchShoppingCoupon(long couponId)
249                    throws SystemException {
250                    return shoppingCouponPersistence.fetchByPrimaryKey(couponId);
251            }
252    
253            /**
254             * Returns the shopping coupon with the primary key.
255             *
256             * @param couponId the primary key of the shopping coupon
257             * @return the shopping coupon
258             * @throws PortalException if a shopping coupon with the primary key could not be found
259             * @throws SystemException if a system exception occurred
260             */
261            public ShoppingCoupon getShoppingCoupon(long couponId)
262                    throws PortalException, SystemException {
263                    return shoppingCouponPersistence.findByPrimaryKey(couponId);
264            }
265    
266            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
267                    throws PortalException, SystemException {
268                    return shoppingCouponPersistence.findByPrimaryKey(primaryKeyObj);
269            }
270    
271            /**
272             * Returns a range of all the shopping coupons.
273             *
274             * <p>
275             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
276             * </p>
277             *
278             * @param start the lower bound of the range of shopping coupons
279             * @param end the upper bound of the range of shopping coupons (not inclusive)
280             * @return the range of shopping coupons
281             * @throws SystemException if a system exception occurred
282             */
283            public List<ShoppingCoupon> getShoppingCoupons(int start, int end)
284                    throws SystemException {
285                    return shoppingCouponPersistence.findAll(start, end);
286            }
287    
288            /**
289             * Returns the number of shopping coupons.
290             *
291             * @return the number of shopping coupons
292             * @throws SystemException if a system exception occurred
293             */
294            public int getShoppingCouponsCount() throws SystemException {
295                    return shoppingCouponPersistence.countAll();
296            }
297    
298            /**
299             * Updates the shopping coupon in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
300             *
301             * @param shoppingCoupon the shopping coupon
302             * @return the shopping coupon that was updated
303             * @throws SystemException if a system exception occurred
304             */
305            public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon)
306                    throws SystemException {
307                    return updateShoppingCoupon(shoppingCoupon, true);
308            }
309    
310            /**
311             * Updates the shopping coupon in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
312             *
313             * @param shoppingCoupon the shopping coupon
314             * @param merge whether to merge the shopping coupon with the current session. See {@link com.liferay.portal.service.persistence.BatchSession#update(com.liferay.portal.kernel.dao.orm.Session, com.liferay.portal.model.BaseModel, boolean)} for an explanation.
315             * @return the shopping coupon that was updated
316             * @throws SystemException if a system exception occurred
317             */
318            public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon,
319                    boolean merge) throws SystemException {
320                    shoppingCoupon.setNew(false);
321    
322                    shoppingCoupon = shoppingCouponPersistence.update(shoppingCoupon, merge);
323    
324                    Indexer indexer = IndexerRegistryUtil.getIndexer(getModelClassName());
325    
326                    if (indexer != null) {
327                            try {
328                                    indexer.reindex(shoppingCoupon);
329                            }
330                            catch (SearchException se) {
331                                    if (_log.isWarnEnabled()) {
332                                            _log.warn(se, se);
333                                    }
334                            }
335                    }
336    
337                    return shoppingCoupon;
338            }
339    
340            /**
341             * Returns the shopping cart local service.
342             *
343             * @return the shopping cart local service
344             */
345            public ShoppingCartLocalService getShoppingCartLocalService() {
346                    return shoppingCartLocalService;
347            }
348    
349            /**
350             * Sets the shopping cart local service.
351             *
352             * @param shoppingCartLocalService the shopping cart local service
353             */
354            public void setShoppingCartLocalService(
355                    ShoppingCartLocalService shoppingCartLocalService) {
356                    this.shoppingCartLocalService = shoppingCartLocalService;
357            }
358    
359            /**
360             * Returns the shopping cart persistence.
361             *
362             * @return the shopping cart persistence
363             */
364            public ShoppingCartPersistence getShoppingCartPersistence() {
365                    return shoppingCartPersistence;
366            }
367    
368            /**
369             * Sets the shopping cart persistence.
370             *
371             * @param shoppingCartPersistence the shopping cart persistence
372             */
373            public void setShoppingCartPersistence(
374                    ShoppingCartPersistence shoppingCartPersistence) {
375                    this.shoppingCartPersistence = shoppingCartPersistence;
376            }
377    
378            /**
379             * Returns the shopping category local service.
380             *
381             * @return the shopping category local service
382             */
383            public ShoppingCategoryLocalService getShoppingCategoryLocalService() {
384                    return shoppingCategoryLocalService;
385            }
386    
387            /**
388             * Sets the shopping category local service.
389             *
390             * @param shoppingCategoryLocalService the shopping category local service
391             */
392            public void setShoppingCategoryLocalService(
393                    ShoppingCategoryLocalService shoppingCategoryLocalService) {
394                    this.shoppingCategoryLocalService = shoppingCategoryLocalService;
395            }
396    
397            /**
398             * Returns the shopping category remote service.
399             *
400             * @return the shopping category remote service
401             */
402            public ShoppingCategoryService getShoppingCategoryService() {
403                    return shoppingCategoryService;
404            }
405    
406            /**
407             * Sets the shopping category remote service.
408             *
409             * @param shoppingCategoryService the shopping category remote service
410             */
411            public void setShoppingCategoryService(
412                    ShoppingCategoryService shoppingCategoryService) {
413                    this.shoppingCategoryService = shoppingCategoryService;
414            }
415    
416            /**
417             * Returns the shopping category persistence.
418             *
419             * @return the shopping category persistence
420             */
421            public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
422                    return shoppingCategoryPersistence;
423            }
424    
425            /**
426             * Sets the shopping category persistence.
427             *
428             * @param shoppingCategoryPersistence the shopping category persistence
429             */
430            public void setShoppingCategoryPersistence(
431                    ShoppingCategoryPersistence shoppingCategoryPersistence) {
432                    this.shoppingCategoryPersistence = shoppingCategoryPersistence;
433            }
434    
435            /**
436             * Returns the shopping coupon local service.
437             *
438             * @return the shopping coupon local service
439             */
440            public ShoppingCouponLocalService getShoppingCouponLocalService() {
441                    return shoppingCouponLocalService;
442            }
443    
444            /**
445             * Sets the shopping coupon local service.
446             *
447             * @param shoppingCouponLocalService the shopping coupon local service
448             */
449            public void setShoppingCouponLocalService(
450                    ShoppingCouponLocalService shoppingCouponLocalService) {
451                    this.shoppingCouponLocalService = shoppingCouponLocalService;
452            }
453    
454            /**
455             * Returns the shopping coupon remote service.
456             *
457             * @return the shopping coupon remote service
458             */
459            public ShoppingCouponService getShoppingCouponService() {
460                    return shoppingCouponService;
461            }
462    
463            /**
464             * Sets the shopping coupon remote service.
465             *
466             * @param shoppingCouponService the shopping coupon remote service
467             */
468            public void setShoppingCouponService(
469                    ShoppingCouponService shoppingCouponService) {
470                    this.shoppingCouponService = shoppingCouponService;
471            }
472    
473            /**
474             * Returns the shopping coupon persistence.
475             *
476             * @return the shopping coupon persistence
477             */
478            public ShoppingCouponPersistence getShoppingCouponPersistence() {
479                    return shoppingCouponPersistence;
480            }
481    
482            /**
483             * Sets the shopping coupon persistence.
484             *
485             * @param shoppingCouponPersistence the shopping coupon persistence
486             */
487            public void setShoppingCouponPersistence(
488                    ShoppingCouponPersistence shoppingCouponPersistence) {
489                    this.shoppingCouponPersistence = shoppingCouponPersistence;
490            }
491    
492            /**
493             * Returns the shopping coupon finder.
494             *
495             * @return the shopping coupon finder
496             */
497            public ShoppingCouponFinder getShoppingCouponFinder() {
498                    return shoppingCouponFinder;
499            }
500    
501            /**
502             * Sets the shopping coupon finder.
503             *
504             * @param shoppingCouponFinder the shopping coupon finder
505             */
506            public void setShoppingCouponFinder(
507                    ShoppingCouponFinder shoppingCouponFinder) {
508                    this.shoppingCouponFinder = shoppingCouponFinder;
509            }
510    
511            /**
512             * Returns the shopping item local service.
513             *
514             * @return the shopping item local service
515             */
516            public ShoppingItemLocalService getShoppingItemLocalService() {
517                    return shoppingItemLocalService;
518            }
519    
520            /**
521             * Sets the shopping item local service.
522             *
523             * @param shoppingItemLocalService the shopping item local service
524             */
525            public void setShoppingItemLocalService(
526                    ShoppingItemLocalService shoppingItemLocalService) {
527                    this.shoppingItemLocalService = shoppingItemLocalService;
528            }
529    
530            /**
531             * Returns the shopping item remote service.
532             *
533             * @return the shopping item remote service
534             */
535            public ShoppingItemService getShoppingItemService() {
536                    return shoppingItemService;
537            }
538    
539            /**
540             * Sets the shopping item remote service.
541             *
542             * @param shoppingItemService the shopping item remote service
543             */
544            public void setShoppingItemService(ShoppingItemService shoppingItemService) {
545                    this.shoppingItemService = shoppingItemService;
546            }
547    
548            /**
549             * Returns the shopping item persistence.
550             *
551             * @return the shopping item persistence
552             */
553            public ShoppingItemPersistence getShoppingItemPersistence() {
554                    return shoppingItemPersistence;
555            }
556    
557            /**
558             * Sets the shopping item persistence.
559             *
560             * @param shoppingItemPersistence the shopping item persistence
561             */
562            public void setShoppingItemPersistence(
563                    ShoppingItemPersistence shoppingItemPersistence) {
564                    this.shoppingItemPersistence = shoppingItemPersistence;
565            }
566    
567            /**
568             * Returns the shopping item finder.
569             *
570             * @return the shopping item finder
571             */
572            public ShoppingItemFinder getShoppingItemFinder() {
573                    return shoppingItemFinder;
574            }
575    
576            /**
577             * Sets the shopping item finder.
578             *
579             * @param shoppingItemFinder the shopping item finder
580             */
581            public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
582                    this.shoppingItemFinder = shoppingItemFinder;
583            }
584    
585            /**
586             * Returns the shopping item field local service.
587             *
588             * @return the shopping item field local service
589             */
590            public ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
591                    return shoppingItemFieldLocalService;
592            }
593    
594            /**
595             * Sets the shopping item field local service.
596             *
597             * @param shoppingItemFieldLocalService the shopping item field local service
598             */
599            public void setShoppingItemFieldLocalService(
600                    ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
601                    this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
602            }
603    
604            /**
605             * Returns the shopping item field persistence.
606             *
607             * @return the shopping item field persistence
608             */
609            public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
610                    return shoppingItemFieldPersistence;
611            }
612    
613            /**
614             * Sets the shopping item field persistence.
615             *
616             * @param shoppingItemFieldPersistence the shopping item field persistence
617             */
618            public void setShoppingItemFieldPersistence(
619                    ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
620                    this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
621            }
622    
623            /**
624             * Returns the shopping item price local service.
625             *
626             * @return the shopping item price local service
627             */
628            public ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
629                    return shoppingItemPriceLocalService;
630            }
631    
632            /**
633             * Sets the shopping item price local service.
634             *
635             * @param shoppingItemPriceLocalService the shopping item price local service
636             */
637            public void setShoppingItemPriceLocalService(
638                    ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
639                    this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
640            }
641    
642            /**
643             * Returns the shopping item price persistence.
644             *
645             * @return the shopping item price persistence
646             */
647            public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
648                    return shoppingItemPricePersistence;
649            }
650    
651            /**
652             * Sets the shopping item price persistence.
653             *
654             * @param shoppingItemPricePersistence the shopping item price persistence
655             */
656            public void setShoppingItemPricePersistence(
657                    ShoppingItemPricePersistence shoppingItemPricePersistence) {
658                    this.shoppingItemPricePersistence = shoppingItemPricePersistence;
659            }
660    
661            /**
662             * Returns the shopping order local service.
663             *
664             * @return the shopping order local service
665             */
666            public ShoppingOrderLocalService getShoppingOrderLocalService() {
667                    return shoppingOrderLocalService;
668            }
669    
670            /**
671             * Sets the shopping order local service.
672             *
673             * @param shoppingOrderLocalService the shopping order local service
674             */
675            public void setShoppingOrderLocalService(
676                    ShoppingOrderLocalService shoppingOrderLocalService) {
677                    this.shoppingOrderLocalService = shoppingOrderLocalService;
678            }
679    
680            /**
681             * Returns the shopping order remote service.
682             *
683             * @return the shopping order remote service
684             */
685            public ShoppingOrderService getShoppingOrderService() {
686                    return shoppingOrderService;
687            }
688    
689            /**
690             * Sets the shopping order remote service.
691             *
692             * @param shoppingOrderService the shopping order remote service
693             */
694            public void setShoppingOrderService(
695                    ShoppingOrderService shoppingOrderService) {
696                    this.shoppingOrderService = shoppingOrderService;
697            }
698    
699            /**
700             * Returns the shopping order persistence.
701             *
702             * @return the shopping order persistence
703             */
704            public ShoppingOrderPersistence getShoppingOrderPersistence() {
705                    return shoppingOrderPersistence;
706            }
707    
708            /**
709             * Sets the shopping order persistence.
710             *
711             * @param shoppingOrderPersistence the shopping order persistence
712             */
713            public void setShoppingOrderPersistence(
714                    ShoppingOrderPersistence shoppingOrderPersistence) {
715                    this.shoppingOrderPersistence = shoppingOrderPersistence;
716            }
717    
718            /**
719             * Returns the shopping order finder.
720             *
721             * @return the shopping order finder
722             */
723            public ShoppingOrderFinder getShoppingOrderFinder() {
724                    return shoppingOrderFinder;
725            }
726    
727            /**
728             * Sets the shopping order finder.
729             *
730             * @param shoppingOrderFinder the shopping order finder
731             */
732            public void setShoppingOrderFinder(ShoppingOrderFinder shoppingOrderFinder) {
733                    this.shoppingOrderFinder = shoppingOrderFinder;
734            }
735    
736            /**
737             * Returns the shopping order item local service.
738             *
739             * @return the shopping order item local service
740             */
741            public ShoppingOrderItemLocalService getShoppingOrderItemLocalService() {
742                    return shoppingOrderItemLocalService;
743            }
744    
745            /**
746             * Sets the shopping order item local service.
747             *
748             * @param shoppingOrderItemLocalService the shopping order item local service
749             */
750            public void setShoppingOrderItemLocalService(
751                    ShoppingOrderItemLocalService shoppingOrderItemLocalService) {
752                    this.shoppingOrderItemLocalService = shoppingOrderItemLocalService;
753            }
754    
755            /**
756             * Returns the shopping order item persistence.
757             *
758             * @return the shopping order item persistence
759             */
760            public ShoppingOrderItemPersistence getShoppingOrderItemPersistence() {
761                    return shoppingOrderItemPersistence;
762            }
763    
764            /**
765             * Sets the shopping order item persistence.
766             *
767             * @param shoppingOrderItemPersistence the shopping order item persistence
768             */
769            public void setShoppingOrderItemPersistence(
770                    ShoppingOrderItemPersistence shoppingOrderItemPersistence) {
771                    this.shoppingOrderItemPersistence = shoppingOrderItemPersistence;
772            }
773    
774            /**
775             * Returns the counter local service.
776             *
777             * @return the counter local service
778             */
779            public CounterLocalService getCounterLocalService() {
780                    return counterLocalService;
781            }
782    
783            /**
784             * Sets the counter local service.
785             *
786             * @param counterLocalService the counter local service
787             */
788            public void setCounterLocalService(CounterLocalService counterLocalService) {
789                    this.counterLocalService = counterLocalService;
790            }
791    
792            /**
793             * Returns the resource local service.
794             *
795             * @return the resource local service
796             */
797            public ResourceLocalService getResourceLocalService() {
798                    return resourceLocalService;
799            }
800    
801            /**
802             * Sets the resource local service.
803             *
804             * @param resourceLocalService the resource local service
805             */
806            public void setResourceLocalService(
807                    ResourceLocalService resourceLocalService) {
808                    this.resourceLocalService = resourceLocalService;
809            }
810    
811            /**
812             * Returns the resource remote service.
813             *
814             * @return the resource remote service
815             */
816            public ResourceService getResourceService() {
817                    return resourceService;
818            }
819    
820            /**
821             * Sets the resource remote service.
822             *
823             * @param resourceService the resource remote service
824             */
825            public void setResourceService(ResourceService resourceService) {
826                    this.resourceService = resourceService;
827            }
828    
829            /**
830             * Returns the resource persistence.
831             *
832             * @return the resource persistence
833             */
834            public ResourcePersistence getResourcePersistence() {
835                    return resourcePersistence;
836            }
837    
838            /**
839             * Sets the resource persistence.
840             *
841             * @param resourcePersistence the resource persistence
842             */
843            public void setResourcePersistence(ResourcePersistence resourcePersistence) {
844                    this.resourcePersistence = resourcePersistence;
845            }
846    
847            /**
848             * Returns the resource finder.
849             *
850             * @return the resource finder
851             */
852            public ResourceFinder getResourceFinder() {
853                    return resourceFinder;
854            }
855    
856            /**
857             * Sets the resource finder.
858             *
859             * @param resourceFinder the resource finder
860             */
861            public void setResourceFinder(ResourceFinder resourceFinder) {
862                    this.resourceFinder = resourceFinder;
863            }
864    
865            /**
866             * Returns the user local service.
867             *
868             * @return the user local service
869             */
870            public UserLocalService getUserLocalService() {
871                    return userLocalService;
872            }
873    
874            /**
875             * Sets the user local service.
876             *
877             * @param userLocalService the user local service
878             */
879            public void setUserLocalService(UserLocalService userLocalService) {
880                    this.userLocalService = userLocalService;
881            }
882    
883            /**
884             * Returns the user remote service.
885             *
886             * @return the user remote service
887             */
888            public UserService getUserService() {
889                    return userService;
890            }
891    
892            /**
893             * Sets the user remote service.
894             *
895             * @param userService the user remote service
896             */
897            public void setUserService(UserService userService) {
898                    this.userService = userService;
899            }
900    
901            /**
902             * Returns the user persistence.
903             *
904             * @return the user persistence
905             */
906            public UserPersistence getUserPersistence() {
907                    return userPersistence;
908            }
909    
910            /**
911             * Sets the user persistence.
912             *
913             * @param userPersistence the user persistence
914             */
915            public void setUserPersistence(UserPersistence userPersistence) {
916                    this.userPersistence = userPersistence;
917            }
918    
919            /**
920             * Returns the user finder.
921             *
922             * @return the user finder
923             */
924            public UserFinder getUserFinder() {
925                    return userFinder;
926            }
927    
928            /**
929             * Sets the user finder.
930             *
931             * @param userFinder the user finder
932             */
933            public void setUserFinder(UserFinder userFinder) {
934                    this.userFinder = userFinder;
935            }
936    
937            public void afterPropertiesSet() {
938                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.shopping.model.ShoppingCoupon",
939                            shoppingCouponLocalService);
940            }
941    
942            public void destroy() {
943                    persistedModelLocalServiceRegistry.unregister(
944                            "com.liferay.portlet.shopping.model.ShoppingCoupon");
945            }
946    
947            /**
948             * Returns the Spring bean ID for this bean.
949             *
950             * @return the Spring bean ID for this bean
951             */
952            public String getBeanIdentifier() {
953                    return _beanIdentifier;
954            }
955    
956            /**
957             * Sets the Spring bean ID for this bean.
958             *
959             * @param beanIdentifier the Spring bean ID for this bean
960             */
961            public void setBeanIdentifier(String beanIdentifier) {
962                    _beanIdentifier = beanIdentifier;
963            }
964    
965            protected ClassLoader getClassLoader() {
966                    Class<?> clazz = getClass();
967    
968                    return clazz.getClassLoader();
969            }
970    
971            protected Class<?> getModelClass() {
972                    return ShoppingCoupon.class;
973            }
974    
975            protected String getModelClassName() {
976                    return ShoppingCoupon.class.getName();
977            }
978    
979            /**
980             * Performs an SQL query.
981             *
982             * @param sql the sql query
983             */
984            protected void runSQL(String sql) throws SystemException {
985                    try {
986                            DataSource dataSource = shoppingCouponPersistence.getDataSource();
987    
988                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
989                                            sql, new int[0]);
990    
991                            sqlUpdate.update();
992                    }
993                    catch (Exception e) {
994                            throw new SystemException(e);
995                    }
996            }
997    
998            @BeanReference(type = ShoppingCartLocalService.class)
999            protected ShoppingCartLocalService shoppingCartLocalService;
1000            @BeanReference(type = ShoppingCartPersistence.class)
1001            protected ShoppingCartPersistence shoppingCartPersistence;
1002            @BeanReference(type = ShoppingCategoryLocalService.class)
1003            protected ShoppingCategoryLocalService shoppingCategoryLocalService;
1004            @BeanReference(type = ShoppingCategoryService.class)
1005            protected ShoppingCategoryService shoppingCategoryService;
1006            @BeanReference(type = ShoppingCategoryPersistence.class)
1007            protected ShoppingCategoryPersistence shoppingCategoryPersistence;
1008            @BeanReference(type = ShoppingCouponLocalService.class)
1009            protected ShoppingCouponLocalService shoppingCouponLocalService;
1010            @BeanReference(type = ShoppingCouponService.class)
1011            protected ShoppingCouponService shoppingCouponService;
1012            @BeanReference(type = ShoppingCouponPersistence.class)
1013            protected ShoppingCouponPersistence shoppingCouponPersistence;
1014            @BeanReference(type = ShoppingCouponFinder.class)
1015            protected ShoppingCouponFinder shoppingCouponFinder;
1016            @BeanReference(type = ShoppingItemLocalService.class)
1017            protected ShoppingItemLocalService shoppingItemLocalService;
1018            @BeanReference(type = ShoppingItemService.class)
1019            protected ShoppingItemService shoppingItemService;
1020            @BeanReference(type = ShoppingItemPersistence.class)
1021            protected ShoppingItemPersistence shoppingItemPersistence;
1022            @BeanReference(type = ShoppingItemFinder.class)
1023            protected ShoppingItemFinder shoppingItemFinder;
1024            @BeanReference(type = ShoppingItemFieldLocalService.class)
1025            protected ShoppingItemFieldLocalService shoppingItemFieldLocalService;
1026            @BeanReference(type = ShoppingItemFieldPersistence.class)
1027            protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
1028            @BeanReference(type = ShoppingItemPriceLocalService.class)
1029            protected ShoppingItemPriceLocalService shoppingItemPriceLocalService;
1030            @BeanReference(type = ShoppingItemPricePersistence.class)
1031            protected ShoppingItemPricePersistence shoppingItemPricePersistence;
1032            @BeanReference(type = ShoppingOrderLocalService.class)
1033            protected ShoppingOrderLocalService shoppingOrderLocalService;
1034            @BeanReference(type = ShoppingOrderService.class)
1035            protected ShoppingOrderService shoppingOrderService;
1036            @BeanReference(type = ShoppingOrderPersistence.class)
1037            protected ShoppingOrderPersistence shoppingOrderPersistence;
1038            @BeanReference(type = ShoppingOrderFinder.class)
1039            protected ShoppingOrderFinder shoppingOrderFinder;
1040            @BeanReference(type = ShoppingOrderItemLocalService.class)
1041            protected ShoppingOrderItemLocalService shoppingOrderItemLocalService;
1042            @BeanReference(type = ShoppingOrderItemPersistence.class)
1043            protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
1044            @BeanReference(type = CounterLocalService.class)
1045            protected CounterLocalService counterLocalService;
1046            @BeanReference(type = ResourceLocalService.class)
1047            protected ResourceLocalService resourceLocalService;
1048            @BeanReference(type = ResourceService.class)
1049            protected ResourceService resourceService;
1050            @BeanReference(type = ResourcePersistence.class)
1051            protected ResourcePersistence resourcePersistence;
1052            @BeanReference(type = ResourceFinder.class)
1053            protected ResourceFinder resourceFinder;
1054            @BeanReference(type = UserLocalService.class)
1055            protected UserLocalService userLocalService;
1056            @BeanReference(type = UserService.class)
1057            protected UserService userService;
1058            @BeanReference(type = UserPersistence.class)
1059            protected UserPersistence userPersistence;
1060            @BeanReference(type = UserFinder.class)
1061            protected UserFinder userFinder;
1062            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
1063            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
1064            private static Log _log = LogFactoryUtil.getLog(ShoppingCouponLocalServiceBaseImpl.class);
1065            private String _beanIdentifier;
1066    }