001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.bean.IdentifiableBean;
021    import com.liferay.portal.kernel.dao.db.DB;
022    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
023    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
024    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
025    import com.liferay.portal.kernel.dao.orm.ActionableDynamicQuery;
026    import com.liferay.portal.kernel.dao.orm.DefaultActionableDynamicQuery;
027    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
028    import com.liferay.portal.kernel.dao.orm.DynamicQueryFactoryUtil;
029    import com.liferay.portal.kernel.dao.orm.Projection;
030    import com.liferay.portal.kernel.exception.PortalException;
031    import com.liferay.portal.kernel.exception.SystemException;
032    import com.liferay.portal.kernel.search.Indexable;
033    import com.liferay.portal.kernel.search.IndexableType;
034    import com.liferay.portal.kernel.util.OrderByComparator;
035    import com.liferay.portal.model.PersistedModel;
036    import com.liferay.portal.service.BaseLocalServiceImpl;
037    import com.liferay.portal.service.PersistedModelLocalServiceRegistry;
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    import com.liferay.portal.util.PortalUtil;
042    
043    import com.liferay.portlet.shopping.model.ShoppingItem;
044    import com.liferay.portlet.shopping.service.ShoppingItemLocalService;
045    import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
046    import com.liferay.portlet.shopping.service.persistence.ShoppingItemFieldPersistence;
047    import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
048    import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
049    import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
050    
051    import java.io.Serializable;
052    
053    import java.util.List;
054    
055    import javax.sql.DataSource;
056    
057    /**
058     * Provides the base implementation for the shopping item local service.
059     *
060     * <p>
061     * 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}.
062     * </p>
063     *
064     * @author Brian Wing Shun Chan
065     * @see com.liferay.portlet.shopping.service.impl.ShoppingItemLocalServiceImpl
066     * @see com.liferay.portlet.shopping.service.ShoppingItemLocalServiceUtil
067     * @generated
068     */
069    @ProviderType
070    public abstract class ShoppingItemLocalServiceBaseImpl
071            extends BaseLocalServiceImpl implements ShoppingItemLocalService,
072                    IdentifiableBean {
073            /*
074             * NOTE FOR DEVELOPERS:
075             *
076             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.shopping.service.ShoppingItemLocalServiceUtil} to access the shopping item local service.
077             */
078    
079            /**
080             * Adds the shopping item to the database. Also notifies the appropriate model listeners.
081             *
082             * @param shoppingItem the shopping item
083             * @return the shopping item that was added
084             */
085            @Indexable(type = IndexableType.REINDEX)
086            @Override
087            public ShoppingItem addShoppingItem(ShoppingItem shoppingItem) {
088                    shoppingItem.setNew(true);
089    
090                    return shoppingItemPersistence.update(shoppingItem);
091            }
092    
093            /**
094             * Creates a new shopping item with the primary key. Does not add the shopping item to the database.
095             *
096             * @param itemId the primary key for the new shopping item
097             * @return the new shopping item
098             */
099            @Override
100            public ShoppingItem createShoppingItem(long itemId) {
101                    return shoppingItemPersistence.create(itemId);
102            }
103    
104            /**
105             * Deletes the shopping item with the primary key from the database. Also notifies the appropriate model listeners.
106             *
107             * @param itemId the primary key of the shopping item
108             * @return the shopping item that was removed
109             * @throws PortalException if a shopping item with the primary key could not be found
110             */
111            @Indexable(type = IndexableType.DELETE)
112            @Override
113            public ShoppingItem deleteShoppingItem(long itemId)
114                    throws PortalException {
115                    return shoppingItemPersistence.remove(itemId);
116            }
117    
118            /**
119             * Deletes the shopping item from the database. Also notifies the appropriate model listeners.
120             *
121             * @param shoppingItem the shopping item
122             * @return the shopping item that was removed
123             */
124            @Indexable(type = IndexableType.DELETE)
125            @Override
126            public ShoppingItem deleteShoppingItem(ShoppingItem shoppingItem) {
127                    return shoppingItemPersistence.remove(shoppingItem);
128            }
129    
130            @Override
131            public DynamicQuery dynamicQuery() {
132                    Class<?> clazz = getClass();
133    
134                    return DynamicQueryFactoryUtil.forClass(ShoppingItem.class,
135                            clazz.getClassLoader());
136            }
137    
138            /**
139             * Performs a dynamic query on the database and returns the matching rows.
140             *
141             * @param dynamicQuery the dynamic query
142             * @return the matching rows
143             */
144            @Override
145            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) {
146                    return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery);
147            }
148    
149            /**
150             * Performs a dynamic query on the database and returns a range of the matching rows.
151             *
152             * <p>
153             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
154             * </p>
155             *
156             * @param dynamicQuery the dynamic query
157             * @param start the lower bound of the range of model instances
158             * @param end the upper bound of the range of model instances (not inclusive)
159             * @return the range of matching rows
160             */
161            @Override
162            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
163                    int end) {
164                    return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery,
165                            start, end);
166            }
167    
168            /**
169             * Performs a dynamic query on the database and returns an ordered range of the matching rows.
170             *
171             * <p>
172             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
173             * </p>
174             *
175             * @param dynamicQuery the dynamic query
176             * @param start the lower bound of the range of model instances
177             * @param end the upper bound of the range of model instances (not inclusive)
178             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
179             * @return the ordered range of matching rows
180             */
181            @Override
182            public <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start,
183                    int end, OrderByComparator<T> orderByComparator) {
184                    return shoppingItemPersistence.findWithDynamicQuery(dynamicQuery,
185                            start, end, orderByComparator);
186            }
187    
188            /**
189             * Returns the number of rows matching the dynamic query.
190             *
191             * @param dynamicQuery the dynamic query
192             * @return the number of rows matching the dynamic query
193             */
194            @Override
195            public long dynamicQueryCount(DynamicQuery dynamicQuery) {
196                    return shoppingItemPersistence.countWithDynamicQuery(dynamicQuery);
197            }
198    
199            /**
200             * Returns the number of rows matching the dynamic query.
201             *
202             * @param dynamicQuery the dynamic query
203             * @param projection the projection to apply to the query
204             * @return the number of rows matching the dynamic query
205             */
206            @Override
207            public long dynamicQueryCount(DynamicQuery dynamicQuery,
208                    Projection projection) {
209                    return shoppingItemPersistence.countWithDynamicQuery(dynamicQuery,
210                            projection);
211            }
212    
213            @Override
214            public ShoppingItem fetchShoppingItem(long itemId) {
215                    return shoppingItemPersistence.fetchByPrimaryKey(itemId);
216            }
217    
218            /**
219             * Returns the shopping item with the primary key.
220             *
221             * @param itemId the primary key of the shopping item
222             * @return the shopping item
223             * @throws PortalException if a shopping item with the primary key could not be found
224             */
225            @Override
226            public ShoppingItem getShoppingItem(long itemId) throws PortalException {
227                    return shoppingItemPersistence.findByPrimaryKey(itemId);
228            }
229    
230            @Override
231            public ActionableDynamicQuery getActionableDynamicQuery() {
232                    ActionableDynamicQuery actionableDynamicQuery = new DefaultActionableDynamicQuery();
233    
234                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.shopping.service.ShoppingItemLocalServiceUtil.getService());
235                    actionableDynamicQuery.setClass(ShoppingItem.class);
236                    actionableDynamicQuery.setClassLoader(getClassLoader());
237    
238                    actionableDynamicQuery.setPrimaryKeyPropertyName("itemId");
239    
240                    return actionableDynamicQuery;
241            }
242    
243            protected void initActionableDynamicQuery(
244                    ActionableDynamicQuery actionableDynamicQuery) {
245                    actionableDynamicQuery.setBaseLocalService(com.liferay.portlet.shopping.service.ShoppingItemLocalServiceUtil.getService());
246                    actionableDynamicQuery.setClass(ShoppingItem.class);
247                    actionableDynamicQuery.setClassLoader(getClassLoader());
248    
249                    actionableDynamicQuery.setPrimaryKeyPropertyName("itemId");
250            }
251    
252            /**
253             * @throws PortalException
254             */
255            @Override
256            public PersistedModel deletePersistedModel(PersistedModel persistedModel)
257                    throws PortalException {
258                    return shoppingItemLocalService.deleteShoppingItem((ShoppingItem)persistedModel);
259            }
260    
261            @Override
262            public PersistedModel getPersistedModel(Serializable primaryKeyObj)
263                    throws PortalException {
264                    return shoppingItemPersistence.findByPrimaryKey(primaryKeyObj);
265            }
266    
267            /**
268             * Returns a range of all the shopping items.
269             *
270             * <p>
271             * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
272             * </p>
273             *
274             * @param start the lower bound of the range of shopping items
275             * @param end the upper bound of the range of shopping items (not inclusive)
276             * @return the range of shopping items
277             */
278            @Override
279            public List<ShoppingItem> getShoppingItems(int start, int end) {
280                    return shoppingItemPersistence.findAll(start, end);
281            }
282    
283            /**
284             * Returns the number of shopping items.
285             *
286             * @return the number of shopping items
287             */
288            @Override
289            public int getShoppingItemsCount() {
290                    return shoppingItemPersistence.countAll();
291            }
292    
293            /**
294             * Updates the shopping item in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.
295             *
296             * @param shoppingItem the shopping item
297             * @return the shopping item that was updated
298             */
299            @Indexable(type = IndexableType.REINDEX)
300            @Override
301            public ShoppingItem updateShoppingItem(ShoppingItem shoppingItem) {
302                    return shoppingItemPersistence.update(shoppingItem);
303            }
304    
305            /**
306             * Returns the shopping item local service.
307             *
308             * @return the shopping item local service
309             */
310            public com.liferay.portlet.shopping.service.ShoppingItemLocalService getShoppingItemLocalService() {
311                    return shoppingItemLocalService;
312            }
313    
314            /**
315             * Sets the shopping item local service.
316             *
317             * @param shoppingItemLocalService the shopping item local service
318             */
319            public void setShoppingItemLocalService(
320                    com.liferay.portlet.shopping.service.ShoppingItemLocalService shoppingItemLocalService) {
321                    this.shoppingItemLocalService = shoppingItemLocalService;
322            }
323    
324            /**
325             * Returns the shopping item remote service.
326             *
327             * @return the shopping item remote service
328             */
329            public com.liferay.portlet.shopping.service.ShoppingItemService getShoppingItemService() {
330                    return shoppingItemService;
331            }
332    
333            /**
334             * Sets the shopping item remote service.
335             *
336             * @param shoppingItemService the shopping item remote service
337             */
338            public void setShoppingItemService(
339                    com.liferay.portlet.shopping.service.ShoppingItemService shoppingItemService) {
340                    this.shoppingItemService = shoppingItemService;
341            }
342    
343            /**
344             * Returns the shopping item persistence.
345             *
346             * @return the shopping item persistence
347             */
348            public ShoppingItemPersistence getShoppingItemPersistence() {
349                    return shoppingItemPersistence;
350            }
351    
352            /**
353             * Sets the shopping item persistence.
354             *
355             * @param shoppingItemPersistence the shopping item persistence
356             */
357            public void setShoppingItemPersistence(
358                    ShoppingItemPersistence shoppingItemPersistence) {
359                    this.shoppingItemPersistence = shoppingItemPersistence;
360            }
361    
362            /**
363             * Returns the shopping item finder.
364             *
365             * @return the shopping item finder
366             */
367            public ShoppingItemFinder getShoppingItemFinder() {
368                    return shoppingItemFinder;
369            }
370    
371            /**
372             * Sets the shopping item finder.
373             *
374             * @param shoppingItemFinder the shopping item finder
375             */
376            public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
377                    this.shoppingItemFinder = shoppingItemFinder;
378            }
379    
380            /**
381             * Returns the counter local service.
382             *
383             * @return the counter local service
384             */
385            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
386                    return counterLocalService;
387            }
388    
389            /**
390             * Sets the counter local service.
391             *
392             * @param counterLocalService the counter local service
393             */
394            public void setCounterLocalService(
395                    com.liferay.counter.service.CounterLocalService counterLocalService) {
396                    this.counterLocalService = counterLocalService;
397            }
398    
399            /**
400             * Returns the image local service.
401             *
402             * @return the image local service
403             */
404            public com.liferay.portal.service.ImageLocalService getImageLocalService() {
405                    return imageLocalService;
406            }
407    
408            /**
409             * Sets the image local service.
410             *
411             * @param imageLocalService the image local service
412             */
413            public void setImageLocalService(
414                    com.liferay.portal.service.ImageLocalService imageLocalService) {
415                    this.imageLocalService = imageLocalService;
416            }
417    
418            /**
419             * Returns the image remote service.
420             *
421             * @return the image remote service
422             */
423            public com.liferay.portal.service.ImageService getImageService() {
424                    return imageService;
425            }
426    
427            /**
428             * Sets the image remote service.
429             *
430             * @param imageService the image remote service
431             */
432            public void setImageService(
433                    com.liferay.portal.service.ImageService imageService) {
434                    this.imageService = imageService;
435            }
436    
437            /**
438             * Returns the image persistence.
439             *
440             * @return the image persistence
441             */
442            public ImagePersistence getImagePersistence() {
443                    return imagePersistence;
444            }
445    
446            /**
447             * Sets the image persistence.
448             *
449             * @param imagePersistence the image persistence
450             */
451            public void setImagePersistence(ImagePersistence imagePersistence) {
452                    this.imagePersistence = imagePersistence;
453            }
454    
455            /**
456             * Returns the resource local service.
457             *
458             * @return the resource local service
459             */
460            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
461                    return resourceLocalService;
462            }
463    
464            /**
465             * Sets the resource local service.
466             *
467             * @param resourceLocalService the resource local service
468             */
469            public void setResourceLocalService(
470                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
471                    this.resourceLocalService = resourceLocalService;
472            }
473    
474            /**
475             * Returns the user local service.
476             *
477             * @return the user local service
478             */
479            public com.liferay.portal.service.UserLocalService getUserLocalService() {
480                    return userLocalService;
481            }
482    
483            /**
484             * Sets the user local service.
485             *
486             * @param userLocalService the user local service
487             */
488            public void setUserLocalService(
489                    com.liferay.portal.service.UserLocalService userLocalService) {
490                    this.userLocalService = userLocalService;
491            }
492    
493            /**
494             * Returns the user remote service.
495             *
496             * @return the user remote service
497             */
498            public com.liferay.portal.service.UserService getUserService() {
499                    return userService;
500            }
501    
502            /**
503             * Sets the user remote service.
504             *
505             * @param userService the user remote service
506             */
507            public void setUserService(
508                    com.liferay.portal.service.UserService userService) {
509                    this.userService = userService;
510            }
511    
512            /**
513             * Returns the user persistence.
514             *
515             * @return the user persistence
516             */
517            public UserPersistence getUserPersistence() {
518                    return userPersistence;
519            }
520    
521            /**
522             * Sets the user persistence.
523             *
524             * @param userPersistence the user persistence
525             */
526            public void setUserPersistence(UserPersistence userPersistence) {
527                    this.userPersistence = userPersistence;
528            }
529    
530            /**
531             * Returns the user finder.
532             *
533             * @return the user finder
534             */
535            public UserFinder getUserFinder() {
536                    return userFinder;
537            }
538    
539            /**
540             * Sets the user finder.
541             *
542             * @param userFinder the user finder
543             */
544            public void setUserFinder(UserFinder userFinder) {
545                    this.userFinder = userFinder;
546            }
547    
548            /**
549             * Returns the shopping category local service.
550             *
551             * @return the shopping category local service
552             */
553            public com.liferay.portlet.shopping.service.ShoppingCategoryLocalService getShoppingCategoryLocalService() {
554                    return shoppingCategoryLocalService;
555            }
556    
557            /**
558             * Sets the shopping category local service.
559             *
560             * @param shoppingCategoryLocalService the shopping category local service
561             */
562            public void setShoppingCategoryLocalService(
563                    com.liferay.portlet.shopping.service.ShoppingCategoryLocalService shoppingCategoryLocalService) {
564                    this.shoppingCategoryLocalService = shoppingCategoryLocalService;
565            }
566    
567            /**
568             * Returns the shopping category remote service.
569             *
570             * @return the shopping category remote service
571             */
572            public com.liferay.portlet.shopping.service.ShoppingCategoryService getShoppingCategoryService() {
573                    return shoppingCategoryService;
574            }
575    
576            /**
577             * Sets the shopping category remote service.
578             *
579             * @param shoppingCategoryService the shopping category remote service
580             */
581            public void setShoppingCategoryService(
582                    com.liferay.portlet.shopping.service.ShoppingCategoryService shoppingCategoryService) {
583                    this.shoppingCategoryService = shoppingCategoryService;
584            }
585    
586            /**
587             * Returns the shopping category persistence.
588             *
589             * @return the shopping category persistence
590             */
591            public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
592                    return shoppingCategoryPersistence;
593            }
594    
595            /**
596             * Sets the shopping category persistence.
597             *
598             * @param shoppingCategoryPersistence the shopping category persistence
599             */
600            public void setShoppingCategoryPersistence(
601                    ShoppingCategoryPersistence shoppingCategoryPersistence) {
602                    this.shoppingCategoryPersistence = shoppingCategoryPersistence;
603            }
604    
605            /**
606             * Returns the shopping item field local service.
607             *
608             * @return the shopping item field local service
609             */
610            public com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
611                    return shoppingItemFieldLocalService;
612            }
613    
614            /**
615             * Sets the shopping item field local service.
616             *
617             * @param shoppingItemFieldLocalService the shopping item field local service
618             */
619            public void setShoppingItemFieldLocalService(
620                    com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
621                    this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
622            }
623    
624            /**
625             * Returns the shopping item field persistence.
626             *
627             * @return the shopping item field persistence
628             */
629            public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
630                    return shoppingItemFieldPersistence;
631            }
632    
633            /**
634             * Sets the shopping item field persistence.
635             *
636             * @param shoppingItemFieldPersistence the shopping item field persistence
637             */
638            public void setShoppingItemFieldPersistence(
639                    ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
640                    this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
641            }
642    
643            /**
644             * Returns the shopping item price local service.
645             *
646             * @return the shopping item price local service
647             */
648            public com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
649                    return shoppingItemPriceLocalService;
650            }
651    
652            /**
653             * Sets the shopping item price local service.
654             *
655             * @param shoppingItemPriceLocalService the shopping item price local service
656             */
657            public void setShoppingItemPriceLocalService(
658                    com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
659                    this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
660            }
661    
662            /**
663             * Returns the shopping item price persistence.
664             *
665             * @return the shopping item price persistence
666             */
667            public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
668                    return shoppingItemPricePersistence;
669            }
670    
671            /**
672             * Sets the shopping item price persistence.
673             *
674             * @param shoppingItemPricePersistence the shopping item price persistence
675             */
676            public void setShoppingItemPricePersistence(
677                    ShoppingItemPricePersistence shoppingItemPricePersistence) {
678                    this.shoppingItemPricePersistence = shoppingItemPricePersistence;
679            }
680    
681            public void afterPropertiesSet() {
682                    persistedModelLocalServiceRegistry.register("com.liferay.portlet.shopping.model.ShoppingItem",
683                            shoppingItemLocalService);
684            }
685    
686            public void destroy() {
687                    persistedModelLocalServiceRegistry.unregister(
688                            "com.liferay.portlet.shopping.model.ShoppingItem");
689            }
690    
691            /**
692             * Returns the Spring bean ID for this bean.
693             *
694             * @return the Spring bean ID for this bean
695             */
696            @Override
697            public String getBeanIdentifier() {
698                    return _beanIdentifier;
699            }
700    
701            /**
702             * Sets the Spring bean ID for this bean.
703             *
704             * @param beanIdentifier the Spring bean ID for this bean
705             */
706            @Override
707            public void setBeanIdentifier(String beanIdentifier) {
708                    _beanIdentifier = beanIdentifier;
709            }
710    
711            protected Class<?> getModelClass() {
712                    return ShoppingItem.class;
713            }
714    
715            protected String getModelClassName() {
716                    return ShoppingItem.class.getName();
717            }
718    
719            /**
720             * Performs a SQL query.
721             *
722             * @param sql the sql query
723             */
724            protected void runSQL(String sql) {
725                    try {
726                            DataSource dataSource = shoppingItemPersistence.getDataSource();
727    
728                            DB db = DBFactoryUtil.getDB();
729    
730                            sql = db.buildSQL(sql);
731                            sql = PortalUtil.transformSQL(sql);
732    
733                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
734                                            sql, new int[0]);
735    
736                            sqlUpdate.update();
737                    }
738                    catch (Exception e) {
739                            throw new SystemException(e);
740                    }
741            }
742    
743            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemLocalService.class)
744            protected com.liferay.portlet.shopping.service.ShoppingItemLocalService shoppingItemLocalService;
745            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemService.class)
746            protected com.liferay.portlet.shopping.service.ShoppingItemService shoppingItemService;
747            @BeanReference(type = ShoppingItemPersistence.class)
748            protected ShoppingItemPersistence shoppingItemPersistence;
749            @BeanReference(type = ShoppingItemFinder.class)
750            protected ShoppingItemFinder shoppingItemFinder;
751            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
752            protected com.liferay.counter.service.CounterLocalService counterLocalService;
753            @BeanReference(type = com.liferay.portal.service.ImageLocalService.class)
754            protected com.liferay.portal.service.ImageLocalService imageLocalService;
755            @BeanReference(type = com.liferay.portal.service.ImageService.class)
756            protected com.liferay.portal.service.ImageService imageService;
757            @BeanReference(type = ImagePersistence.class)
758            protected ImagePersistence imagePersistence;
759            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
760            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
761            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
762            protected com.liferay.portal.service.UserLocalService userLocalService;
763            @BeanReference(type = com.liferay.portal.service.UserService.class)
764            protected com.liferay.portal.service.UserService userService;
765            @BeanReference(type = UserPersistence.class)
766            protected UserPersistence userPersistence;
767            @BeanReference(type = UserFinder.class)
768            protected UserFinder userFinder;
769            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCategoryLocalService.class)
770            protected com.liferay.portlet.shopping.service.ShoppingCategoryLocalService shoppingCategoryLocalService;
771            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCategoryService.class)
772            protected com.liferay.portlet.shopping.service.ShoppingCategoryService shoppingCategoryService;
773            @BeanReference(type = ShoppingCategoryPersistence.class)
774            protected ShoppingCategoryPersistence shoppingCategoryPersistence;
775            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService.class)
776            protected com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService shoppingItemFieldLocalService;
777            @BeanReference(type = ShoppingItemFieldPersistence.class)
778            protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
779            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService.class)
780            protected com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService shoppingItemPriceLocalService;
781            @BeanReference(type = ShoppingItemPricePersistence.class)
782            protected ShoppingItemPricePersistence shoppingItemPricePersistence;
783            @BeanReference(type = PersistedModelLocalServiceRegistry.class)
784            protected PersistedModelLocalServiceRegistry persistedModelLocalServiceRegistry;
785            private String _beanIdentifier;
786    }