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 com.liferay.portal.kernel.bean.BeanReference;
018    import com.liferay.portal.kernel.bean.IdentifiableBean;
019    import com.liferay.portal.kernel.dao.db.DB;
020    import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
021    import com.liferay.portal.kernel.dao.jdbc.SqlUpdate;
022    import com.liferay.portal.kernel.dao.jdbc.SqlUpdateFactoryUtil;
023    import com.liferay.portal.kernel.exception.SystemException;
024    import com.liferay.portal.service.BaseServiceImpl;
025    import com.liferay.portal.service.persistence.UserFinder;
026    import com.liferay.portal.service.persistence.UserPersistence;
027    import com.liferay.portal.util.PortalUtil;
028    
029    import com.liferay.portlet.shopping.model.ShoppingCategory;
030    import com.liferay.portlet.shopping.service.ShoppingCategoryService;
031    import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
032    import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
033    import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
034    
035    import javax.sql.DataSource;
036    
037    /**
038     * Provides the base implementation for the shopping category remote service.
039     *
040     * <p>
041     * 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.ShoppingCategoryServiceImpl}.
042     * </p>
043     *
044     * @author Brian Wing Shun Chan
045     * @see com.liferay.portlet.shopping.service.impl.ShoppingCategoryServiceImpl
046     * @see com.liferay.portlet.shopping.service.ShoppingCategoryServiceUtil
047     * @generated
048     */
049    public abstract class ShoppingCategoryServiceBaseImpl extends BaseServiceImpl
050            implements ShoppingCategoryService, IdentifiableBean {
051            /*
052             * NOTE FOR DEVELOPERS:
053             *
054             * Never modify or reference this class directly. Always use {@link com.liferay.portlet.shopping.service.ShoppingCategoryServiceUtil} to access the shopping category remote service.
055             */
056    
057            /**
058             * Returns the shopping category local service.
059             *
060             * @return the shopping category local service
061             */
062            public com.liferay.portlet.shopping.service.ShoppingCategoryLocalService getShoppingCategoryLocalService() {
063                    return shoppingCategoryLocalService;
064            }
065    
066            /**
067             * Sets the shopping category local service.
068             *
069             * @param shoppingCategoryLocalService the shopping category local service
070             */
071            public void setShoppingCategoryLocalService(
072                    com.liferay.portlet.shopping.service.ShoppingCategoryLocalService shoppingCategoryLocalService) {
073                    this.shoppingCategoryLocalService = shoppingCategoryLocalService;
074            }
075    
076            /**
077             * Returns the shopping category remote service.
078             *
079             * @return the shopping category remote service
080             */
081            public com.liferay.portlet.shopping.service.ShoppingCategoryService getShoppingCategoryService() {
082                    return shoppingCategoryService;
083            }
084    
085            /**
086             * Sets the shopping category remote service.
087             *
088             * @param shoppingCategoryService the shopping category remote service
089             */
090            public void setShoppingCategoryService(
091                    com.liferay.portlet.shopping.service.ShoppingCategoryService shoppingCategoryService) {
092                    this.shoppingCategoryService = shoppingCategoryService;
093            }
094    
095            /**
096             * Returns the shopping category persistence.
097             *
098             * @return the shopping category persistence
099             */
100            public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
101                    return shoppingCategoryPersistence;
102            }
103    
104            /**
105             * Sets the shopping category persistence.
106             *
107             * @param shoppingCategoryPersistence the shopping category persistence
108             */
109            public void setShoppingCategoryPersistence(
110                    ShoppingCategoryPersistence shoppingCategoryPersistence) {
111                    this.shoppingCategoryPersistence = shoppingCategoryPersistence;
112            }
113    
114            /**
115             * Returns the counter local service.
116             *
117             * @return the counter local service
118             */
119            public com.liferay.counter.service.CounterLocalService getCounterLocalService() {
120                    return counterLocalService;
121            }
122    
123            /**
124             * Sets the counter local service.
125             *
126             * @param counterLocalService the counter local service
127             */
128            public void setCounterLocalService(
129                    com.liferay.counter.service.CounterLocalService counterLocalService) {
130                    this.counterLocalService = counterLocalService;
131            }
132    
133            /**
134             * Returns the resource local service.
135             *
136             * @return the resource local service
137             */
138            public com.liferay.portal.service.ResourceLocalService getResourceLocalService() {
139                    return resourceLocalService;
140            }
141    
142            /**
143             * Sets the resource local service.
144             *
145             * @param resourceLocalService the resource local service
146             */
147            public void setResourceLocalService(
148                    com.liferay.portal.service.ResourceLocalService resourceLocalService) {
149                    this.resourceLocalService = resourceLocalService;
150            }
151    
152            /**
153             * Returns the user local service.
154             *
155             * @return the user local service
156             */
157            public com.liferay.portal.service.UserLocalService getUserLocalService() {
158                    return userLocalService;
159            }
160    
161            /**
162             * Sets the user local service.
163             *
164             * @param userLocalService the user local service
165             */
166            public void setUserLocalService(
167                    com.liferay.portal.service.UserLocalService userLocalService) {
168                    this.userLocalService = userLocalService;
169            }
170    
171            /**
172             * Returns the user remote service.
173             *
174             * @return the user remote service
175             */
176            public com.liferay.portal.service.UserService getUserService() {
177                    return userService;
178            }
179    
180            /**
181             * Sets the user remote service.
182             *
183             * @param userService the user remote service
184             */
185            public void setUserService(
186                    com.liferay.portal.service.UserService userService) {
187                    this.userService = userService;
188            }
189    
190            /**
191             * Returns the user persistence.
192             *
193             * @return the user persistence
194             */
195            public UserPersistence getUserPersistence() {
196                    return userPersistence;
197            }
198    
199            /**
200             * Sets the user persistence.
201             *
202             * @param userPersistence the user persistence
203             */
204            public void setUserPersistence(UserPersistence userPersistence) {
205                    this.userPersistence = userPersistence;
206            }
207    
208            /**
209             * Returns the user finder.
210             *
211             * @return the user finder
212             */
213            public UserFinder getUserFinder() {
214                    return userFinder;
215            }
216    
217            /**
218             * Sets the user finder.
219             *
220             * @param userFinder the user finder
221             */
222            public void setUserFinder(UserFinder userFinder) {
223                    this.userFinder = userFinder;
224            }
225    
226            /**
227             * Returns the shopping item local service.
228             *
229             * @return the shopping item local service
230             */
231            public com.liferay.portlet.shopping.service.ShoppingItemLocalService getShoppingItemLocalService() {
232                    return shoppingItemLocalService;
233            }
234    
235            /**
236             * Sets the shopping item local service.
237             *
238             * @param shoppingItemLocalService the shopping item local service
239             */
240            public void setShoppingItemLocalService(
241                    com.liferay.portlet.shopping.service.ShoppingItemLocalService shoppingItemLocalService) {
242                    this.shoppingItemLocalService = shoppingItemLocalService;
243            }
244    
245            /**
246             * Returns the shopping item remote service.
247             *
248             * @return the shopping item remote service
249             */
250            public com.liferay.portlet.shopping.service.ShoppingItemService getShoppingItemService() {
251                    return shoppingItemService;
252            }
253    
254            /**
255             * Sets the shopping item remote service.
256             *
257             * @param shoppingItemService the shopping item remote service
258             */
259            public void setShoppingItemService(
260                    com.liferay.portlet.shopping.service.ShoppingItemService shoppingItemService) {
261                    this.shoppingItemService = shoppingItemService;
262            }
263    
264            /**
265             * Returns the shopping item persistence.
266             *
267             * @return the shopping item persistence
268             */
269            public ShoppingItemPersistence getShoppingItemPersistence() {
270                    return shoppingItemPersistence;
271            }
272    
273            /**
274             * Sets the shopping item persistence.
275             *
276             * @param shoppingItemPersistence the shopping item persistence
277             */
278            public void setShoppingItemPersistence(
279                    ShoppingItemPersistence shoppingItemPersistence) {
280                    this.shoppingItemPersistence = shoppingItemPersistence;
281            }
282    
283            /**
284             * Returns the shopping item finder.
285             *
286             * @return the shopping item finder
287             */
288            public ShoppingItemFinder getShoppingItemFinder() {
289                    return shoppingItemFinder;
290            }
291    
292            /**
293             * Sets the shopping item finder.
294             *
295             * @param shoppingItemFinder the shopping item finder
296             */
297            public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
298                    this.shoppingItemFinder = shoppingItemFinder;
299            }
300    
301            public void afterPropertiesSet() {
302            }
303    
304            public void destroy() {
305            }
306    
307            /**
308             * Returns the Spring bean ID for this bean.
309             *
310             * @return the Spring bean ID for this bean
311             */
312            @Override
313            public String getBeanIdentifier() {
314                    return _beanIdentifier;
315            }
316    
317            /**
318             * Sets the Spring bean ID for this bean.
319             *
320             * @param beanIdentifier the Spring bean ID for this bean
321             */
322            @Override
323            public void setBeanIdentifier(String beanIdentifier) {
324                    _beanIdentifier = beanIdentifier;
325            }
326    
327            protected Class<?> getModelClass() {
328                    return ShoppingCategory.class;
329            }
330    
331            protected String getModelClassName() {
332                    return ShoppingCategory.class.getName();
333            }
334    
335            /**
336             * Performs a SQL query.
337             *
338             * @param sql the sql query
339             */
340            protected void runSQL(String sql) {
341                    try {
342                            DataSource dataSource = shoppingCategoryPersistence.getDataSource();
343    
344                            DB db = DBFactoryUtil.getDB();
345    
346                            sql = db.buildSQL(sql);
347                            sql = PortalUtil.transformSQL(sql);
348    
349                            SqlUpdate sqlUpdate = SqlUpdateFactoryUtil.getSqlUpdate(dataSource,
350                                            sql, new int[0]);
351    
352                            sqlUpdate.update();
353                    }
354                    catch (Exception e) {
355                            throw new SystemException(e);
356                    }
357            }
358    
359            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCategoryLocalService.class)
360            protected com.liferay.portlet.shopping.service.ShoppingCategoryLocalService shoppingCategoryLocalService;
361            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingCategoryService.class)
362            protected com.liferay.portlet.shopping.service.ShoppingCategoryService shoppingCategoryService;
363            @BeanReference(type = ShoppingCategoryPersistence.class)
364            protected ShoppingCategoryPersistence shoppingCategoryPersistence;
365            @BeanReference(type = com.liferay.counter.service.CounterLocalService.class)
366            protected com.liferay.counter.service.CounterLocalService counterLocalService;
367            @BeanReference(type = com.liferay.portal.service.ResourceLocalService.class)
368            protected com.liferay.portal.service.ResourceLocalService resourceLocalService;
369            @BeanReference(type = com.liferay.portal.service.UserLocalService.class)
370            protected com.liferay.portal.service.UserLocalService userLocalService;
371            @BeanReference(type = com.liferay.portal.service.UserService.class)
372            protected com.liferay.portal.service.UserService userService;
373            @BeanReference(type = UserPersistence.class)
374            protected UserPersistence userPersistence;
375            @BeanReference(type = UserFinder.class)
376            protected UserFinder userFinder;
377            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemLocalService.class)
378            protected com.liferay.portlet.shopping.service.ShoppingItemLocalService shoppingItemLocalService;
379            @BeanReference(type = com.liferay.portlet.shopping.service.ShoppingItemService.class)
380            protected com.liferay.portlet.shopping.service.ShoppingItemService shoppingItemService;
381            @BeanReference(type = ShoppingItemPersistence.class)
382            protected ShoppingItemPersistence shoppingItemPersistence;
383            @BeanReference(type = ShoppingItemFinder.class)
384            protected ShoppingItemFinder shoppingItemFinder;
385            private String _beanIdentifier;
386    }