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