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