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