1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portlet.shopping.service.base;
16  
17  import com.liferay.counter.service.CounterLocalService;
18  import com.liferay.counter.service.CounterService;
19  
20  import com.liferay.portal.PortalException;
21  import com.liferay.portal.SystemException;
22  import com.liferay.portal.kernel.annotation.BeanReference;
23  import com.liferay.portal.kernel.dao.db.DB;
24  import com.liferay.portal.kernel.dao.db.DBFactoryUtil;
25  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
26  import com.liferay.portal.kernel.util.OrderByComparator;
27  import com.liferay.portal.service.ResourceLocalService;
28  import com.liferay.portal.service.ResourceService;
29  import com.liferay.portal.service.UserLocalService;
30  import com.liferay.portal.service.UserService;
31  import com.liferay.portal.service.persistence.ResourceFinder;
32  import com.liferay.portal.service.persistence.ResourcePersistence;
33  import com.liferay.portal.service.persistence.UserFinder;
34  import com.liferay.portal.service.persistence.UserPersistence;
35  
36  import com.liferay.portlet.shopping.model.ShoppingCoupon;
37  import com.liferay.portlet.shopping.service.ShoppingCartLocalService;
38  import com.liferay.portlet.shopping.service.ShoppingCategoryLocalService;
39  import com.liferay.portlet.shopping.service.ShoppingCategoryService;
40  import com.liferay.portlet.shopping.service.ShoppingCouponLocalService;
41  import com.liferay.portlet.shopping.service.ShoppingCouponService;
42  import com.liferay.portlet.shopping.service.ShoppingItemFieldLocalService;
43  import com.liferay.portlet.shopping.service.ShoppingItemLocalService;
44  import com.liferay.portlet.shopping.service.ShoppingItemPriceLocalService;
45  import com.liferay.portlet.shopping.service.ShoppingItemService;
46  import com.liferay.portlet.shopping.service.ShoppingOrderItemLocalService;
47  import com.liferay.portlet.shopping.service.ShoppingOrderLocalService;
48  import com.liferay.portlet.shopping.service.ShoppingOrderService;
49  import com.liferay.portlet.shopping.service.persistence.ShoppingCartPersistence;
50  import com.liferay.portlet.shopping.service.persistence.ShoppingCategoryPersistence;
51  import com.liferay.portlet.shopping.service.persistence.ShoppingCouponFinder;
52  import com.liferay.portlet.shopping.service.persistence.ShoppingCouponPersistence;
53  import com.liferay.portlet.shopping.service.persistence.ShoppingItemFieldPersistence;
54  import com.liferay.portlet.shopping.service.persistence.ShoppingItemFinder;
55  import com.liferay.portlet.shopping.service.persistence.ShoppingItemPersistence;
56  import com.liferay.portlet.shopping.service.persistence.ShoppingItemPricePersistence;
57  import com.liferay.portlet.shopping.service.persistence.ShoppingOrderFinder;
58  import com.liferay.portlet.shopping.service.persistence.ShoppingOrderItemPersistence;
59  import com.liferay.portlet.shopping.service.persistence.ShoppingOrderPersistence;
60  
61  import java.util.List;
62  
63  /**
64   * <a href="ShoppingCouponLocalServiceBaseImpl.java.html"><b><i>View Source</i>
65   * </b></a>
66   *
67   * @author Brian Wing Shun Chan
68   */
69  public abstract class ShoppingCouponLocalServiceBaseImpl
70      implements ShoppingCouponLocalService {
71      public ShoppingCoupon addShoppingCoupon(ShoppingCoupon shoppingCoupon)
72          throws SystemException {
73          shoppingCoupon.setNew(true);
74  
75          return shoppingCouponPersistence.update(shoppingCoupon, false);
76      }
77  
78      public ShoppingCoupon createShoppingCoupon(long couponId) {
79          return shoppingCouponPersistence.create(couponId);
80      }
81  
82      public void deleteShoppingCoupon(long couponId)
83          throws PortalException, SystemException {
84          shoppingCouponPersistence.remove(couponId);
85      }
86  
87      public void deleteShoppingCoupon(ShoppingCoupon shoppingCoupon)
88          throws SystemException {
89          shoppingCouponPersistence.remove(shoppingCoupon);
90      }
91  
92      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
93          throws SystemException {
94          return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery);
95      }
96  
97      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
98          int end) throws SystemException {
99          return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery,
100             start, end);
101     }
102 
103     public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
104         int end, OrderByComparator orderByComparator) throws SystemException {
105         return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery,
106             start, end, orderByComparator);
107     }
108 
109     public int dynamicQueryCount(DynamicQuery dynamicQuery)
110         throws SystemException {
111         return shoppingCouponPersistence.countWithDynamicQuery(dynamicQuery);
112     }
113 
114     public ShoppingCoupon getShoppingCoupon(long couponId)
115         throws PortalException, SystemException {
116         return shoppingCouponPersistence.findByPrimaryKey(couponId);
117     }
118 
119     public List<ShoppingCoupon> getShoppingCoupons(int start, int end)
120         throws SystemException {
121         return shoppingCouponPersistence.findAll(start, end);
122     }
123 
124     public int getShoppingCouponsCount() throws SystemException {
125         return shoppingCouponPersistence.countAll();
126     }
127 
128     public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon)
129         throws SystemException {
130         shoppingCoupon.setNew(false);
131 
132         return shoppingCouponPersistence.update(shoppingCoupon, true);
133     }
134 
135     public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon,
136         boolean merge) throws SystemException {
137         shoppingCoupon.setNew(false);
138 
139         return shoppingCouponPersistence.update(shoppingCoupon, 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 CounterService getCounterService() {
355         return counterService;
356     }
357 
358     public void setCounterService(CounterService counterService) {
359         this.counterService = counterService;
360     }
361 
362     public ResourceLocalService getResourceLocalService() {
363         return resourceLocalService;
364     }
365 
366     public void setResourceLocalService(
367         ResourceLocalService resourceLocalService) {
368         this.resourceLocalService = resourceLocalService;
369     }
370 
371     public ResourceService getResourceService() {
372         return resourceService;
373     }
374 
375     public void setResourceService(ResourceService resourceService) {
376         this.resourceService = resourceService;
377     }
378 
379     public ResourcePersistence getResourcePersistence() {
380         return resourcePersistence;
381     }
382 
383     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
384         this.resourcePersistence = resourcePersistence;
385     }
386 
387     public ResourceFinder getResourceFinder() {
388         return resourceFinder;
389     }
390 
391     public void setResourceFinder(ResourceFinder resourceFinder) {
392         this.resourceFinder = resourceFinder;
393     }
394 
395     public UserLocalService getUserLocalService() {
396         return userLocalService;
397     }
398 
399     public void setUserLocalService(UserLocalService userLocalService) {
400         this.userLocalService = userLocalService;
401     }
402 
403     public UserService getUserService() {
404         return userService;
405     }
406 
407     public void setUserService(UserService userService) {
408         this.userService = userService;
409     }
410 
411     public UserPersistence getUserPersistence() {
412         return userPersistence;
413     }
414 
415     public void setUserPersistence(UserPersistence userPersistence) {
416         this.userPersistence = userPersistence;
417     }
418 
419     public UserFinder getUserFinder() {
420         return userFinder;
421     }
422 
423     public void setUserFinder(UserFinder userFinder) {
424         this.userFinder = userFinder;
425     }
426 
427     protected void runSQL(String sql) throws SystemException {
428         try {
429             DB db = DBFactoryUtil.getDB();
430 
431             db.runSQL(sql);
432         }
433         catch (Exception e) {
434             throw new SystemException(e);
435         }
436     }
437 
438     @BeanReference(type = ShoppingCartLocalService.class)
439     protected ShoppingCartLocalService shoppingCartLocalService;
440     @BeanReference(type = ShoppingCartPersistence.class)
441     protected ShoppingCartPersistence shoppingCartPersistence;
442     @BeanReference(type = ShoppingCategoryLocalService.class)
443     protected ShoppingCategoryLocalService shoppingCategoryLocalService;
444     @BeanReference(type = ShoppingCategoryService.class)
445     protected ShoppingCategoryService shoppingCategoryService;
446     @BeanReference(type = ShoppingCategoryPersistence.class)
447     protected ShoppingCategoryPersistence shoppingCategoryPersistence;
448     @BeanReference(type = ShoppingCouponLocalService.class)
449     protected ShoppingCouponLocalService shoppingCouponLocalService;
450     @BeanReference(type = ShoppingCouponService.class)
451     protected ShoppingCouponService shoppingCouponService;
452     @BeanReference(type = ShoppingCouponPersistence.class)
453     protected ShoppingCouponPersistence shoppingCouponPersistence;
454     @BeanReference(type = ShoppingCouponFinder.class)
455     protected ShoppingCouponFinder shoppingCouponFinder;
456     @BeanReference(type = ShoppingItemLocalService.class)
457     protected ShoppingItemLocalService shoppingItemLocalService;
458     @BeanReference(type = ShoppingItemService.class)
459     protected ShoppingItemService shoppingItemService;
460     @BeanReference(type = ShoppingItemPersistence.class)
461     protected ShoppingItemPersistence shoppingItemPersistence;
462     @BeanReference(type = ShoppingItemFinder.class)
463     protected ShoppingItemFinder shoppingItemFinder;
464     @BeanReference(type = ShoppingItemFieldLocalService.class)
465     protected ShoppingItemFieldLocalService shoppingItemFieldLocalService;
466     @BeanReference(type = ShoppingItemFieldPersistence.class)
467     protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
468     @BeanReference(type = ShoppingItemPriceLocalService.class)
469     protected ShoppingItemPriceLocalService shoppingItemPriceLocalService;
470     @BeanReference(type = ShoppingItemPricePersistence.class)
471     protected ShoppingItemPricePersistence shoppingItemPricePersistence;
472     @BeanReference(type = ShoppingOrderLocalService.class)
473     protected ShoppingOrderLocalService shoppingOrderLocalService;
474     @BeanReference(type = ShoppingOrderService.class)
475     protected ShoppingOrderService shoppingOrderService;
476     @BeanReference(type = ShoppingOrderPersistence.class)
477     protected ShoppingOrderPersistence shoppingOrderPersistence;
478     @BeanReference(type = ShoppingOrderFinder.class)
479     protected ShoppingOrderFinder shoppingOrderFinder;
480     @BeanReference(type = ShoppingOrderItemLocalService.class)
481     protected ShoppingOrderItemLocalService shoppingOrderItemLocalService;
482     @BeanReference(type = ShoppingOrderItemPersistence.class)
483     protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
484     @BeanReference(type = CounterLocalService.class)
485     protected CounterLocalService counterLocalService;
486     @BeanReference(type = CounterService.class)
487     protected CounterService counterService;
488     @BeanReference(type = ResourceLocalService.class)
489     protected ResourceLocalService resourceLocalService;
490     @BeanReference(type = ResourceService.class)
491     protected ResourceService resourceService;
492     @BeanReference(type = ResourcePersistence.class)
493     protected ResourcePersistence resourcePersistence;
494     @BeanReference(type = ResourceFinder.class)
495     protected ResourceFinder resourceFinder;
496     @BeanReference(type = UserLocalService.class)
497     protected UserLocalService userLocalService;
498     @BeanReference(type = UserService.class)
499     protected UserService userService;
500     @BeanReference(type = UserPersistence.class)
501     protected UserPersistence userPersistence;
502     @BeanReference(type = UserFinder.class)
503     protected UserFinder userFinder;
504 }