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