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.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19  import com.liferay.portal.kernel.exception.SystemException;
20  
21  import com.liferay.portlet.shopping.model.ShoppingCart;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="ShoppingCartUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       ShoppingCartPersistence
35   * @see       ShoppingCartPersistenceImpl
36   * @generated
37   */
38  public class ShoppingCartUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
48       */
49      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
50          throws SystemException {
51          return getPersistence().findWithDynamicQuery(dynamicQuery);
52      }
53  
54      /**
55       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
56       */
57      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
58          int start, int end) throws SystemException {
59          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
60      }
61  
62      /**
63       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
64       */
65      public static ShoppingCart remove(ShoppingCart shoppingCart)
66          throws SystemException {
67          return getPersistence().remove(shoppingCart);
68      }
69  
70      /**
71       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
72       */
73      public static ShoppingCart update(ShoppingCart shoppingCart, boolean merge)
74          throws SystemException {
75          return getPersistence().update(shoppingCart, merge);
76      }
77  
78      public static void cacheResult(
79          com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) {
80          getPersistence().cacheResult(shoppingCart);
81      }
82  
83      public static void cacheResult(
84          java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts) {
85          getPersistence().cacheResult(shoppingCarts);
86      }
87  
88      public static com.liferay.portlet.shopping.model.ShoppingCart create(
89          long cartId) {
90          return getPersistence().create(cartId);
91      }
92  
93      public static com.liferay.portlet.shopping.model.ShoppingCart remove(
94          long cartId)
95          throws com.liferay.portal.kernel.exception.SystemException,
96              com.liferay.portlet.shopping.NoSuchCartException {
97          return getPersistence().remove(cartId);
98      }
99  
100     public static com.liferay.portlet.shopping.model.ShoppingCart updateImpl(
101         com.liferay.portlet.shopping.model.ShoppingCart shoppingCart,
102         boolean merge)
103         throws com.liferay.portal.kernel.exception.SystemException {
104         return getPersistence().updateImpl(shoppingCart, merge);
105     }
106 
107     public static com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey(
108         long cartId)
109         throws com.liferay.portal.kernel.exception.SystemException,
110             com.liferay.portlet.shopping.NoSuchCartException {
111         return getPersistence().findByPrimaryKey(cartId);
112     }
113 
114     public static com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey(
115         long cartId) throws com.liferay.portal.kernel.exception.SystemException {
116         return getPersistence().fetchByPrimaryKey(cartId);
117     }
118 
119     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
120         long groupId)
121         throws com.liferay.portal.kernel.exception.SystemException {
122         return getPersistence().findByGroupId(groupId);
123     }
124 
125     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
126         long groupId, int start, int end)
127         throws com.liferay.portal.kernel.exception.SystemException {
128         return getPersistence().findByGroupId(groupId, start, end);
129     }
130 
131     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
132         long groupId, int start, int end,
133         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
134         throws com.liferay.portal.kernel.exception.SystemException {
135         return getPersistence()
136                    .findByGroupId(groupId, start, end, orderByComparator);
137     }
138 
139     public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First(
140         long groupId,
141         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
142         throws com.liferay.portal.kernel.exception.SystemException,
143             com.liferay.portlet.shopping.NoSuchCartException {
144         return getPersistence().findByGroupId_First(groupId, orderByComparator);
145     }
146 
147     public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last(
148         long groupId,
149         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
150         throws com.liferay.portal.kernel.exception.SystemException,
151             com.liferay.portlet.shopping.NoSuchCartException {
152         return getPersistence().findByGroupId_Last(groupId, orderByComparator);
153     }
154 
155     public static com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext(
156         long cartId, long groupId,
157         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
158         throws com.liferay.portal.kernel.exception.SystemException,
159             com.liferay.portlet.shopping.NoSuchCartException {
160         return getPersistence()
161                    .findByGroupId_PrevAndNext(cartId, groupId, orderByComparator);
162     }
163 
164     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
165         long userId) throws com.liferay.portal.kernel.exception.SystemException {
166         return getPersistence().findByUserId(userId);
167     }
168 
169     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
170         long userId, int start, int end)
171         throws com.liferay.portal.kernel.exception.SystemException {
172         return getPersistence().findByUserId(userId, start, end);
173     }
174 
175     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
176         long userId, int start, int end,
177         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
178         throws com.liferay.portal.kernel.exception.SystemException {
179         return getPersistence()
180                    .findByUserId(userId, start, end, orderByComparator);
181     }
182 
183     public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First(
184         long userId,
185         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
186         throws com.liferay.portal.kernel.exception.SystemException,
187             com.liferay.portlet.shopping.NoSuchCartException {
188         return getPersistence().findByUserId_First(userId, orderByComparator);
189     }
190 
191     public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last(
192         long userId,
193         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
194         throws com.liferay.portal.kernel.exception.SystemException,
195             com.liferay.portlet.shopping.NoSuchCartException {
196         return getPersistence().findByUserId_Last(userId, orderByComparator);
197     }
198 
199     public static com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext(
200         long cartId, long userId,
201         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
202         throws com.liferay.portal.kernel.exception.SystemException,
203             com.liferay.portlet.shopping.NoSuchCartException {
204         return getPersistence()
205                    .findByUserId_PrevAndNext(cartId, userId, orderByComparator);
206     }
207 
208     public static com.liferay.portlet.shopping.model.ShoppingCart findByG_U(
209         long groupId, long userId)
210         throws com.liferay.portal.kernel.exception.SystemException,
211             com.liferay.portlet.shopping.NoSuchCartException {
212         return getPersistence().findByG_U(groupId, userId);
213     }
214 
215     public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
216         long groupId, long userId)
217         throws com.liferay.portal.kernel.exception.SystemException {
218         return getPersistence().fetchByG_U(groupId, userId);
219     }
220 
221     public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
222         long groupId, long userId, boolean retrieveFromCache)
223         throws com.liferay.portal.kernel.exception.SystemException {
224         return getPersistence().fetchByG_U(groupId, userId, retrieveFromCache);
225     }
226 
227     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll()
228         throws com.liferay.portal.kernel.exception.SystemException {
229         return getPersistence().findAll();
230     }
231 
232     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
233         int start, int end)
234         throws com.liferay.portal.kernel.exception.SystemException {
235         return getPersistence().findAll(start, end);
236     }
237 
238     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
239         int start, int end,
240         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
241         throws com.liferay.portal.kernel.exception.SystemException {
242         return getPersistence().findAll(start, end, orderByComparator);
243     }
244 
245     public static void removeByGroupId(long groupId)
246         throws com.liferay.portal.kernel.exception.SystemException {
247         getPersistence().removeByGroupId(groupId);
248     }
249 
250     public static void removeByUserId(long userId)
251         throws com.liferay.portal.kernel.exception.SystemException {
252         getPersistence().removeByUserId(userId);
253     }
254 
255     public static void removeByG_U(long groupId, long userId)
256         throws com.liferay.portal.kernel.exception.SystemException,
257             com.liferay.portlet.shopping.NoSuchCartException {
258         getPersistence().removeByG_U(groupId, userId);
259     }
260 
261     public static void removeAll()
262         throws com.liferay.portal.kernel.exception.SystemException {
263         getPersistence().removeAll();
264     }
265 
266     public static int countByGroupId(long groupId)
267         throws com.liferay.portal.kernel.exception.SystemException {
268         return getPersistence().countByGroupId(groupId);
269     }
270 
271     public static int countByUserId(long userId)
272         throws com.liferay.portal.kernel.exception.SystemException {
273         return getPersistence().countByUserId(userId);
274     }
275 
276     public static int countByG_U(long groupId, long userId)
277         throws com.liferay.portal.kernel.exception.SystemException {
278         return getPersistence().countByG_U(groupId, userId);
279     }
280 
281     public static int countAll()
282         throws com.liferay.portal.kernel.exception.SystemException {
283         return getPersistence().countAll();
284     }
285 
286     public static ShoppingCartPersistence getPersistence() {
287         if (_persistence == null) {
288             _persistence = (ShoppingCartPersistence)PortalBeanLocatorUtil.locate(ShoppingCartPersistence.class.getName());
289         }
290 
291         return _persistence;
292     }
293 
294     public void setPersistence(ShoppingCartPersistence persistence) {
295         _persistence = persistence;
296     }
297 
298     private static ShoppingCartPersistence _persistence;
299 }