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.ShoppingCoupon;
020    
021    /**
022     * The persistence interface for the shopping coupon service.
023     *
024     * <p>
025     * Never modify or reference this interface directly. Always use {@link ShoppingCouponUtil} to access the shopping coupon persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
026     * </p>
027     *
028     * <p>
029     * Caching information and settings can be found in <code>portal.properties</code>
030     * </p>
031     *
032     * @author Brian Wing Shun Chan
033     * @see ShoppingCouponPersistenceImpl
034     * @see ShoppingCouponUtil
035     * @generated
036     */
037    public interface ShoppingCouponPersistence extends BasePersistence<ShoppingCoupon> {
038            /**
039            * Caches the shopping coupon in the entity cache if it is enabled.
040            *
041            * @param shoppingCoupon the shopping coupon to cache
042            */
043            public void cacheResult(
044                    com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon);
045    
046            /**
047            * Caches the shopping coupons in the entity cache if it is enabled.
048            *
049            * @param shoppingCoupons the shopping coupons to cache
050            */
051            public void cacheResult(
052                    java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> shoppingCoupons);
053    
054            /**
055            * Creates a new shopping coupon with the primary key. Does not add the shopping coupon to the database.
056            *
057            * @param couponId the primary key for the new shopping coupon
058            * @return the new shopping coupon
059            */
060            public com.liferay.portlet.shopping.model.ShoppingCoupon create(
061                    long couponId);
062    
063            /**
064            * Removes the shopping coupon with the primary key from the database. Also notifies the appropriate model listeners.
065            *
066            * @param couponId the primary key of the shopping coupon to remove
067            * @return the shopping coupon that was removed
068            * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found
069            * @throws SystemException if a system exception occurred
070            */
071            public com.liferay.portlet.shopping.model.ShoppingCoupon remove(
072                    long couponId)
073                    throws com.liferay.portal.kernel.exception.SystemException,
074                            com.liferay.portlet.shopping.NoSuchCouponException;
075    
076            public com.liferay.portlet.shopping.model.ShoppingCoupon updateImpl(
077                    com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon,
078                    boolean merge)
079                    throws com.liferay.portal.kernel.exception.SystemException;
080    
081            /**
082            * Finds the shopping coupon with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchCouponException} if it could not be found.
083            *
084            * @param couponId the primary key of the shopping coupon to find
085            * @return the shopping coupon
086            * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found
087            * @throws SystemException if a system exception occurred
088            */
089            public com.liferay.portlet.shopping.model.ShoppingCoupon findByPrimaryKey(
090                    long couponId)
091                    throws com.liferay.portal.kernel.exception.SystemException,
092                            com.liferay.portlet.shopping.NoSuchCouponException;
093    
094            /**
095            * Finds the shopping coupon with the primary key or returns <code>null</code> if it could not be found.
096            *
097            * @param couponId the primary key of the shopping coupon to find
098            * @return the shopping coupon, or <code>null</code> if a shopping coupon with the primary key could not be found
099            * @throws SystemException if a system exception occurred
100            */
101            public com.liferay.portlet.shopping.model.ShoppingCoupon fetchByPrimaryKey(
102                    long couponId)
103                    throws com.liferay.portal.kernel.exception.SystemException;
104    
105            /**
106            * Finds all the shopping coupons where groupId = &#63;.
107            *
108            * @param groupId the group id to search with
109            * @return the matching shopping coupons
110            * @throws SystemException if a system exception occurred
111            */
112            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
113                    long groupId)
114                    throws com.liferay.portal.kernel.exception.SystemException;
115    
116            /**
117            * Finds a range of all the shopping coupons where groupId = &#63;.
118            *
119            * <p>
120            * 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.
121            * </p>
122            *
123            * @param groupId the group id to search with
124            * @param start the lower bound of the range of shopping coupons to return
125            * @param end the upper bound of the range of shopping coupons to return (not inclusive)
126            * @return the range of matching shopping coupons
127            * @throws SystemException if a system exception occurred
128            */
129            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
130                    long groupId, int start, int end)
131                    throws com.liferay.portal.kernel.exception.SystemException;
132    
133            /**
134            * Finds an ordered range of all the shopping coupons where groupId = &#63;.
135            *
136            * <p>
137            * 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.
138            * </p>
139            *
140            * @param groupId the group id to search with
141            * @param start the lower bound of the range of shopping coupons to return
142            * @param end the upper bound of the range of shopping coupons to return (not inclusive)
143            * @param orderByComparator the comparator to order the results by
144            * @return the ordered range of matching shopping coupons
145            * @throws SystemException if a system exception occurred
146            */
147            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
148                    long groupId, int start, int end,
149                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
150                    throws com.liferay.portal.kernel.exception.SystemException;
151    
152            /**
153            * Finds the first shopping coupon in the ordered set where groupId = &#63;.
154            *
155            * <p>
156            * 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.
157            * </p>
158            *
159            * @param groupId the group id to search with
160            * @param orderByComparator the comparator to order the set by
161            * @return the first matching shopping coupon
162            * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found
163            * @throws SystemException if a system exception occurred
164            */
165            public com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_First(
166                    long groupId,
167                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
168                    throws com.liferay.portal.kernel.exception.SystemException,
169                            com.liferay.portlet.shopping.NoSuchCouponException;
170    
171            /**
172            * Finds the last shopping coupon in the ordered set where groupId = &#63;.
173            *
174            * <p>
175            * 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.
176            * </p>
177            *
178            * @param groupId the group id to search with
179            * @param orderByComparator the comparator to order the set by
180            * @return the last matching shopping coupon
181            * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found
182            * @throws SystemException if a system exception occurred
183            */
184            public com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_Last(
185                    long groupId,
186                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
187                    throws com.liferay.portal.kernel.exception.SystemException,
188                            com.liferay.portlet.shopping.NoSuchCouponException;
189    
190            /**
191            * Finds the shopping coupons before and after the current shopping coupon in the ordered set where groupId = &#63;.
192            *
193            * <p>
194            * 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.
195            * </p>
196            *
197            * @param couponId the primary key of the current shopping coupon
198            * @param groupId the group id to search with
199            * @param orderByComparator the comparator to order the set by
200            * @return the previous, current, and next shopping coupon
201            * @throws com.liferay.portlet.shopping.NoSuchCouponException if a shopping coupon with the primary key could not be found
202            * @throws SystemException if a system exception occurred
203            */
204            public com.liferay.portlet.shopping.model.ShoppingCoupon[] findByGroupId_PrevAndNext(
205                    long couponId, long groupId,
206                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
207                    throws com.liferay.portal.kernel.exception.SystemException,
208                            com.liferay.portlet.shopping.NoSuchCouponException;
209    
210            /**
211            * Finds the shopping coupon where code = &#63; or throws a {@link com.liferay.portlet.shopping.NoSuchCouponException} if it could not be found.
212            *
213            * @param code the code to search with
214            * @return the matching shopping coupon
215            * @throws com.liferay.portlet.shopping.NoSuchCouponException if a matching shopping coupon could not be found
216            * @throws SystemException if a system exception occurred
217            */
218            public com.liferay.portlet.shopping.model.ShoppingCoupon findByCode(
219                    java.lang.String code)
220                    throws com.liferay.portal.kernel.exception.SystemException,
221                            com.liferay.portlet.shopping.NoSuchCouponException;
222    
223            /**
224            * Finds the shopping coupon where code = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
225            *
226            * @param code the code to search with
227            * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found
228            * @throws SystemException if a system exception occurred
229            */
230            public com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode(
231                    java.lang.String code)
232                    throws com.liferay.portal.kernel.exception.SystemException;
233    
234            /**
235            * Finds the shopping coupon where code = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
236            *
237            * @param code the code to search with
238            * @return the matching shopping coupon, or <code>null</code> if a matching shopping coupon could not be found
239            * @throws SystemException if a system exception occurred
240            */
241            public com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode(
242                    java.lang.String code, boolean retrieveFromCache)
243                    throws com.liferay.portal.kernel.exception.SystemException;
244    
245            /**
246            * Finds all the shopping coupons.
247            *
248            * @return the shopping coupons
249            * @throws SystemException if a system exception occurred
250            */
251            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll()
252                    throws com.liferay.portal.kernel.exception.SystemException;
253    
254            /**
255            * Finds a range of all the shopping coupons.
256            *
257            * <p>
258            * 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.
259            * </p>
260            *
261            * @param start the lower bound of the range of shopping coupons to return
262            * @param end the upper bound of the range of shopping coupons to return (not inclusive)
263            * @return the range of shopping coupons
264            * @throws SystemException if a system exception occurred
265            */
266            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll(
267                    int start, int end)
268                    throws com.liferay.portal.kernel.exception.SystemException;
269    
270            /**
271            * Finds an ordered range of all the shopping coupons.
272            *
273            * <p>
274            * 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.
275            * </p>
276            *
277            * @param start the lower bound of the range of shopping coupons to return
278            * @param end the upper bound of the range of shopping coupons to return (not inclusive)
279            * @param orderByComparator the comparator to order the results by
280            * @return the ordered range of shopping coupons
281            * @throws SystemException if a system exception occurred
282            */
283            public java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll(
284                    int start, int end,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.kernel.exception.SystemException;
287    
288            /**
289            * Removes all the shopping coupons where groupId = &#63; from the database.
290            *
291            * @param groupId the group id to search with
292            * @throws SystemException if a system exception occurred
293            */
294            public void removeByGroupId(long groupId)
295                    throws com.liferay.portal.kernel.exception.SystemException;
296    
297            /**
298            * Removes the shopping coupon where code = &#63; from the database.
299            *
300            * @param code the code to search with
301            * @throws SystemException if a system exception occurred
302            */
303            public void removeByCode(java.lang.String code)
304                    throws com.liferay.portal.kernel.exception.SystemException,
305                            com.liferay.portlet.shopping.NoSuchCouponException;
306    
307            /**
308            * Removes all the shopping coupons from the database.
309            *
310            * @throws SystemException if a system exception occurred
311            */
312            public void removeAll()
313                    throws com.liferay.portal.kernel.exception.SystemException;
314    
315            /**
316            * Counts all the shopping coupons where groupId = &#63;.
317            *
318            * @param groupId the group id to search with
319            * @return the number of matching shopping coupons
320            * @throws SystemException if a system exception occurred
321            */
322            public int countByGroupId(long groupId)
323                    throws com.liferay.portal.kernel.exception.SystemException;
324    
325            /**
326            * Counts all the shopping coupons where code = &#63;.
327            *
328            * @param code the code to search with
329            * @return the number of matching shopping coupons
330            * @throws SystemException if a system exception occurred
331            */
332            public int countByCode(java.lang.String code)
333                    throws com.liferay.portal.kernel.exception.SystemException;
334    
335            /**
336            * Counts all the shopping coupons.
337            *
338            * @return the number of shopping coupons
339            * @throws SystemException if a system exception occurred
340            */
341            public int countAll()
342                    throws com.liferay.portal.kernel.exception.SystemException;
343    }