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