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