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