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.ShoppingCoupon;
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="ShoppingCouponLocalServiceBaseImpl.java.html"><b><i>View Source</i>
64   * </b></a>
65   *
66   * @author Brian Wing Shun Chan
67   */
68  public abstract class ShoppingCouponLocalServiceBaseImpl
69      implements ShoppingCouponLocalService {
70      public ShoppingCoupon addShoppingCoupon(ShoppingCoupon shoppingCoupon)
71          throws SystemException {
72          shoppingCoupon.setNew(true);
73  
74          return shoppingCouponPersistence.update(shoppingCoupon, false);
75      }
76  
77      public ShoppingCoupon createShoppingCoupon(long couponId) {
78          return shoppingCouponPersistence.create(couponId);
79      }
80  
81      public void deleteShoppingCoupon(long couponId)
82          throws PortalException, SystemException {
83          shoppingCouponPersistence.remove(couponId);
84      }
85  
86      public void deleteShoppingCoupon(ShoppingCoupon shoppingCoupon)
87          throws SystemException {
88          shoppingCouponPersistence.remove(shoppingCoupon);
89      }
90  
91      public List<Object> dynamicQuery(DynamicQuery dynamicQuery)
92          throws SystemException {
93          return shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery);
94      }
95  
96      public List<Object> dynamicQuery(DynamicQuery dynamicQuery, int start,
97          int end) throws SystemException {
98          return shoppingCouponPersistence.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 shoppingCouponPersistence.findWithDynamicQuery(dynamicQuery,
105             start, end, orderByComparator);
106     }
107 
108     public int dynamicQueryCount(DynamicQuery dynamicQuery)
109         throws SystemException {
110         return shoppingCouponPersistence.countWithDynamicQuery(dynamicQuery);
111     }
112 
113     public ShoppingCoupon getShoppingCoupon(long couponId)
114         throws PortalException, SystemException {
115         return shoppingCouponPersistence.findByPrimaryKey(couponId);
116     }
117 
118     public List<ShoppingCoupon> getShoppingCoupons(int start, int end)
119         throws SystemException {
120         return shoppingCouponPersistence.findAll(start, end);
121     }
122 
123     public int getShoppingCouponsCount() throws SystemException {
124         return shoppingCouponPersistence.countAll();
125     }
126 
127     public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon)
128         throws SystemException {
129         shoppingCoupon.setNew(false);
130 
131         return shoppingCouponPersistence.update(shoppingCoupon, true);
132     }
133 
134     public ShoppingCoupon updateShoppingCoupon(ShoppingCoupon shoppingCoupon,
135         boolean merge) throws SystemException {
136         shoppingCoupon.setNew(false);
137 
138         return shoppingCouponPersistence.update(shoppingCoupon, merge);
139     }
140 
141     public ShoppingCartLocalService getShoppingCartLocalService() {
142         return shoppingCartLocalService;
143     }
144 
145     public void setShoppingCartLocalService(
146         ShoppingCartLocalService shoppingCartLocalService) {
147         this.shoppingCartLocalService = shoppingCartLocalService;
148     }
149 
150     public ShoppingCartPersistence getShoppingCartPersistence() {
151         return shoppingCartPersistence;
152     }
153 
154     public void setShoppingCartPersistence(
155         ShoppingCartPersistence shoppingCartPersistence) {
156         this.shoppingCartPersistence = shoppingCartPersistence;
157     }
158 
159     public ShoppingCategoryLocalService getShoppingCategoryLocalService() {
160         return shoppingCategoryLocalService;
161     }
162 
163     public void setShoppingCategoryLocalService(
164         ShoppingCategoryLocalService shoppingCategoryLocalService) {
165         this.shoppingCategoryLocalService = shoppingCategoryLocalService;
166     }
167 
168     public ShoppingCategoryService getShoppingCategoryService() {
169         return shoppingCategoryService;
170     }
171 
172     public void setShoppingCategoryService(
173         ShoppingCategoryService shoppingCategoryService) {
174         this.shoppingCategoryService = shoppingCategoryService;
175     }
176 
177     public ShoppingCategoryPersistence getShoppingCategoryPersistence() {
178         return shoppingCategoryPersistence;
179     }
180 
181     public void setShoppingCategoryPersistence(
182         ShoppingCategoryPersistence shoppingCategoryPersistence) {
183         this.shoppingCategoryPersistence = shoppingCategoryPersistence;
184     }
185 
186     public ShoppingCouponLocalService getShoppingCouponLocalService() {
187         return shoppingCouponLocalService;
188     }
189 
190     public void setShoppingCouponLocalService(
191         ShoppingCouponLocalService shoppingCouponLocalService) {
192         this.shoppingCouponLocalService = shoppingCouponLocalService;
193     }
194 
195     public ShoppingCouponService getShoppingCouponService() {
196         return shoppingCouponService;
197     }
198 
199     public void setShoppingCouponService(
200         ShoppingCouponService shoppingCouponService) {
201         this.shoppingCouponService = shoppingCouponService;
202     }
203 
204     public ShoppingCouponPersistence getShoppingCouponPersistence() {
205         return shoppingCouponPersistence;
206     }
207 
208     public void setShoppingCouponPersistence(
209         ShoppingCouponPersistence shoppingCouponPersistence) {
210         this.shoppingCouponPersistence = shoppingCouponPersistence;
211     }
212 
213     public ShoppingCouponFinder getShoppingCouponFinder() {
214         return shoppingCouponFinder;
215     }
216 
217     public void setShoppingCouponFinder(
218         ShoppingCouponFinder shoppingCouponFinder) {
219         this.shoppingCouponFinder = shoppingCouponFinder;
220     }
221 
222     public ShoppingItemLocalService getShoppingItemLocalService() {
223         return shoppingItemLocalService;
224     }
225 
226     public void setShoppingItemLocalService(
227         ShoppingItemLocalService shoppingItemLocalService) {
228         this.shoppingItemLocalService = shoppingItemLocalService;
229     }
230 
231     public ShoppingItemService getShoppingItemService() {
232         return shoppingItemService;
233     }
234 
235     public void setShoppingItemService(ShoppingItemService shoppingItemService) {
236         this.shoppingItemService = shoppingItemService;
237     }
238 
239     public ShoppingItemPersistence getShoppingItemPersistence() {
240         return shoppingItemPersistence;
241     }
242 
243     public void setShoppingItemPersistence(
244         ShoppingItemPersistence shoppingItemPersistence) {
245         this.shoppingItemPersistence = shoppingItemPersistence;
246     }
247 
248     public ShoppingItemFinder getShoppingItemFinder() {
249         return shoppingItemFinder;
250     }
251 
252     public void setShoppingItemFinder(ShoppingItemFinder shoppingItemFinder) {
253         this.shoppingItemFinder = shoppingItemFinder;
254     }
255 
256     public ShoppingItemFieldLocalService getShoppingItemFieldLocalService() {
257         return shoppingItemFieldLocalService;
258     }
259 
260     public void setShoppingItemFieldLocalService(
261         ShoppingItemFieldLocalService shoppingItemFieldLocalService) {
262         this.shoppingItemFieldLocalService = shoppingItemFieldLocalService;
263     }
264 
265     public ShoppingItemFieldPersistence getShoppingItemFieldPersistence() {
266         return shoppingItemFieldPersistence;
267     }
268 
269     public void setShoppingItemFieldPersistence(
270         ShoppingItemFieldPersistence shoppingItemFieldPersistence) {
271         this.shoppingItemFieldPersistence = shoppingItemFieldPersistence;
272     }
273 
274     public ShoppingItemPriceLocalService getShoppingItemPriceLocalService() {
275         return shoppingItemPriceLocalService;
276     }
277 
278     public void setShoppingItemPriceLocalService(
279         ShoppingItemPriceLocalService shoppingItemPriceLocalService) {
280         this.shoppingItemPriceLocalService = shoppingItemPriceLocalService;
281     }
282 
283     public ShoppingItemPricePersistence getShoppingItemPricePersistence() {
284         return shoppingItemPricePersistence;
285     }
286 
287     public void setShoppingItemPricePersistence(
288         ShoppingItemPricePersistence shoppingItemPricePersistence) {
289         this.shoppingItemPricePersistence = shoppingItemPricePersistence;
290     }
291 
292     public ShoppingOrderLocalService getShoppingOrderLocalService() {
293         return shoppingOrderLocalService;
294     }
295 
296     public void setShoppingOrderLocalService(
297         ShoppingOrderLocalService shoppingOrderLocalService) {
298         this.shoppingOrderLocalService = shoppingOrderLocalService;
299     }
300 
301     public ShoppingOrderService getShoppingOrderService() {
302         return shoppingOrderService;
303     }
304 
305     public void setShoppingOrderService(
306         ShoppingOrderService shoppingOrderService) {
307         this.shoppingOrderService = shoppingOrderService;
308     }
309 
310     public ShoppingOrderPersistence getShoppingOrderPersistence() {
311         return shoppingOrderPersistence;
312     }
313 
314     public void setShoppingOrderPersistence(
315         ShoppingOrderPersistence shoppingOrderPersistence) {
316         this.shoppingOrderPersistence = shoppingOrderPersistence;
317     }
318 
319     public ShoppingOrderFinder getShoppingOrderFinder() {
320         return shoppingOrderFinder;
321     }
322 
323     public void setShoppingOrderFinder(ShoppingOrderFinder shoppingOrderFinder) {
324         this.shoppingOrderFinder = shoppingOrderFinder;
325     }
326 
327     public ShoppingOrderItemLocalService getShoppingOrderItemLocalService() {
328         return shoppingOrderItemLocalService;
329     }
330 
331     public void setShoppingOrderItemLocalService(
332         ShoppingOrderItemLocalService shoppingOrderItemLocalService) {
333         this.shoppingOrderItemLocalService = shoppingOrderItemLocalService;
334     }
335 
336     public ShoppingOrderItemPersistence getShoppingOrderItemPersistence() {
337         return shoppingOrderItemPersistence;
338     }
339 
340     public void setShoppingOrderItemPersistence(
341         ShoppingOrderItemPersistence shoppingOrderItemPersistence) {
342         this.shoppingOrderItemPersistence = shoppingOrderItemPersistence;
343     }
344 
345     public CounterLocalService getCounterLocalService() {
346         return counterLocalService;
347     }
348 
349     public void setCounterLocalService(CounterLocalService counterLocalService) {
350         this.counterLocalService = counterLocalService;
351     }
352 
353     public ResourceLocalService getResourceLocalService() {
354         return resourceLocalService;
355     }
356 
357     public void setResourceLocalService(
358         ResourceLocalService resourceLocalService) {
359         this.resourceLocalService = resourceLocalService;
360     }
361 
362     public ResourceService getResourceService() {
363         return resourceService;
364     }
365 
366     public void setResourceService(ResourceService resourceService) {
367         this.resourceService = resourceService;
368     }
369 
370     public ResourcePersistence getResourcePersistence() {
371         return resourcePersistence;
372     }
373 
374     public void setResourcePersistence(ResourcePersistence resourcePersistence) {
375         this.resourcePersistence = resourcePersistence;
376     }
377 
378     public ResourceFinder getResourceFinder() {
379         return resourceFinder;
380     }
381 
382     public void setResourceFinder(ResourceFinder resourceFinder) {
383         this.resourceFinder = resourceFinder;
384     }
385 
386     public UserLocalService getUserLocalService() {
387         return userLocalService;
388     }
389 
390     public void setUserLocalService(UserLocalService userLocalService) {
391         this.userLocalService = userLocalService;
392     }
393 
394     public UserService getUserService() {
395         return userService;
396     }
397 
398     public void setUserService(UserService userService) {
399         this.userService = userService;
400     }
401 
402     public UserPersistence getUserPersistence() {
403         return userPersistence;
404     }
405 
406     public void setUserPersistence(UserPersistence userPersistence) {
407         this.userPersistence = userPersistence;
408     }
409 
410     public UserFinder getUserFinder() {
411         return userFinder;
412     }
413 
414     public void setUserFinder(UserFinder userFinder) {
415         this.userFinder = userFinder;
416     }
417 
418     protected void runSQL(String sql) throws SystemException {
419         try {
420             DB db = DBFactoryUtil.getDB();
421 
422             db.runSQL(sql);
423         }
424         catch (Exception e) {
425             throw new SystemException(e);
426         }
427     }
428 
429     @BeanReference(type = ShoppingCartLocalService.class)
430     protected ShoppingCartLocalService shoppingCartLocalService;
431     @BeanReference(type = ShoppingCartPersistence.class)
432     protected ShoppingCartPersistence shoppingCartPersistence;
433     @BeanReference(type = ShoppingCategoryLocalService.class)
434     protected ShoppingCategoryLocalService shoppingCategoryLocalService;
435     @BeanReference(type = ShoppingCategoryService.class)
436     protected ShoppingCategoryService shoppingCategoryService;
437     @BeanReference(type = ShoppingCategoryPersistence.class)
438     protected ShoppingCategoryPersistence shoppingCategoryPersistence;
439     @BeanReference(type = ShoppingCouponLocalService.class)
440     protected ShoppingCouponLocalService shoppingCouponLocalService;
441     @BeanReference(type = ShoppingCouponService.class)
442     protected ShoppingCouponService shoppingCouponService;
443     @BeanReference(type = ShoppingCouponPersistence.class)
444     protected ShoppingCouponPersistence shoppingCouponPersistence;
445     @BeanReference(type = ShoppingCouponFinder.class)
446     protected ShoppingCouponFinder shoppingCouponFinder;
447     @BeanReference(type = ShoppingItemLocalService.class)
448     protected ShoppingItemLocalService shoppingItemLocalService;
449     @BeanReference(type = ShoppingItemService.class)
450     protected ShoppingItemService shoppingItemService;
451     @BeanReference(type = ShoppingItemPersistence.class)
452     protected ShoppingItemPersistence shoppingItemPersistence;
453     @BeanReference(type = ShoppingItemFinder.class)
454     protected ShoppingItemFinder shoppingItemFinder;
455     @BeanReference(type = ShoppingItemFieldLocalService.class)
456     protected ShoppingItemFieldLocalService shoppingItemFieldLocalService;
457     @BeanReference(type = ShoppingItemFieldPersistence.class)
458     protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
459     @BeanReference(type = ShoppingItemPriceLocalService.class)
460     protected ShoppingItemPriceLocalService shoppingItemPriceLocalService;
461     @BeanReference(type = ShoppingItemPricePersistence.class)
462     protected ShoppingItemPricePersistence shoppingItemPricePersistence;
463     @BeanReference(type = ShoppingOrderLocalService.class)
464     protected ShoppingOrderLocalService shoppingOrderLocalService;
465     @BeanReference(type = ShoppingOrderService.class)
466     protected ShoppingOrderService shoppingOrderService;
467     @BeanReference(type = ShoppingOrderPersistence.class)
468     protected ShoppingOrderPersistence shoppingOrderPersistence;
469     @BeanReference(type = ShoppingOrderFinder.class)
470     protected ShoppingOrderFinder shoppingOrderFinder;
471     @BeanReference(type = ShoppingOrderItemLocalService.class)
472     protected ShoppingOrderItemLocalService shoppingOrderItemLocalService;
473     @BeanReference(type = ShoppingOrderItemPersistence.class)
474     protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
475     @BeanReference(type = CounterLocalService.class)
476     protected CounterLocalService counterLocalService;
477     @BeanReference(type = ResourceLocalService.class)
478     protected ResourceLocalService resourceLocalService;
479     @BeanReference(type = ResourceService.class)
480     protected ResourceService resourceService;
481     @BeanReference(type = ResourcePersistence.class)
482     protected ResourcePersistence resourcePersistence;
483     @BeanReference(type = ResourceFinder.class)
484     protected ResourceFinder resourceFinder;
485     @BeanReference(type = UserLocalService.class)
486     protected UserLocalService userLocalService;
487     @BeanReference(type = UserService.class)
488     protected UserService userService;
489     @BeanReference(type = UserPersistence.class)
490     protected UserPersistence userPersistence;
491     @BeanReference(type = UserFinder.class)
492     protected UserFinder userFinder;
493 }