1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portlet.shopping.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  
19  import com.liferay.portal.kernel.annotation.BeanReference;
20  import com.liferay.portal.kernel.dao.db.DB;
21  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
22  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
23  import com.liferay.portal.kernel.exception.PortalException;
24  import com.liferay.portal.kernel.exception.SystemException;
25  import com.liferay.portal.kernel.util.OrderByComparator;
26  import com.liferay.portal.service.ResourceLocalService;
27  import com.liferay.portal.service.ResourceService;
28  import com.liferay.portal.service.UserLocalService;
29  import com.liferay.portal.service.UserService;
30  import com.liferay.portal.service.persistence.ResourceFinder;
31  import com.liferay.portal.service.persistence.ResourcePersistence;
32  import com.liferay.portal.service.persistence.UserFinder;
33  import com.liferay.portal.service.persistence.UserPersistence;
34  
35  import com.liferay.portlet.shopping.model.ShoppingCategory;
36  import com.liferay.portlet.shopping.service.ShoppingCartLocalService;
37  import com.liferay.portlet.shopping.service.ShoppingCategoryLocalService;
38  import com.liferay.portlet.shopping.service.ShoppingCategoryService;
39  import com.liferay.portlet.shopping.service.ShoppingCouponLocalService;
40  import com.liferay.portlet.shopping.service.ShoppingCouponService;
41  import com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService;
42  import com.liferay.portlet.shopping.service.ShoppingItemLocalService;
43  import com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService;
44  import com.liferay.portlet.shopping.service.ShoppingItemService;
45  import com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService;
46  import com.liferay.portlet.shopping.service.ShoppingOrderLocalService;
47  import com.liferay.portlet.shopping.service.ShoppingOrderService;
48  import com.liferay.portlet.shopping.service.persistence.ShoppingCartPersistence;
49  import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
50  import com.liferay.portlet.shopping.service.persistence.ShoppingCouponFinder;
51  import com.liferay.portlet.shopping.service.persistence.ShoppingCouponPersistence;
52  import com.liferay.portlet.shopping.service.persistence.ShoppingItemFieldPersistence;
53  import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
54  import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
55  import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
56  import com.liferay.portlet.shopping.service.persistence.ShoppingOrderFinder;
57  import com.liferay.portlet.shopping.service.persistence.ShoppingOrderItemPersistence;
58  import com.liferay.portlet.shopping.service.persistence.ShoppingOrderPersistence;
59  
60  import java.util.List;
61  
62  /**
63   * <a href="ShoppingCategoryLocalServiceBaseImpl.java.html"><b><i>View Source
64   * </i></b></a>
65   *
66   * @author Brian Wing Shun Chan
67   */
68  public abstract class ShoppingCategoryLocalServiceBaseImpl
69      implements ShoppingCategoryLocalService {
70      public ShoppingCategory addShoppingCategory(
71          ShoppingCategory shoppingCategory) throws SystemException {
72          shoppingCategory.setNew(true);
73  
74          return shoppingCategoryPersistence.update(shoppingCategory, false);
75      }
76  
77      public ShoppingCategory createShoppingCategory(long categoryId) {
78          return shoppingCategoryPersistence.create(categoryId);
79      }
80  
81      public void deleteShoppingCategory(long categoryId)
82          throws PortalException, SystemException {
83          shoppingCategoryPersistence.remove(categoryId);
84      }
85  
86      public void deleteShoppingCategory(ShoppingCategory shoppingCategory)
87          throws SystemException {
88          shoppingCategoryPersistence.remove(shoppingCategory);
89      }
90  
91      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
92          throws SystemException {
93          return shoppingCategoryPersistence.findWithDynamicQuery(dynamicQuery);
94      }
95  
96      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
97          int end) throws SystemException {
98          return shoppingCategoryPersistence.findWithDynamicQuery(dynamicQuery,
99              start, end);
100     }
101 
102     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
103         int end, OrderByComparator orderByComparator) throws SystemException {
104         return shoppingCategoryPersistence.findWithDynamicQuery(dynamicQuery,
105             start, end, orderByComparator);
106     }
107 
108     public int dynamicQueryCount(DynamicQuery dynamicQuery)
109         throws SystemException {
110         return shoppingCategoryPersistence.countWithDynamicQuery(dynamicQuery);
111     }
112 
113     public ShoppingCategory getShoppingCategory(long categoryId)
114         throws PortalException, SystemException {
115         return shoppingCategoryPersistence.findByPrimaryKey(categoryId);
116     }
117 
118     public List<ShoppingCategory> getShoppingCategories(int start, int end)
119         throws SystemException {
120         return shoppingCategoryPersistence.findAll(start, end);
121     }
122 
123     public int getShoppingCategoriesCount() throws SystemException {
124         return shoppingCategoryPersistence.countAll();
125     }
126 
127     public ShoppingCategory updateShoppingCategory(
128         ShoppingCategory shoppingCategory) throws SystemException {
129         shoppingCategory.setNew(false);
130 
131         return shoppingCategoryPersistence.update(shoppingCategory, true);
132     }
133 
134     public ShoppingCategory updateShoppingCategory(
135         ShoppingCategory shoppingCategory, boolean merge)
136         throws SystemException {
137         shoppingCategory.setNew(false);
138 
139         return shoppingCategoryPersistence.update(shoppingCategory, merge);
140     }
141 
142     public ShoppingCartLocalService getShoppingCartLocalService() {
143         return shoppingCartLocalService;
144     }
145 
146     public void setShoppingCartLocalService(
147         ShoppingCartLocalService shoppingCartLocalService) {
148         this.shoppingCartLocalService = shoppingCartLocalService;
149     }
150 
151     public ShoppingCartPersistence getShoppingCartPersistence() {
152         return shoppingCartPersistence;
153     }
154 
155     public void setShoppingCartPersistence(
156         ShoppingCartPersistence shoppingCartPersistence) {
157         this.shoppingCartPersistence = shoppingCartPersistence;
158     }
159 
160     public ShoppingCategoryLocalService getShoppingCategoryLocalService() {
161         return shoppingCategoryLocalService;
162     }
163 
164     public void setShoppingCategoryLocalService(
165         ShoppingCategoryLocalService shoppingCategoryLocalService) {
166         this.shoppingCategoryLocalService = shoppingCategoryLocalService;
167     }
168 
169     public ShoppingCategoryService getShoppingCategoryService() {
170         return shoppingCategoryService;
171     }
172 
173     public void setShoppingCategoryService(
174         ShoppingCategoryService shoppingCategoryService) {
175         this.shoppingCategoryService = shoppingCategoryService;
176     }
177 
178     public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
179         return shoppingCategoryPersistence;
180     }
181 
182     public void setShoppingCategoryPersistence(
183         ShoppingCategoryPersistence shoppingCategoryPersistence) {
184         this.shoppingCategoryPersistence = shoppingCategoryPersistence;
185     }
186 
187     public ShoppingCouponLocalService getShoppingCouponLocalService() {
188         return shoppingCouponLocalService;
189     }
190 
191     public void setShoppingCouponLocalService(
192         ShoppingCouponLocalService shoppingCouponLocalService) {
193         this.shoppingCouponLocalService = shoppingCouponLocalService;
194     }
195 
196     public ShoppingCouponService getShoppingCouponService() {
197         return shoppingCouponService;
198     }
199 
200     public void setShoppingCouponService(
201         ShoppingCouponService shoppingCouponService) {
202         this.shoppingCouponService = shoppingCouponService;
203     }
204 
205     public ShoppingCouponPersistence getShoppingCouponPersistence() {
206         return shoppingCouponPersistence;
207     }
208 
209     public void setShoppingCouponPersistence(
210         ShoppingCouponPersistence shoppingCouponPersistence) {
211         this.shoppingCouponPersistence = shoppingCouponPersistence;
212     }
213 
214     public ShoppingCouponFinder getShoppingCouponFinder() {
215         return shoppingCouponFinder;
216     }
217 
218     public void setShoppingCouponFinder(
219         ShoppingCouponFinder shoppingCouponFinder) {
220         this.shoppingCouponFinder = shoppingCouponFinder;
221     }
222 
223     public ShoppingItemLocalService getShoppingItemLocalService() {
224         return shoppingItemLocalService;
225     }
226 
227     public void setShoppingItemLocalService(
228         ShoppingItemLocalService shoppingItemLocalService) {
229         this.shoppingItemLocalService = shoppingItemLocalService;
230     }
231 
232     public ShoppingItemService getShoppingItemService() {
233         return shoppingItemService;
234     }
235 
236     public void setShoppingItemService(ShoppingItemService shoppingItemService) {
237         this.shoppingItemService = shoppingItemService;
238     }
239 
240     public ShoppingItemPersistence getShoppingItemPersistence() {
241         return shoppingItemPersistence;
242     }
243 
244     public void setShoppingItemPersistence(
245         ShoppingItemPersistence shoppingItemPersistence) {
246         this.shoppingItemPersistence = shoppingItemPersistence;
247     }
248 
249     public ShoppingItemFinder getShoppingItemFinder() {
250         return shoppingItemFinder;
251     }
252 
253     public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
254         this.shoppingItemFinder = shoppingItemFinder;
255     }
256 
257     public ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
258         return shoppingItemFieldLocalService;
259     }
260 
261     public void setShoppingItemFieldLocalService(
262         ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
263         this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
264     }
265 
266     public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
267         return shoppingItemFieldPersistence;
268     }
269 
270     public void setShoppingItemFieldPersistence(
271         ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
272         this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
273     }
274 
275     public ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
276         return shoppingItemPriceLocalService;
277     }
278 
279     public void setShoppingItemPriceLocalService(
280         ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
281         this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
282     }
283 
284     public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
285         return shoppingItemPricePersistence;
286     }
287 
288     public void setShoppingItemPricePersistence(
289         ShoppingItemPricePersistence shoppingItemPricePersistence) {
290         this.shoppingItemPricePersistence = shoppingItemPricePersistence;
291     }
292 
293     public ShoppingOrderLocalService getShoppingOrderLocalService() {
294         return shoppingOrderLocalService;
295     }
296 
297     public void setShoppingOrderLocalService(
298         ShoppingOrderLocalService shoppingOrderLocalService) {
299         this.shoppingOrderLocalService = shoppingOrderLocalService;
300     }
301 
302     public ShoppingOrderService getShoppingOrderService() {
303         return shoppingOrderService;
304     }
305 
306     public void setShoppingOrderService(
307         ShoppingOrderService shoppingOrderService) {
308         this.shoppingOrderService = shoppingOrderService;
309     }
310 
311     public ShoppingOrderPersistence getShoppingOrderPersistence() {
312         return shoppingOrderPersistence;
313     }
314 
315     public void setShoppingOrderPersistence(
316         ShoppingOrderPersistence shoppingOrderPersistence) {
317         this.shoppingOrderPersistence = shoppingOrderPersistence;
318     }
319 
320     public ShoppingOrderFinder getShoppingOrderFinder() {
321         return shoppingOrderFinder;
322     }
323 
324     public void setShoppingOrderFinder(ShoppingOrderFinder shoppingOrderFinder) {
325         this.shoppingOrderFinder = shoppingOrderFinder;
326     }
327 
328     public ShoppingOrderItemLocalService getShoppingOrderItemLocalService() {
329         return shoppingOrderItemLocalService;
330     }
331 
332     public void setShoppingOrderItemLocalService(
333         ShoppingOrderItemLocalService shoppingOrderItemLocalService) {
334         this.shoppingOrderItemLocalService = shoppingOrderItemLocalService;
335     }
336 
337     public ShoppingOrderItemPersistence getShoppingOrderItemPersistence() {
338         return shoppingOrderItemPersistence;
339     }
340 
341     public void setShoppingOrderItemPersistence(
342         ShoppingOrderItemPersistence shoppingOrderItemPersistence) {
343         this.shoppingOrderItemPersistence = shoppingOrderItemPersistence;
344     }
345 
346     public CounterLocalService getCounterLocalService() {
347         return counterLocalService;
348     }
349 
350     public void setCounterLocalService(CounterLocalService counterLocalService) {
351         this.counterLocalService = counterLocalService;
352     }
353 
354     public ResourceLocalService getResourceLocalService() {
355         return resourceLocalService;
356     }
357 
358     public void setResourceLocalService(
359         ResourceLocalService resourceLocalService) {
360         this.resourceLocalService = resourceLocalService;
361     }
362 
363     public ResourceService getResourceService() {
364         return resourceService;
365     }
366 
367     public void setResourceService(ResourceService resourceService) {
368         this.resourceService = resourceService;
369     }
370 
371     public ResourcePersistence getResourcePersistence() {
372         return resourcePersistence;
373     }
374 
375     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
376         this.resourcePersistence = resourcePersistence;
377     }
378 
379     public ResourceFinder getResourceFinder() {
380         return resourceFinder;
381     }
382 
383     public void setResourceFinder(ResourceFinder resourceFinder) {
384         this.resourceFinder = resourceFinder;
385     }
386 
387     public UserLocalService getUserLocalService() {
388         return userLocalService;
389     }
390 
391     public void setUserLocalService(UserLocalService userLocalService) {
392         this.userLocalService = userLocalService;
393     }
394 
395     public UserService getUserService() {
396         return userService;
397     }
398 
399     public void setUserService(UserService userService) {
400         this.userService = userService;
401     }
402 
403     public UserPersistence getUserPersistence() {
404         return userPersistence;
405     }
406 
407     public void setUserPersistence(UserPersistence userPersistence) {
408         this.userPersistence = userPersistence;
409     }
410 
411     public UserFinder getUserFinder() {
412         return userFinder;
413     }
414 
415     public void setUserFinder(UserFinder userFinder) {
416         this.userFinder = userFinder;
417     }
418 
419     protected void runSQL(String sql) throws SystemException {
420         try {
421             DB db = DBFactoryUtil.getDB();
422 
423             db.runSQL(sql);
424         }
425         catch (Exception e) {
426             throw new SystemException(e);
427         }
428     }
429 
430     @BeanReference(type = ShoppingCartLocalService.class)
431     protected ShoppingCartLocalService shoppingCartLocalService;
432     @BeanReference(type = ShoppingCartPersistence.class)
433     protected ShoppingCartPersistence shoppingCartPersistence;
434     @BeanReference(type = ShoppingCategoryLocalService.class)
435     protected ShoppingCategoryLocalService shoppingCategoryLocalService;
436     @BeanReference(type = ShoppingCategoryService.class)
437     protected ShoppingCategoryService shoppingCategoryService;
438     @BeanReference(type = ShoppingCategoryPersistence.class)
439     protected ShoppingCategoryPersistence shoppingCategoryPersistence;
440     @BeanReference(type = ShoppingCouponLocalService.class)
441     protected ShoppingCouponLocalService shoppingCouponLocalService;
442     @BeanReference(type = ShoppingCouponService.class)
443     protected ShoppingCouponService shoppingCouponService;
444     @BeanReference(type = ShoppingCouponPersistence.class)
445     protected ShoppingCouponPersistence shoppingCouponPersistence;
446     @BeanReference(type = ShoppingCouponFinder.class)
447     protected ShoppingCouponFinder shoppingCouponFinder;
448     @BeanReference(type = ShoppingItemLocalService.class)
449     protected ShoppingItemLocalService shoppingItemLocalService;
450     @BeanReference(type = ShoppingItemService.class)
451     protected ShoppingItemService shoppingItemService;
452     @BeanReference(type = ShoppingItemPersistence.class)
453     protected ShoppingItemPersistence shoppingItemPersistence;
454     @BeanReference(type = ShoppingItemFinder.class)
455     protected ShoppingItemFinder shoppingItemFinder;
456     @BeanReference(type = ShoppingItemFieldLocalService.class)
457     protected ShoppingItemFieldLocalService shoppingItemFieldLocalService;
458     @BeanReference(type = ShoppingItemFieldPersistence.class)
459     protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
460     @BeanReference(type = ShoppingItemPriceLocalService.class)
461     protected ShoppingItemPriceLocalService shoppingItemPriceLocalService;
462     @BeanReference(type = ShoppingItemPricePersistence.class)
463     protected ShoppingItemPricePersistence shoppingItemPricePersistence;
464     @BeanReference(type = ShoppingOrderLocalService.class)
465     protected ShoppingOrderLocalService shoppingOrderLocalService;
466     @BeanReference(type = ShoppingOrderService.class)
467     protected ShoppingOrderService shoppingOrderService;
468     @BeanReference(type = ShoppingOrderPersistence.class)
469     protected ShoppingOrderPersistence shoppingOrderPersistence;
470     @BeanReference(type = ShoppingOrderFinder.class)
471     protected ShoppingOrderFinder shoppingOrderFinder;
472     @BeanReference(type = ShoppingOrderItemLocalService.class)
473     protected ShoppingOrderItemLocalService shoppingOrderItemLocalService;
474     @BeanReference(type = ShoppingOrderItemPersistence.class)
475     protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
476     @BeanReference(type = CounterLocalService.class)
477     protected CounterLocalService counterLocalService;
478     @BeanReference(type = ResourceLocalService.class)
479     protected ResourceLocalService resourceLocalService;
480     @BeanReference(type = ResourceService.class)
481     protected ResourceService resourceService;
482     @BeanReference(type = ResourcePersistence.class)
483     protected ResourcePersistence resourcePersistence;
484     @BeanReference(type = ResourceFinder.class)
485     protected ResourceFinder resourceFinder;
486     @BeanReference(type = UserLocalService.class)
487     protected UserLocalService userLocalService;
488     @BeanReference(type = UserService.class)
489     protected UserService userService;
490     @BeanReference(type = UserPersistence.class)
491     protected UserPersistence userPersistence;
492     @BeanReference(type = UserFinder.class)
493     protected UserFinder userFinder;
494 }