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