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