1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portlet.shopping.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  
22  import com.liferay.portlet.shopping.model.ShoppingCoupon;
23  
24  import java.util.List;
25  
26  /**
27   * <a href="ShoppingCouponUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       ShoppingCouponPersistence
36   * @see       ShoppingCouponPersistenceImpl
37   * @generated
38   */
39  public class ShoppingCouponUtil {
40      /**
41       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
42       */
43      public static void clearCache() {
44          getPersistence().clearCache();
45      }
46  
47      /**
48       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(ShoppingCoupon)
49       */
50      public static void clearCache(ShoppingCoupon shoppingCoupon) {
51          getPersistence().clearCache(shoppingCoupon);
52      }
53  
54      /**
55       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
56       */
57      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
58          throws SystemException {
59          return getPersistence().countWithDynamicQuery(dynamicQuery);
60      }
61  
62      /**
63       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
64       */
65      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
66          throws SystemException {
67          return getPersistence().findWithDynamicQuery(dynamicQuery);
68      }
69  
70      /**
71       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
72       */
73      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
74          int start, int end) throws SystemException {
75          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
76      }
77  
78      /**
79       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
80       */
81      public static ShoppingCoupon remove(ShoppingCoupon shoppingCoupon)
82          throws SystemException {
83          return getPersistence().remove(shoppingCoupon);
84      }
85  
86      /**
87       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
88       */
89      public static ShoppingCoupon update(ShoppingCoupon shoppingCoupon,
90          boolean merge) throws SystemException {
91          return getPersistence().update(shoppingCoupon, merge);
92      }
93  
94      public static void cacheResult(
95          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) {
96          getPersistence().cacheResult(shoppingCoupon);
97      }
98  
99      public static void cacheResult(
100         java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> shoppingCoupons) {
101         getPersistence().cacheResult(shoppingCoupons);
102     }
103 
104     public static com.liferay.portlet.shopping.model.ShoppingCoupon create(
105         long couponId) {
106         return getPersistence().create(couponId);
107     }
108 
109     public static com.liferay.portlet.shopping.model.ShoppingCoupon remove(
110         long couponId)
111         throws com.liferay.portal.SystemException,
112             com.liferay.portlet.shopping.NoSuchCouponException {
113         return getPersistence().remove(couponId);
114     }
115 
116     /**
117      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
118      */
119     public static com.liferay.portlet.shopping.model.ShoppingCoupon update(
120         com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().update(shoppingCoupon);
123     }
124 
125     public static com.liferay.portlet.shopping.model.ShoppingCoupon updateImpl(
126         com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon,
127         boolean merge) throws com.liferay.portal.SystemException {
128         return getPersistence().updateImpl(shoppingCoupon, merge);
129     }
130 
131     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByPrimaryKey(
132         long couponId)
133         throws com.liferay.portal.SystemException,
134             com.liferay.portlet.shopping.NoSuchCouponException {
135         return getPersistence().findByPrimaryKey(couponId);
136     }
137 
138     public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByPrimaryKey(
139         long couponId) throws com.liferay.portal.SystemException {
140         return getPersistence().fetchByPrimaryKey(couponId);
141     }
142 
143     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
144         long groupId) throws com.liferay.portal.SystemException {
145         return getPersistence().findByGroupId(groupId);
146     }
147 
148     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
149         long groupId, int start, int end)
150         throws com.liferay.portal.SystemException {
151         return getPersistence().findByGroupId(groupId, start, end);
152     }
153 
154     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
155         long groupId, int start, int end,
156         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
157         throws com.liferay.portal.SystemException {
158         return getPersistence()
159                    .findByGroupId(groupId, start, end, orderByComparator);
160     }
161 
162     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_First(
163         long groupId,
164         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165         throws com.liferay.portal.SystemException,
166             com.liferay.portlet.shopping.NoSuchCouponException {
167         return getPersistence().findByGroupId_First(groupId, orderByComparator);
168     }
169 
170     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_Last(
171         long groupId,
172         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
173         throws com.liferay.portal.SystemException,
174             com.liferay.portlet.shopping.NoSuchCouponException {
175         return getPersistence().findByGroupId_Last(groupId, orderByComparator);
176     }
177 
178     public static com.liferay.portlet.shopping.model.ShoppingCoupon[] findByGroupId_PrevAndNext(
179         long couponId, long groupId,
180         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
181         throws com.liferay.portal.SystemException,
182             com.liferay.portlet.shopping.NoSuchCouponException {
183         return getPersistence()
184                    .findByGroupId_PrevAndNext(couponId, groupId,
185             orderByComparator);
186     }
187 
188     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByCode(
189         java.lang.String code)
190         throws com.liferay.portal.SystemException,
191             com.liferay.portlet.shopping.NoSuchCouponException {
192         return getPersistence().findByCode(code);
193     }
194 
195     public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode(
196         java.lang.String code) throws com.liferay.portal.SystemException {
197         return getPersistence().fetchByCode(code);
198     }
199 
200     public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode(
201         java.lang.String code, boolean retrieveFromCache)
202         throws com.liferay.portal.SystemException {
203         return getPersistence().fetchByCode(code, retrieveFromCache);
204     }
205 
206     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll()
207         throws com.liferay.portal.SystemException {
208         return getPersistence().findAll();
209     }
210 
211     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll(
212         int start, int end) throws com.liferay.portal.SystemException {
213         return getPersistence().findAll(start, end);
214     }
215 
216     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll(
217         int start, int end,
218         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
219         throws com.liferay.portal.SystemException {
220         return getPersistence().findAll(start, end, orderByComparator);
221     }
222 
223     public static void removeByGroupId(long groupId)
224         throws com.liferay.portal.SystemException {
225         getPersistence().removeByGroupId(groupId);
226     }
227 
228     public static void removeByCode(java.lang.String code)
229         throws com.liferay.portal.SystemException,
230             com.liferay.portlet.shopping.NoSuchCouponException {
231         getPersistence().removeByCode(code);
232     }
233 
234     public static void removeAll() throws com.liferay.portal.SystemException {
235         getPersistence().removeAll();
236     }
237 
238     public static int countByGroupId(long groupId)
239         throws com.liferay.portal.SystemException {
240         return getPersistence().countByGroupId(groupId);
241     }
242 
243     public static int countByCode(java.lang.String code)
244         throws com.liferay.portal.SystemException {
245         return getPersistence().countByCode(code);
246     }
247 
248     public static int countAll() throws com.liferay.portal.SystemException {
249         return getPersistence().countAll();
250     }
251 
252     public static ShoppingCouponPersistence getPersistence() {
253         if (_persistence == null) {
254             _persistence = (ShoppingCouponPersistence)PortalBeanLocatorUtil.locate(ShoppingCouponPersistence.class.getName());
255 
256             ReferenceRegistry.registerReference(ShoppingCouponUtil.class,
257                 "_persistence");
258         }
259 
260         return _persistence;
261     }
262 
263     public void setPersistence(ShoppingCouponPersistence persistence) {
264         _persistence = persistence;
265 
266         ReferenceRegistry.registerReference(ShoppingCouponUtil.class,
267             "_persistence");
268     }
269 
270     private static ShoppingCouponPersistence _persistence;
271 }