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