001    /**
002     * Copyright (c) 2000-2010 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.service.persistence.BasePersistence;
018    
019    import com.liferay.portlet.shopping.model.ShoppingCart;
020    
021    /**
022     * The persistence interface for the shopping cart service.
023     *
024     * <p>
025     * Never modify this interface directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this interface.
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see ShoppingCartPersistenceImpl
030     * @see ShoppingCartUtil
031     * @generated
032     */
033    public interface ShoppingCartPersistence extends BasePersistence<ShoppingCart> {
034            /**
035            * Caches the shopping cart in the entity cache if it is enabled.
036            *
037            * @param shoppingCart the shopping cart to cache
038            */
039            public void cacheResult(
040                    com.liferay.portlet.shopping.model.ShoppingCart shoppingCart);
041    
042            /**
043            * Caches the shopping carts in the entity cache if it is enabled.
044            *
045            * @param shoppingCarts the shopping carts to cache
046            */
047            public void cacheResult(
048                    java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts);
049    
050            /**
051            * Creates a new shopping cart with the primary key.
052            *
053            * @param cartId the primary key for the new shopping cart
054            * @return the new shopping cart
055            */
056            public com.liferay.portlet.shopping.model.ShoppingCart create(long cartId);
057    
058            /**
059            * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners.
060            *
061            * @param cartId the primary key of the shopping cart to remove
062            * @return the shopping cart that was removed
063            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
064            * @throws SystemException if a system exception occurred
065            */
066            public com.liferay.portlet.shopping.model.ShoppingCart remove(long cartId)
067                    throws com.liferay.portal.kernel.exception.SystemException,
068                            com.liferay.portlet.shopping.NoSuchCartException;
069    
070            public com.liferay.portlet.shopping.model.ShoppingCart updateImpl(
071                    com.liferay.portlet.shopping.model.ShoppingCart shoppingCart,
072                    boolean merge)
073                    throws com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Finds the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found.
077            *
078            * @param cartId the primary key of the shopping cart to find
079            * @return the shopping cart
080            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
081            * @throws SystemException if a system exception occurred
082            */
083            public com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey(
084                    long cartId)
085                    throws com.liferay.portal.kernel.exception.SystemException,
086                            com.liferay.portlet.shopping.NoSuchCartException;
087    
088            /**
089            * Finds the shopping cart with the primary key or returns <code>null</code> if it could not be found.
090            *
091            * @param cartId the primary key of the shopping cart to find
092            * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found
093            * @throws SystemException if a system exception occurred
094            */
095            public com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey(
096                    long cartId) throws com.liferay.portal.kernel.exception.SystemException;
097    
098            /**
099            * Finds all the shopping carts where groupId = &#63;.
100            *
101            * @param groupId the group id to search with
102            * @return the matching shopping carts
103            * @throws SystemException if a system exception occurred
104            */
105            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
106                    long groupId)
107                    throws com.liferay.portal.kernel.exception.SystemException;
108    
109            /**
110            * Finds a range of all the shopping carts where groupId = &#63;.
111            *
112            * <p>
113            * 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.
114            * </p>
115            *
116            * @param groupId the group id to search with
117            * @param start the lower bound of the range of shopping carts to return
118            * @param end the upper bound of the range of shopping carts to return (not inclusive)
119            * @return the range of matching shopping carts
120            * @throws SystemException if a system exception occurred
121            */
122            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
123                    long groupId, int start, int end)
124                    throws com.liferay.portal.kernel.exception.SystemException;
125    
126            /**
127            * Finds an ordered 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.
131            * </p>
132            *
133            * @param groupId the group id to search with
134            * @param start the lower bound of the range of shopping carts to return
135            * @param end the upper bound of the range of shopping carts to return (not inclusive)
136            * @param orderByComparator the comparator to order the results by
137            * @return the ordered range of matching shopping carts
138            * @throws SystemException if a system exception occurred
139            */
140            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
141                    long groupId, int start, int end,
142                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
143                    throws com.liferay.portal.kernel.exception.SystemException;
144    
145            /**
146            * Finds the first shopping cart in the ordered set 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.
150            * </p>
151            *
152            * @param groupId the group id to search with
153            * @param orderByComparator the comparator to order the set by
154            * @return the first matching shopping cart
155            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
156            * @throws SystemException if a system exception occurred
157            */
158            public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First(
159                    long groupId,
160                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
161                    throws com.liferay.portal.kernel.exception.SystemException,
162                            com.liferay.portlet.shopping.NoSuchCartException;
163    
164            /**
165            * Finds the last shopping cart in the ordered set where groupId = &#63;.
166            *
167            * <p>
168            * 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.
169            * </p>
170            *
171            * @param groupId the group id to search with
172            * @param orderByComparator the comparator to order the set by
173            * @return the last matching shopping cart
174            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last(
178                    long groupId,
179                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
180                    throws com.liferay.portal.kernel.exception.SystemException,
181                            com.liferay.portlet.shopping.NoSuchCartException;
182    
183            /**
184            * Finds the shopping carts before and after the current shopping cart in the ordered set where groupId = &#63;.
185            *
186            * <p>
187            * 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.
188            * </p>
189            *
190            * @param cartId the primary key of the current shopping cart
191            * @param groupId the group id to search with
192            * @param orderByComparator the comparator to order the set by
193            * @return the previous, current, and next shopping cart
194            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
195            * @throws SystemException if a system exception occurred
196            */
197            public com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext(
198                    long cartId, long groupId,
199                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
200                    throws com.liferay.portal.kernel.exception.SystemException,
201                            com.liferay.portlet.shopping.NoSuchCartException;
202    
203            /**
204            * Finds all the shopping carts where userId = &#63;.
205            *
206            * @param userId the user id to search with
207            * @return the matching shopping carts
208            * @throws SystemException if a system exception occurred
209            */
210            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
211                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
212    
213            /**
214            * Finds a range of all the shopping carts where userId = &#63;.
215            *
216            * <p>
217            * 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.
218            * </p>
219            *
220            * @param userId the user id to search with
221            * @param start the lower bound of the range of shopping carts to return
222            * @param end the upper bound of the range of shopping carts to return (not inclusive)
223            * @return the range of matching shopping carts
224            * @throws SystemException if a system exception occurred
225            */
226            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
227                    long userId, int start, int end)
228                    throws com.liferay.portal.kernel.exception.SystemException;
229    
230            /**
231            * Finds an ordered range of all the shopping carts where userId = &#63;.
232            *
233            * <p>
234            * 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.
235            * </p>
236            *
237            * @param userId the user id to search with
238            * @param start the lower bound of the range of shopping carts to return
239            * @param end the upper bound of the range of shopping carts to return (not inclusive)
240            * @param orderByComparator the comparator to order the results by
241            * @return the ordered range of matching shopping carts
242            * @throws SystemException if a system exception occurred
243            */
244            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
245                    long userId, int start, int end,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Finds the first shopping cart in the ordered set where userId = &#63;.
251            *
252            * <p>
253            * 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.
254            * </p>
255            *
256            * @param userId the user id to search with
257            * @param orderByComparator the comparator to order the set by
258            * @return the first matching shopping cart
259            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
260            * @throws SystemException if a system exception occurred
261            */
262            public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First(
263                    long userId,
264                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
265                    throws com.liferay.portal.kernel.exception.SystemException,
266                            com.liferay.portlet.shopping.NoSuchCartException;
267    
268            /**
269            * Finds the last shopping cart in the ordered set where userId = &#63;.
270            *
271            * <p>
272            * 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.
273            * </p>
274            *
275            * @param userId the user id to search with
276            * @param orderByComparator the comparator to order the set by
277            * @return the last matching shopping cart
278            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
279            * @throws SystemException if a system exception occurred
280            */
281            public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last(
282                    long userId,
283                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
284                    throws com.liferay.portal.kernel.exception.SystemException,
285                            com.liferay.portlet.shopping.NoSuchCartException;
286    
287            /**
288            * Finds the shopping carts before and after the current shopping cart in the ordered set where userId = &#63;.
289            *
290            * <p>
291            * 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.
292            * </p>
293            *
294            * @param cartId the primary key of the current shopping cart
295            * @param userId the user id to search with
296            * @param orderByComparator the comparator to order the set by
297            * @return the previous, current, and next shopping cart
298            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
299            * @throws SystemException if a system exception occurred
300            */
301            public com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext(
302                    long cartId, long userId,
303                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
304                    throws com.liferay.portal.kernel.exception.SystemException,
305                            com.liferay.portlet.shopping.NoSuchCartException;
306    
307            /**
308            * Finds the shopping cart where groupId = &#63; and userId = &#63; or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found.
309            *
310            * @param groupId the group id to search with
311            * @param userId the user id to search with
312            * @return the matching shopping cart
313            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
314            * @throws SystemException if a system exception occurred
315            */
316            public com.liferay.portlet.shopping.model.ShoppingCart findByG_U(
317                    long groupId, long userId)
318                    throws com.liferay.portal.kernel.exception.SystemException,
319                            com.liferay.portlet.shopping.NoSuchCartException;
320    
321            /**
322            * Finds the shopping cart where groupId = &#63; and userId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
323            *
324            * @param groupId the group id to search with
325            * @param userId the user id to search with
326            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
327            * @throws SystemException if a system exception occurred
328            */
329            public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
330                    long groupId, long userId)
331                    throws com.liferay.portal.kernel.exception.SystemException;
332    
333            /**
334            * Finds 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.
335            *
336            * @param groupId the group id to search with
337            * @param userId the user id to search with
338            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
339            * @throws SystemException if a system exception occurred
340            */
341            public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
342                    long groupId, long userId, boolean retrieveFromCache)
343                    throws com.liferay.portal.kernel.exception.SystemException;
344    
345            /**
346            * Finds all the shopping carts.
347            *
348            * @return the shopping carts
349            * @throws SystemException if a system exception occurred
350            */
351            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll()
352                    throws com.liferay.portal.kernel.exception.SystemException;
353    
354            /**
355            * Finds a range of all the shopping carts.
356            *
357            * <p>
358            * 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.
359            * </p>
360            *
361            * @param start the lower bound of the range of shopping carts to return
362            * @param end the upper bound of the range of shopping carts to return (not inclusive)
363            * @return the range of shopping carts
364            * @throws SystemException if a system exception occurred
365            */
366            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
367                    int start, int end)
368                    throws com.liferay.portal.kernel.exception.SystemException;
369    
370            /**
371            * Finds an ordered range of all the shopping carts.
372            *
373            * <p>
374            * 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.
375            * </p>
376            *
377            * @param start the lower bound of the range of shopping carts to return
378            * @param end the upper bound of the range of shopping carts to return (not inclusive)
379            * @param orderByComparator the comparator to order the results by
380            * @return the ordered range of shopping carts
381            * @throws SystemException if a system exception occurred
382            */
383            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
384                    int start, int end,
385                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
386                    throws com.liferay.portal.kernel.exception.SystemException;
387    
388            /**
389            * Removes all the shopping carts where groupId = &#63; from the database.
390            *
391            * @param groupId the group id to search with
392            * @throws SystemException if a system exception occurred
393            */
394            public void removeByGroupId(long groupId)
395                    throws com.liferay.portal.kernel.exception.SystemException;
396    
397            /**
398            * Removes all the shopping carts where userId = &#63; from the database.
399            *
400            * @param userId the user id to search with
401            * @throws SystemException if a system exception occurred
402            */
403            public void removeByUserId(long userId)
404                    throws com.liferay.portal.kernel.exception.SystemException;
405    
406            /**
407            * Removes the shopping cart where groupId = &#63; and userId = &#63; from the database.
408            *
409            * @param groupId the group id to search with
410            * @param userId the user id to search with
411            * @throws SystemException if a system exception occurred
412            */
413            public void removeByG_U(long groupId, long userId)
414                    throws com.liferay.portal.kernel.exception.SystemException,
415                            com.liferay.portlet.shopping.NoSuchCartException;
416    
417            /**
418            * Removes all the shopping carts from the database.
419            *
420            * @throws SystemException if a system exception occurred
421            */
422            public void removeAll()
423                    throws com.liferay.portal.kernel.exception.SystemException;
424    
425            /**
426            * Counts all the shopping carts where groupId = &#63;.
427            *
428            * @param groupId the group id to search with
429            * @return the number of matching shopping carts
430            * @throws SystemException if a system exception occurred
431            */
432            public int countByGroupId(long groupId)
433                    throws com.liferay.portal.kernel.exception.SystemException;
434    
435            /**
436            * Counts all the shopping carts where userId = &#63;.
437            *
438            * @param userId the user id to search with
439            * @return the number of matching shopping carts
440            * @throws SystemException if a system exception occurred
441            */
442            public int countByUserId(long userId)
443                    throws com.liferay.portal.kernel.exception.SystemException;
444    
445            /**
446            * Counts all the shopping carts where groupId = &#63; and userId = &#63;.
447            *
448            * @param groupId the group id to search with
449            * @param userId the user id to search with
450            * @return the number of matching shopping carts
451            * @throws SystemException if a system exception occurred
452            */
453            public int countByG_U(long groupId, long userId)
454                    throws com.liferay.portal.kernel.exception.SystemException;
455    
456            /**
457            * Counts all the shopping carts.
458            *
459            * @return the number of shopping carts
460            * @throws SystemException if a system exception occurred
461            */
462            public int countAll()
463                    throws com.liferay.portal.kernel.exception.SystemException;
464    }