001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import com.liferay.portlet.shopping.model.ShoppingCart;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the shopping cart service. This utility wraps {@link ShoppingCartPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see ShoppingCartPersistence
037     * @see ShoppingCartPersistenceImpl
038     * @generated
039     */
040    public class ShoppingCartUtil {
041            /*
042             * NOTE FOR DEVELOPERS:
043             *
044             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
045             */
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
049             */
050            public static void clearCache() {
051                    getPersistence().clearCache();
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
056             */
057            public static void clearCache(ShoppingCart shoppingCart) {
058                    getPersistence().clearCache(shoppingCart);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
063             */
064            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<ShoppingCart> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) throws SystemException {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<ShoppingCart> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end)
082                    throws SystemException {
083                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
084            }
085    
086            /**
087             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
088             */
089            public static List<ShoppingCart> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator orderByComparator) throws SystemException {
092                    return getPersistence()
093                                       .findWithDynamicQuery(dynamicQuery, start, end,
094                            orderByComparator);
095            }
096    
097            /**
098             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
099             */
100            public static ShoppingCart update(ShoppingCart shoppingCart, boolean merge)
101                    throws SystemException {
102                    return getPersistence().update(shoppingCart, merge);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
107             */
108            public static ShoppingCart update(ShoppingCart shoppingCart, boolean merge,
109                    ServiceContext serviceContext) throws SystemException {
110                    return getPersistence().update(shoppingCart, merge, serviceContext);
111            }
112    
113            /**
114            * Caches the shopping cart in the entity cache if it is enabled.
115            *
116            * @param shoppingCart the shopping cart
117            */
118            public static void cacheResult(
119                    com.liferay.portlet.shopping.model.ShoppingCart shoppingCart) {
120                    getPersistence().cacheResult(shoppingCart);
121            }
122    
123            /**
124            * Caches the shopping carts in the entity cache if it is enabled.
125            *
126            * @param shoppingCarts the shopping carts
127            */
128            public static void cacheResult(
129                    java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts) {
130                    getPersistence().cacheResult(shoppingCarts);
131            }
132    
133            /**
134            * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database.
135            *
136            * @param cartId the primary key for the new shopping cart
137            * @return the new shopping cart
138            */
139            public static com.liferay.portlet.shopping.model.ShoppingCart create(
140                    long cartId) {
141                    return getPersistence().create(cartId);
142            }
143    
144            /**
145            * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners.
146            *
147            * @param cartId the primary key of the shopping cart
148            * @return the shopping cart that was removed
149            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
150            * @throws SystemException if a system exception occurred
151            */
152            public static com.liferay.portlet.shopping.model.ShoppingCart remove(
153                    long cartId)
154                    throws com.liferay.portal.kernel.exception.SystemException,
155                            com.liferay.portlet.shopping.NoSuchCartException {
156                    return getPersistence().remove(cartId);
157            }
158    
159            public static com.liferay.portlet.shopping.model.ShoppingCart updateImpl(
160                    com.liferay.portlet.shopping.model.ShoppingCart shoppingCart,
161                    boolean merge)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence().updateImpl(shoppingCart, merge);
164            }
165    
166            /**
167            * Returns the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found.
168            *
169            * @param cartId the primary key of the shopping cart
170            * @return the shopping cart
171            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public static com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey(
175                    long cartId)
176                    throws com.liferay.portal.kernel.exception.SystemException,
177                            com.liferay.portlet.shopping.NoSuchCartException {
178                    return getPersistence().findByPrimaryKey(cartId);
179            }
180    
181            /**
182            * Returns the shopping cart with the primary key or returns <code>null</code> if it could not be found.
183            *
184            * @param cartId the primary key of the shopping cart
185            * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found
186            * @throws SystemException if a system exception occurred
187            */
188            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey(
189                    long cartId) throws com.liferay.portal.kernel.exception.SystemException {
190                    return getPersistence().fetchByPrimaryKey(cartId);
191            }
192    
193            /**
194            * Returns all the shopping carts where groupId = &#63;.
195            *
196            * @param groupId the group ID
197            * @return the matching shopping carts
198            * @throws SystemException if a system exception occurred
199            */
200            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
201                    long groupId)
202                    throws com.liferay.portal.kernel.exception.SystemException {
203                    return getPersistence().findByGroupId(groupId);
204            }
205    
206            /**
207            * Returns a range of all the shopping carts where groupId = &#63;.
208            *
209            * <p>
210            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
211            * </p>
212            *
213            * @param groupId the group ID
214            * @param start the lower bound of the range of shopping carts
215            * @param end the upper bound of the range of shopping carts (not inclusive)
216            * @return the range of matching shopping carts
217            * @throws SystemException if a system exception occurred
218            */
219            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
220                    long groupId, int start, int end)
221                    throws com.liferay.portal.kernel.exception.SystemException {
222                    return getPersistence().findByGroupId(groupId, start, end);
223            }
224    
225            /**
226            * Returns an ordered range of all the shopping carts where groupId = &#63;.
227            *
228            * <p>
229            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
230            * </p>
231            *
232            * @param groupId the group ID
233            * @param start the lower bound of the range of shopping carts
234            * @param end the upper bound of the range of shopping carts (not inclusive)
235            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
236            * @return the ordered range of matching shopping carts
237            * @throws SystemException if a system exception occurred
238            */
239            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
240                    long groupId, int start, int end,
241                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
242                    throws com.liferay.portal.kernel.exception.SystemException {
243                    return getPersistence()
244                                       .findByGroupId(groupId, start, end, orderByComparator);
245            }
246    
247            /**
248            * Returns the first shopping cart in the ordered set where groupId = &#63;.
249            *
250            * <p>
251            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
252            * </p>
253            *
254            * @param groupId the group ID
255            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
256            * @return the first matching shopping cart
257            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
258            * @throws SystemException if a system exception occurred
259            */
260            public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First(
261                    long groupId,
262                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
263                    throws com.liferay.portal.kernel.exception.SystemException,
264                            com.liferay.portlet.shopping.NoSuchCartException {
265                    return getPersistence().findByGroupId_First(groupId, orderByComparator);
266            }
267    
268            /**
269            * Returns the last shopping cart in the ordered set where groupId = &#63;.
270            *
271            * <p>
272            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
273            * </p>
274            *
275            * @param groupId the group ID
276            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
277            * @return the last matching shopping cart
278            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
279            * @throws SystemException if a system exception occurred
280            */
281            public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last(
282                    long groupId,
283                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
284                    throws com.liferay.portal.kernel.exception.SystemException,
285                            com.liferay.portlet.shopping.NoSuchCartException {
286                    return getPersistence().findByGroupId_Last(groupId, orderByComparator);
287            }
288    
289            /**
290            * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = &#63;.
291            *
292            * <p>
293            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
294            * </p>
295            *
296            * @param cartId the primary key of the current shopping cart
297            * @param groupId the group ID
298            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
299            * @return the previous, current, and next shopping cart
300            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
301            * @throws SystemException if a system exception occurred
302            */
303            public static com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext(
304                    long cartId, long groupId,
305                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
306                    throws com.liferay.portal.kernel.exception.SystemException,
307                            com.liferay.portlet.shopping.NoSuchCartException {
308                    return getPersistence()
309                                       .findByGroupId_PrevAndNext(cartId, groupId, orderByComparator);
310            }
311    
312            /**
313            * Returns all the shopping carts where userId = &#63;.
314            *
315            * @param userId the user ID
316            * @return the matching shopping carts
317            * @throws SystemException if a system exception occurred
318            */
319            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
320                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
321                    return getPersistence().findByUserId(userId);
322            }
323    
324            /**
325            * Returns a range of all the shopping carts where userId = &#63;.
326            *
327            * <p>
328            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
329            * </p>
330            *
331            * @param userId the user ID
332            * @param start the lower bound of the range of shopping carts
333            * @param end the upper bound of the range of shopping carts (not inclusive)
334            * @return the range of matching shopping carts
335            * @throws SystemException if a system exception occurred
336            */
337            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
338                    long userId, int start, int end)
339                    throws com.liferay.portal.kernel.exception.SystemException {
340                    return getPersistence().findByUserId(userId, start, end);
341            }
342    
343            /**
344            * Returns an ordered range of all the shopping carts where userId = &#63;.
345            *
346            * <p>
347            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
348            * </p>
349            *
350            * @param userId the user ID
351            * @param start the lower bound of the range of shopping carts
352            * @param end the upper bound of the range of shopping carts (not inclusive)
353            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
354            * @return the ordered range of matching shopping carts
355            * @throws SystemException if a system exception occurred
356            */
357            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
358                    long userId, int start, int end,
359                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
360                    throws com.liferay.portal.kernel.exception.SystemException {
361                    return getPersistence()
362                                       .findByUserId(userId, start, end, orderByComparator);
363            }
364    
365            /**
366            * Returns the first shopping cart in the ordered set where userId = &#63;.
367            *
368            * <p>
369            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
370            * </p>
371            *
372            * @param userId the user ID
373            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
374            * @return the first matching shopping cart
375            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
376            * @throws SystemException if a system exception occurred
377            */
378            public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First(
379                    long userId,
380                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
381                    throws com.liferay.portal.kernel.exception.SystemException,
382                            com.liferay.portlet.shopping.NoSuchCartException {
383                    return getPersistence().findByUserId_First(userId, orderByComparator);
384            }
385    
386            /**
387            * Returns the last shopping cart in the ordered set where userId = &#63;.
388            *
389            * <p>
390            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
391            * </p>
392            *
393            * @param userId the user ID
394            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
395            * @return the last matching shopping cart
396            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
397            * @throws SystemException if a system exception occurred
398            */
399            public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last(
400                    long userId,
401                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
402                    throws com.liferay.portal.kernel.exception.SystemException,
403                            com.liferay.portlet.shopping.NoSuchCartException {
404                    return getPersistence().findByUserId_Last(userId, orderByComparator);
405            }
406    
407            /**
408            * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = &#63;.
409            *
410            * <p>
411            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
412            * </p>
413            *
414            * @param cartId the primary key of the current shopping cart
415            * @param userId the user ID
416            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
417            * @return the previous, current, and next shopping cart
418            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
419            * @throws SystemException if a system exception occurred
420            */
421            public static com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext(
422                    long cartId, long userId,
423                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
424                    throws com.liferay.portal.kernel.exception.SystemException,
425                            com.liferay.portlet.shopping.NoSuchCartException {
426                    return getPersistence()
427                                       .findByUserId_PrevAndNext(cartId, userId, orderByComparator);
428            }
429    
430            /**
431            * Returns the shopping cart where groupId = &#63; and userId = &#63; or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found.
432            *
433            * @param groupId the group ID
434            * @param userId the user ID
435            * @return the matching shopping cart
436            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
437            * @throws SystemException if a system exception occurred
438            */
439            public static com.liferay.portlet.shopping.model.ShoppingCart findByG_U(
440                    long groupId, long userId)
441                    throws com.liferay.portal.kernel.exception.SystemException,
442                            com.liferay.portlet.shopping.NoSuchCartException {
443                    return getPersistence().findByG_U(groupId, userId);
444            }
445    
446            /**
447            * Returns the shopping cart where groupId = &#63; and userId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
448            *
449            * @param groupId the group ID
450            * @param userId the user ID
451            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
452            * @throws SystemException if a system exception occurred
453            */
454            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
455                    long groupId, long userId)
456                    throws com.liferay.portal.kernel.exception.SystemException {
457                    return getPersistence().fetchByG_U(groupId, userId);
458            }
459    
460            /**
461            * Returns the shopping cart where groupId = &#63; and userId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
462            *
463            * @param groupId the group ID
464            * @param userId the user ID
465            * @param retrieveFromCache whether to use the finder cache
466            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
467            * @throws SystemException if a system exception occurred
468            */
469            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
470                    long groupId, long userId, boolean retrieveFromCache)
471                    throws com.liferay.portal.kernel.exception.SystemException {
472                    return getPersistence().fetchByG_U(groupId, userId, retrieveFromCache);
473            }
474    
475            /**
476            * Returns all the shopping carts.
477            *
478            * @return the shopping carts
479            * @throws SystemException if a system exception occurred
480            */
481            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll()
482                    throws com.liferay.portal.kernel.exception.SystemException {
483                    return getPersistence().findAll();
484            }
485    
486            /**
487            * Returns a range of all the shopping carts.
488            *
489            * <p>
490            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
491            * </p>
492            *
493            * @param start the lower bound of the range of shopping carts
494            * @param end the upper bound of the range of shopping carts (not inclusive)
495            * @return the range of shopping carts
496            * @throws SystemException if a system exception occurred
497            */
498            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
499                    int start, int end)
500                    throws com.liferay.portal.kernel.exception.SystemException {
501                    return getPersistence().findAll(start, end);
502            }
503    
504            /**
505            * Returns an ordered range of all the shopping carts.
506            *
507            * <p>
508            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
509            * </p>
510            *
511            * @param start the lower bound of the range of shopping carts
512            * @param end the upper bound of the range of shopping carts (not inclusive)
513            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
514            * @return the ordered range of shopping carts
515            * @throws SystemException if a system exception occurred
516            */
517            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
518                    int start, int end,
519                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
520                    throws com.liferay.portal.kernel.exception.SystemException {
521                    return getPersistence().findAll(start, end, orderByComparator);
522            }
523    
524            /**
525            * Removes all the shopping carts where groupId = &#63; from the database.
526            *
527            * @param groupId the group ID
528            * @throws SystemException if a system exception occurred
529            */
530            public static void removeByGroupId(long groupId)
531                    throws com.liferay.portal.kernel.exception.SystemException {
532                    getPersistence().removeByGroupId(groupId);
533            }
534    
535            /**
536            * Removes all the shopping carts where userId = &#63; from the database.
537            *
538            * @param userId the user ID
539            * @throws SystemException if a system exception occurred
540            */
541            public static void removeByUserId(long userId)
542                    throws com.liferay.portal.kernel.exception.SystemException {
543                    getPersistence().removeByUserId(userId);
544            }
545    
546            /**
547            * Removes the shopping cart where groupId = &#63; and userId = &#63; from the database.
548            *
549            * @param groupId the group ID
550            * @param userId the user ID
551            * @throws SystemException if a system exception occurred
552            */
553            public static void removeByG_U(long groupId, long userId)
554                    throws com.liferay.portal.kernel.exception.SystemException,
555                            com.liferay.portlet.shopping.NoSuchCartException {
556                    getPersistence().removeByG_U(groupId, userId);
557            }
558    
559            /**
560            * Removes all the shopping carts from the database.
561            *
562            * @throws SystemException if a system exception occurred
563            */
564            public static void removeAll()
565                    throws com.liferay.portal.kernel.exception.SystemException {
566                    getPersistence().removeAll();
567            }
568    
569            /**
570            * Returns the number of shopping carts where groupId = &#63;.
571            *
572            * @param groupId the group ID
573            * @return the number of matching shopping carts
574            * @throws SystemException if a system exception occurred
575            */
576            public static int countByGroupId(long groupId)
577                    throws com.liferay.portal.kernel.exception.SystemException {
578                    return getPersistence().countByGroupId(groupId);
579            }
580    
581            /**
582            * Returns the number of shopping carts where userId = &#63;.
583            *
584            * @param userId the user ID
585            * @return the number of matching shopping carts
586            * @throws SystemException if a system exception occurred
587            */
588            public static int countByUserId(long userId)
589                    throws com.liferay.portal.kernel.exception.SystemException {
590                    return getPersistence().countByUserId(userId);
591            }
592    
593            /**
594            * Returns the number of shopping carts where groupId = &#63; and userId = &#63;.
595            *
596            * @param groupId the group ID
597            * @param userId the user ID
598            * @return the number of matching shopping carts
599            * @throws SystemException if a system exception occurred
600            */
601            public static int countByG_U(long groupId, long userId)
602                    throws com.liferay.portal.kernel.exception.SystemException {
603                    return getPersistence().countByG_U(groupId, userId);
604            }
605    
606            /**
607            * Returns the number of shopping carts.
608            *
609            * @return the number of shopping carts
610            * @throws SystemException if a system exception occurred
611            */
612            public static int countAll()
613                    throws com.liferay.portal.kernel.exception.SystemException {
614                    return getPersistence().countAll();
615            }
616    
617            public static ShoppingCartPersistence getPersistence() {
618                    if (_persistence == null) {
619                            _persistence = (ShoppingCartPersistence)PortalBeanLocatorUtil.locate(ShoppingCartPersistence.class.getName());
620    
621                            ReferenceRegistry.registerReference(ShoppingCartUtil.class,
622                                    "_persistence");
623                    }
624    
625                    return _persistence;
626            }
627    
628            public void setPersistence(ShoppingCartPersistence persistence) {
629                    _persistence = persistence;
630    
631                    ReferenceRegistry.registerReference(ShoppingCartUtil.class,
632                            "_persistence");
633            }
634    
635            private static ShoppingCartPersistence _persistence;
636    }