001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service.persistence;
016    
017    import com.liferay.portal.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     * Caching information and settings can be found in <code>portal.properties</code>
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             * NOTE FOR DEVELOPERS:
036             *
037             * Never modify or reference this interface directly. Always use {@link ShoppingCartUtil} to access the shopping cart persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
038             */
039    
040            /**
041            * Caches the shopping cart in the entity cache if it is enabled.
042            *
043            * @param shoppingCart the shopping cart
044            */
045            public void cacheResult(
046                    com.liferay.portlet.shopping.model.ShoppingCart shoppingCart);
047    
048            /**
049            * Caches the shopping carts in the entity cache if it is enabled.
050            *
051            * @param shoppingCarts the shopping carts
052            */
053            public void cacheResult(
054                    java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> shoppingCarts);
055    
056            /**
057            * Creates a new shopping cart with the primary key. Does not add the shopping cart to the database.
058            *
059            * @param cartId the primary key for the new shopping cart
060            * @return the new shopping cart
061            */
062            public com.liferay.portlet.shopping.model.ShoppingCart create(long cartId);
063    
064            /**
065            * Removes the shopping cart with the primary key from the database. Also notifies the appropriate model listeners.
066            *
067            * @param cartId the primary key of the shopping cart
068            * @return the shopping cart that was removed
069            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
070            * @throws SystemException if a system exception occurred
071            */
072            public com.liferay.portlet.shopping.model.ShoppingCart remove(long cartId)
073                    throws com.liferay.portal.kernel.exception.SystemException,
074                            com.liferay.portlet.shopping.NoSuchCartException;
075    
076            public com.liferay.portlet.shopping.model.ShoppingCart updateImpl(
077                    com.liferay.portlet.shopping.model.ShoppingCart shoppingCart)
078                    throws com.liferay.portal.kernel.exception.SystemException;
079    
080            /**
081            * Returns the shopping cart with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCartException} if it could not be found.
082            *
083            * @param cartId the primary key of the shopping cart
084            * @return the shopping cart
085            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
086            * @throws SystemException if a system exception occurred
087            */
088            public com.liferay.portlet.shopping.model.ShoppingCart findByPrimaryKey(
089                    long cartId)
090                    throws com.liferay.portal.kernel.exception.SystemException,
091                            com.liferay.portlet.shopping.NoSuchCartException;
092    
093            /**
094            * Returns the shopping cart with the primary key or returns <code>null</code> if it could not be found.
095            *
096            * @param cartId the primary key of the shopping cart
097            * @return the shopping cart, or <code>null</code> if a shopping cart with the primary key could not be found
098            * @throws SystemException if a system exception occurred
099            */
100            public com.liferay.portlet.shopping.model.ShoppingCart fetchByPrimaryKey(
101                    long cartId) throws com.liferay.portal.kernel.exception.SystemException;
102    
103            /**
104            * Returns all the shopping carts where groupId = &#63;.
105            *
106            * @param groupId the group ID
107            * @return the matching shopping carts
108            * @throws SystemException if a system exception occurred
109            */
110            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
111                    long groupId)
112                    throws com.liferay.portal.kernel.exception.SystemException;
113    
114            /**
115            * Returns a range of all the shopping carts where groupId = &#63;.
116            *
117            * <p>
118            * 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.
119            * </p>
120            *
121            * @param groupId the group ID
122            * @param start the lower bound of the range of shopping carts
123            * @param end the upper bound of the range of shopping carts (not inclusive)
124            * @return the range of matching shopping carts
125            * @throws SystemException if a system exception occurred
126            */
127            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
128                    long groupId, int start, int end)
129                    throws com.liferay.portal.kernel.exception.SystemException;
130    
131            /**
132            * Returns an ordered range of all the shopping carts where groupId = &#63;.
133            *
134            * <p>
135            * 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.
136            * </p>
137            *
138            * @param groupId the group ID
139            * @param start the lower bound of the range of shopping carts
140            * @param end the upper bound of the range of shopping carts (not inclusive)
141            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
142            * @return the ordered range of matching shopping carts
143            * @throws SystemException if a system exception occurred
144            */
145            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByGroupId(
146                    long groupId, int start, int end,
147                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
148                    throws com.liferay.portal.kernel.exception.SystemException;
149    
150            /**
151            * Returns the first shopping cart in the ordered set where groupId = &#63;.
152            *
153            * @param groupId the group ID
154            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
155            * @return the first matching shopping cart
156            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
157            * @throws SystemException if a system exception occurred
158            */
159            public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_First(
160                    long groupId,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.kernel.exception.SystemException,
163                            com.liferay.portlet.shopping.NoSuchCartException;
164    
165            /**
166            * Returns the first shopping cart in the ordered set where groupId = &#63;.
167            *
168            * @param groupId the group ID
169            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
170            * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
171            * @throws SystemException if a system exception occurred
172            */
173            public com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_First(
174                    long groupId,
175                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
176                    throws com.liferay.portal.kernel.exception.SystemException;
177    
178            /**
179            * Returns the last shopping cart in the ordered set where groupId = &#63;.
180            *
181            * @param groupId the group ID
182            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
183            * @return the last matching shopping cart
184            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
185            * @throws SystemException if a system exception occurred
186            */
187            public com.liferay.portlet.shopping.model.ShoppingCart findByGroupId_Last(
188                    long groupId,
189                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
190                    throws com.liferay.portal.kernel.exception.SystemException,
191                            com.liferay.portlet.shopping.NoSuchCartException;
192    
193            /**
194            * Returns the last shopping cart in the ordered set where groupId = &#63;.
195            *
196            * @param groupId the group ID
197            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
198            * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public com.liferay.portlet.shopping.model.ShoppingCart fetchByGroupId_Last(
202                    long groupId,
203                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204                    throws com.liferay.portal.kernel.exception.SystemException;
205    
206            /**
207            * Returns the shopping carts before and after the current shopping cart in the ordered set where groupId = &#63;.
208            *
209            * @param cartId the primary key of the current shopping cart
210            * @param groupId the group ID
211            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
212            * @return the previous, current, and next shopping cart
213            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
214            * @throws SystemException if a system exception occurred
215            */
216            public com.liferay.portlet.shopping.model.ShoppingCart[] findByGroupId_PrevAndNext(
217                    long cartId, long groupId,
218                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
219                    throws com.liferay.portal.kernel.exception.SystemException,
220                            com.liferay.portlet.shopping.NoSuchCartException;
221    
222            /**
223            * Returns all the shopping carts where userId = &#63;.
224            *
225            * @param userId the user ID
226            * @return the matching shopping carts
227            * @throws SystemException if a system exception occurred
228            */
229            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
230                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
231    
232            /**
233            * Returns a range of all the shopping carts where userId = &#63;.
234            *
235            * <p>
236            * 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.
237            * </p>
238            *
239            * @param userId the user ID
240            * @param start the lower bound of the range of shopping carts
241            * @param end the upper bound of the range of shopping carts (not inclusive)
242            * @return the range of matching shopping carts
243            * @throws SystemException if a system exception occurred
244            */
245            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
246                    long userId, int start, int end)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Returns an ordered range of all the shopping carts 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
257            * @param start the lower bound of the range of shopping carts
258            * @param end the upper bound of the range of shopping carts (not inclusive)
259            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
260            * @return the ordered range of matching shopping carts
261            * @throws SystemException if a system exception occurred
262            */
263            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findByUserId(
264                    long userId, int start, int end,
265                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266                    throws com.liferay.portal.kernel.exception.SystemException;
267    
268            /**
269            * Returns the first shopping cart in the ordered set where userId = &#63;.
270            *
271            * @param userId the user ID
272            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
273            * @return the first matching shopping cart
274            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
275            * @throws SystemException if a system exception occurred
276            */
277            public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_First(
278                    long userId,
279                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
280                    throws com.liferay.portal.kernel.exception.SystemException,
281                            com.liferay.portlet.shopping.NoSuchCartException;
282    
283            /**
284            * Returns the first shopping cart in the ordered set where userId = &#63;.
285            *
286            * @param userId the user ID
287            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
288            * @return the first matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
289            * @throws SystemException if a system exception occurred
290            */
291            public com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_First(
292                    long userId,
293                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
294                    throws com.liferay.portal.kernel.exception.SystemException;
295    
296            /**
297            * Returns the last shopping cart in the ordered set where userId = &#63;.
298            *
299            * @param userId the user ID
300            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
301            * @return the last matching shopping cart
302            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
303            * @throws SystemException if a system exception occurred
304            */
305            public com.liferay.portlet.shopping.model.ShoppingCart findByUserId_Last(
306                    long userId,
307                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
308                    throws com.liferay.portal.kernel.exception.SystemException,
309                            com.liferay.portlet.shopping.NoSuchCartException;
310    
311            /**
312            * Returns the last shopping cart in the ordered set where userId = &#63;.
313            *
314            * @param userId the user ID
315            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
316            * @return the last matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public com.liferay.portlet.shopping.model.ShoppingCart fetchByUserId_Last(
320                    long userId,
321                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
322                    throws com.liferay.portal.kernel.exception.SystemException;
323    
324            /**
325            * Returns the shopping carts before and after the current shopping cart in the ordered set where userId = &#63;.
326            *
327            * @param cartId the primary key of the current shopping cart
328            * @param userId the user ID
329            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
330            * @return the previous, current, and next shopping cart
331            * @throws com.liferay.portlet.shopping.NoSuchCartException if a shopping cart with the primary key could not be found
332            * @throws SystemException if a system exception occurred
333            */
334            public com.liferay.portlet.shopping.model.ShoppingCart[] findByUserId_PrevAndNext(
335                    long cartId, long userId,
336                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
337                    throws com.liferay.portal.kernel.exception.SystemException,
338                            com.liferay.portlet.shopping.NoSuchCartException;
339    
340            /**
341            * 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.
342            *
343            * @param groupId the group ID
344            * @param userId the user ID
345            * @return the matching shopping cart
346            * @throws com.liferay.portlet.shopping.NoSuchCartException if a matching shopping cart could not be found
347            * @throws SystemException if a system exception occurred
348            */
349            public com.liferay.portlet.shopping.model.ShoppingCart findByG_U(
350                    long groupId, long userId)
351                    throws com.liferay.portal.kernel.exception.SystemException,
352                            com.liferay.portlet.shopping.NoSuchCartException;
353    
354            /**
355            * 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.
356            *
357            * @param groupId the group ID
358            * @param userId the user ID
359            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
360            * @throws SystemException if a system exception occurred
361            */
362            public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
363                    long groupId, long userId)
364                    throws com.liferay.portal.kernel.exception.SystemException;
365    
366            /**
367            * 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.
368            *
369            * @param groupId the group ID
370            * @param userId the user ID
371            * @param retrieveFromCache whether to use the finder cache
372            * @return the matching shopping cart, or <code>null</code> if a matching shopping cart could not be found
373            * @throws SystemException if a system exception occurred
374            */
375            public com.liferay.portlet.shopping.model.ShoppingCart fetchByG_U(
376                    long groupId, long userId, boolean retrieveFromCache)
377                    throws com.liferay.portal.kernel.exception.SystemException;
378    
379            /**
380            * Returns all the shopping carts.
381            *
382            * @return the shopping carts
383            * @throws SystemException if a system exception occurred
384            */
385            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll()
386                    throws com.liferay.portal.kernel.exception.SystemException;
387    
388            /**
389            * Returns a range of all the shopping carts.
390            *
391            * <p>
392            * 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.
393            * </p>
394            *
395            * @param start the lower bound of the range of shopping carts
396            * @param end the upper bound of the range of shopping carts (not inclusive)
397            * @return the range of shopping carts
398            * @throws SystemException if a system exception occurred
399            */
400            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
401                    int start, int end)
402                    throws com.liferay.portal.kernel.exception.SystemException;
403    
404            /**
405            * Returns an ordered range of all the shopping carts.
406            *
407            * <p>
408            * 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.
409            * </p>
410            *
411            * @param start the lower bound of the range of shopping carts
412            * @param end the upper bound of the range of shopping carts (not inclusive)
413            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
414            * @return the ordered range of shopping carts
415            * @throws SystemException if a system exception occurred
416            */
417            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCart> findAll(
418                    int start, int end,
419                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
420                    throws com.liferay.portal.kernel.exception.SystemException;
421    
422            /**
423            * Removes all the shopping carts where groupId = &#63; from the database.
424            *
425            * @param groupId the group ID
426            * @throws SystemException if a system exception occurred
427            */
428            public void removeByGroupId(long groupId)
429                    throws com.liferay.portal.kernel.exception.SystemException;
430    
431            /**
432            * Removes all the shopping carts where userId = &#63; from the database.
433            *
434            * @param userId the user ID
435            * @throws SystemException if a system exception occurred
436            */
437            public void removeByUserId(long userId)
438                    throws com.liferay.portal.kernel.exception.SystemException;
439    
440            /**
441            * Removes the shopping cart where groupId = &#63; and userId = &#63; from the database.
442            *
443            * @param groupId the group ID
444            * @param userId the user ID
445            * @return the shopping cart that was removed
446            * @throws SystemException if a system exception occurred
447            */
448            public com.liferay.portlet.shopping.model.ShoppingCart removeByG_U(
449                    long groupId, long userId)
450                    throws com.liferay.portal.kernel.exception.SystemException,
451                            com.liferay.portlet.shopping.NoSuchCartException;
452    
453            /**
454            * Removes all the shopping carts from the database.
455            *
456            * @throws SystemException if a system exception occurred
457            */
458            public void removeAll()
459                    throws com.liferay.portal.kernel.exception.SystemException;
460    
461            /**
462            * Returns the number of shopping carts where groupId = &#63;.
463            *
464            * @param groupId the group ID
465            * @return the number of matching shopping carts
466            * @throws SystemException if a system exception occurred
467            */
468            public int countByGroupId(long groupId)
469                    throws com.liferay.portal.kernel.exception.SystemException;
470    
471            /**
472            * Returns the number of shopping carts where userId = &#63;.
473            *
474            * @param userId the user ID
475            * @return the number of matching shopping carts
476            * @throws SystemException if a system exception occurred
477            */
478            public int countByUserId(long userId)
479                    throws com.liferay.portal.kernel.exception.SystemException;
480    
481            /**
482            * Returns the number of shopping carts where groupId = &#63; and userId = &#63;.
483            *
484            * @param groupId the group ID
485            * @param userId the user ID
486            * @return the number of matching shopping carts
487            * @throws SystemException if a system exception occurred
488            */
489            public int countByG_U(long groupId, long userId)
490                    throws com.liferay.portal.kernel.exception.SystemException;
491    
492            /**
493            * Returns the number of shopping carts.
494            *
495            * @return the number of shopping carts
496            * @throws SystemException if a system exception occurred
497            */
498            public int countAll()
499                    throws com.liferay.portal.kernel.exception.SystemException;
500    }