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