001    /**
002     * Copyright (c) 2000-2013 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            * @param groupId the group ID
251            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
252            * @return the first matching shopping cart
253            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
254            * @throws SystemException if a system exception occurred
255            */
256            public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First(
257                    long groupId,
258                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
259                    throws com.liferay.portal.kernel.exception.SystemException,
260                            com.liferay.portlet.shopping.NoSuchCartException {
261                    return getPersistence().findByGroupId_First(groupId, orderByComparator);
262            }
263    
264            /**
265            * Returns the first shopping cart in the ordered set where groupId = &#63;.
266            *
267            * @param groupId the group ID
268            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
269            * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
270            * @throws SystemException if a system exception occurred
271            */
272            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_First(
273                    long groupId,
274                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
275                    throws com.liferay.portal.kernel.exception.SystemException {
276                    return getPersistence().fetchByGroupId_First(groupId, orderByComparator);
277            }
278    
279            /**
280            * Returns the last shopping cart in the ordered set where groupId = &#63;.
281            *
282            * @param groupId the group ID
283            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
284            * @return the last matching shopping cart
285            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
286            * @throws SystemException if a system exception occurred
287            */
288            public static com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last(
289                    long groupId,
290                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
291                    throws com.liferay.portal.kernel.exception.SystemException,
292                            com.liferay.portlet.shopping.NoSuchCartException {
293                    return getPersistence().findByGroupId_Last(groupId, orderByComparator);
294            }
295    
296            /**
297            * Returns the last shopping cart in the ordered set where groupId = &#63;.
298            *
299            * @param groupId the group ID
300            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
301            * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
302            * @throws SystemException if a system exception occurred
303            */
304            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_Last(
305                    long groupId,
306                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
307                    throws com.liferay.portal.kernel.exception.SystemException {
308                    return getPersistence().fetchByGroupId_Last(groupId, orderByComparator);
309            }
310    
311            /**
312            * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = &#63;.
313            *
314            * @param cartId the primary key of the current shopping cart
315            * @param groupId the group ID
316            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
317            * @return the previous, current, and next shopping cart
318            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
319            * @throws SystemException if a system exception occurred
320            */
321            public static com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext(
322                    long cartId, long groupId,
323                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
324                    throws com.liferay.portal.kernel.exception.SystemException,
325                            com.liferay.portlet.shopping.NoSuchCartException {
326                    return getPersistence()
327                                       .findByGroupId_PrevAndNext(cartId, groupId, orderByComparator);
328            }
329    
330            /**
331            * Returns all the shopping carts where userId = &#63;.
332            *
333            * @param userId the user ID
334            * @return the 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) throws com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().findByUserId(userId);
340            }
341    
342            /**
343            * Returns a range of all the shopping carts where userId = &#63;.
344            *
345            * <p>
346            * 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.
347            * </p>
348            *
349            * @param userId the user ID
350            * @param start the lower bound of the range of shopping carts
351            * @param end the upper bound of the range of shopping carts (not inclusive)
352            * @return the range of matching shopping carts
353            * @throws SystemException if a system exception occurred
354            */
355            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
356                    long userId, int start, int end)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getPersistence().findByUserId(userId, start, end);
359            }
360    
361            /**
362            * Returns an ordered range of all the shopping carts where userId = &#63;.
363            *
364            * <p>
365            * 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.
366            * </p>
367            *
368            * @param userId the user ID
369            * @param start the lower bound of the range of shopping carts
370            * @param end the upper bound of the range of shopping carts (not inclusive)
371            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
372            * @return the ordered range of matching shopping carts
373            * @throws SystemException if a system exception occurred
374            */
375            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
376                    long userId, int start, int end,
377                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
378                    throws com.liferay.portal.kernel.exception.SystemException {
379                    return getPersistence()
380                                       .findByUserId(userId, start, end, orderByComparator);
381            }
382    
383            /**
384            * Returns the first shopping cart in the ordered set where userId = &#63;.
385            *
386            * @param userId the user ID
387            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
388            * @return the first matching shopping cart
389            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
390            * @throws SystemException if a system exception occurred
391            */
392            public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First(
393                    long userId,
394                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
395                    throws com.liferay.portal.kernel.exception.SystemException,
396                            com.liferay.portlet.shopping.NoSuchCartException {
397                    return getPersistence().findByUserId_First(userId, orderByComparator);
398            }
399    
400            /**
401            * Returns the first shopping cart in the ordered set where userId = &#63;.
402            *
403            * @param userId the user ID
404            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
405            * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
406            * @throws SystemException if a system exception occurred
407            */
408            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_First(
409                    long userId,
410                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
413            }
414    
415            /**
416            * Returns the last shopping cart in the ordered set where userId = &#63;.
417            *
418            * @param userId the user ID
419            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
420            * @return the last matching shopping cart
421            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
422            * @throws SystemException if a system exception occurred
423            */
424            public static com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last(
425                    long userId,
426                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
427                    throws com.liferay.portal.kernel.exception.SystemException,
428                            com.liferay.portlet.shopping.NoSuchCartException {
429                    return getPersistence().findByUserId_Last(userId, orderByComparator);
430            }
431    
432            /**
433            * Returns the last shopping cart in the ordered set where userId = &#63;.
434            *
435            * @param userId the user ID
436            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
437            * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
438            * @throws SystemException if a system exception occurred
439            */
440            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_Last(
441                    long userId,
442                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
443                    throws com.liferay.portal.kernel.exception.SystemException {
444                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
445            }
446    
447            /**
448            * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = &#63;.
449            *
450            * @param cartId the primary key of the current shopping cart
451            * @param userId the user ID
452            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
453            * @return the previous, current, and next shopping cart
454            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
455            * @throws SystemException if a system exception occurred
456            */
457            public static com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext(
458                    long cartId, long userId,
459                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
460                    throws com.liferay.portal.kernel.exception.SystemException,
461                            com.liferay.portlet.shopping.NoSuchCartException {
462                    return getPersistence()
463                                       .findByUserId_PrevAndNext(cartId, userId, orderByComparator);
464            }
465    
466            /**
467            * 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.
468            *
469            * @param groupId the group ID
470            * @param userId the user ID
471            * @return the matching shopping cart
472            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
473            * @throws SystemException if a system exception occurred
474            */
475            public static com.liferay.portlet.shopping.model.ShoppingCart findByG_U(
476                    long groupId, long userId)
477                    throws com.liferay.portal.kernel.exception.SystemException,
478                            com.liferay.portlet.shopping.NoSuchCartException {
479                    return getPersistence().findByG_U(groupId, userId);
480            }
481    
482            /**
483            * 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.
484            *
485            * @param groupId the group ID
486            * @param userId the user ID
487            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
488            * @throws SystemException if a system exception occurred
489            */
490            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
491                    long groupId, long userId)
492                    throws com.liferay.portal.kernel.exception.SystemException {
493                    return getPersistence().fetchByG_U(groupId, userId);
494            }
495    
496            /**
497            * 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.
498            *
499            * @param groupId the group ID
500            * @param userId the user ID
501            * @param retrieveFromCache whether to use the finder cache
502            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
503            * @throws SystemException if a system exception occurred
504            */
505            public static com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
506                    long groupId, long userId, boolean retrieveFromCache)
507                    throws com.liferay.portal.kernel.exception.SystemException {
508                    return getPersistence().fetchByG_U(groupId, userId, retrieveFromCache);
509            }
510    
511            /**
512            * Returns all the shopping carts.
513            *
514            * @return the 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                    throws com.liferay.portal.kernel.exception.SystemException {
519                    return getPersistence().findAll();
520            }
521    
522            /**
523            * Returns a range of all the shopping carts.
524            *
525            * <p>
526            * 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.
527            * </p>
528            *
529            * @param start the lower bound of the range of shopping carts
530            * @param end the upper bound of the range of shopping carts (not inclusive)
531            * @return the range of shopping carts
532            * @throws SystemException if a system exception occurred
533            */
534            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
535                    int start, int end)
536                    throws com.liferay.portal.kernel.exception.SystemException {
537                    return getPersistence().findAll(start, end);
538            }
539    
540            /**
541            * Returns an ordered range of all the shopping carts.
542            *
543            * <p>
544            * 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.
545            * </p>
546            *
547            * @param start the lower bound of the range of shopping carts
548            * @param end the upper bound of the range of shopping carts (not inclusive)
549            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
550            * @return the ordered range of shopping carts
551            * @throws SystemException if a system exception occurred
552            */
553            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
554                    int start, int end,
555                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
556                    throws com.liferay.portal.kernel.exception.SystemException {
557                    return getPersistence().findAll(start, end, orderByComparator);
558            }
559    
560            /**
561            * Removes all the shopping carts where groupId = &#63; from the database.
562            *
563            * @param groupId the group ID
564            * @throws SystemException if a system exception occurred
565            */
566            public static void removeByGroupId(long groupId)
567                    throws com.liferay.portal.kernel.exception.SystemException {
568                    getPersistence().removeByGroupId(groupId);
569            }
570    
571            /**
572            * Removes all the shopping carts where userId = &#63; from the database.
573            *
574            * @param userId the user ID
575            * @throws SystemException if a system exception occurred
576            */
577            public static void removeByUserId(long userId)
578                    throws com.liferay.portal.kernel.exception.SystemException {
579                    getPersistence().removeByUserId(userId);
580            }
581    
582            /**
583            * Removes the shopping cart where groupId = &#63; and userId = &#63; from the database.
584            *
585            * @param groupId the group ID
586            * @param userId the user ID
587            * @return the shopping cart that was removed
588            * @throws SystemException if a system exception occurred
589            */
590            public static com.liferay.portlet.shopping.model.ShoppingCart removeByG_U(
591                    long groupId, long userId)
592                    throws com.liferay.portal.kernel.exception.SystemException,
593                            com.liferay.portlet.shopping.NoSuchCartException {
594                    return getPersistence().removeByG_U(groupId, userId);
595            }
596    
597            /**
598            * Removes all the shopping carts from the database.
599            *
600            * @throws SystemException if a system exception occurred
601            */
602            public static void removeAll()
603                    throws com.liferay.portal.kernel.exception.SystemException {
604                    getPersistence().removeAll();
605            }
606    
607            /**
608            * Returns the number of shopping carts where groupId = &#63;.
609            *
610            * @param groupId the group ID
611            * @return the number of matching shopping carts
612            * @throws SystemException if a system exception occurred
613            */
614            public static int countByGroupId(long groupId)
615                    throws com.liferay.portal.kernel.exception.SystemException {
616                    return getPersistence().countByGroupId(groupId);
617            }
618    
619            /**
620            * Returns the number of shopping carts where userId = &#63;.
621            *
622            * @param userId the user ID
623            * @return the number of matching shopping carts
624            * @throws SystemException if a system exception occurred
625            */
626            public static int countByUserId(long userId)
627                    throws com.liferay.portal.kernel.exception.SystemException {
628                    return getPersistence().countByUserId(userId);
629            }
630    
631            /**
632            * Returns the number of shopping carts where groupId = &#63; and userId = &#63;.
633            *
634            * @param groupId the group ID
635            * @param userId the user ID
636            * @return the number of matching shopping carts
637            * @throws SystemException if a system exception occurred
638            */
639            public static int countByG_U(long groupId, long userId)
640                    throws com.liferay.portal.kernel.exception.SystemException {
641                    return getPersistence().countByG_U(groupId, userId);
642            }
643    
644            /**
645            * Returns the number of shopping carts.
646            *
647            * @return the number of shopping carts
648            * @throws SystemException if a system exception occurred
649            */
650            public static int countAll()
651                    throws com.liferay.portal.kernel.exception.SystemException {
652                    return getPersistence().countAll();
653            }
654    
655            public static ShoppingCartPersistence getPersistence() {
656                    if (_persistence == null) {
657                            _persistence = (ShoppingCartPersistence)PortalBeanLocatorUtil.locate(ShoppingCartPersistence.class.getName());
658    
659                            ReferenceRegistry.registerReference(ShoppingCartUtil.class,
660                                    "_persistence");
661                    }
662    
663                    return _persistence;
664            }
665    
666            /**
667             * @deprecated
668             */
669            public void setPersistence(ShoppingCartPersistence persistence) {
670            }
671    
672            private static ShoppingCartPersistence _persistence;
673    }