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