1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.shopping.service.persistence;
24  
25  /**
26   * <a href="ShoppingCouponUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class ShoppingCouponUtil {
32      public static com.liferay.portlet.shopping.model.ShoppingCoupon create(
33          long couponId) {
34          return getPersistence().create(couponId);
35      }
36  
37      public static com.liferay.portlet.shopping.model.ShoppingCoupon remove(
38          long couponId)
39          throws com.liferay.portal.SystemException, 
40              com.liferay.portlet.shopping.NoSuchCouponException {
41          return getPersistence().remove(couponId);
42      }
43  
44      public static com.liferay.portlet.shopping.model.ShoppingCoupon remove(
45          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
46          throws com.liferay.portal.SystemException {
47          return getPersistence().remove(shoppingCoupon);
48      }
49  
50      public static com.liferay.portlet.shopping.model.ShoppingCoupon update(
51          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
52          throws com.liferay.portal.SystemException {
53          return getPersistence().update(shoppingCoupon);
54      }
55  
56      public static com.liferay.portlet.shopping.model.ShoppingCoupon update(
57          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon,
58          boolean merge) throws com.liferay.portal.SystemException {
59          return getPersistence().update(shoppingCoupon, merge);
60      }
61  
62      public static com.liferay.portlet.shopping.model.ShoppingCoupon updateImpl(
63          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon,
64          boolean merge) throws com.liferay.portal.SystemException {
65          return getPersistence().updateImpl(shoppingCoupon, merge);
66      }
67  
68      public static com.liferay.portlet.shopping.model.ShoppingCoupon findByPrimaryKey(
69          long couponId)
70          throws com.liferay.portal.SystemException, 
71              com.liferay.portlet.shopping.NoSuchCouponException {
72          return getPersistence().findByPrimaryKey(couponId);
73      }
74  
75      public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByPrimaryKey(
76          long couponId) throws com.liferay.portal.SystemException {
77          return getPersistence().fetchByPrimaryKey(couponId);
78      }
79  
80      public static java.util.List findByGroupId(long groupId)
81          throws com.liferay.portal.SystemException {
82          return getPersistence().findByGroupId(groupId);
83      }
84  
85      public static java.util.List findByGroupId(long groupId, int begin, int end)
86          throws com.liferay.portal.SystemException {
87          return getPersistence().findByGroupId(groupId, begin, end);
88      }
89  
90      public static java.util.List findByGroupId(long groupId, int begin,
91          int end, com.liferay.portal.kernel.util.OrderByComparator obc)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().findByGroupId(groupId, begin, end, obc);
94      }
95  
96      public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_First(
97          long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
98          throws com.liferay.portal.SystemException, 
99              com.liferay.portlet.shopping.NoSuchCouponException {
100         return getPersistence().findByGroupId_First(groupId, obc);
101     }
102 
103     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_Last(
104         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
105         throws com.liferay.portal.SystemException, 
106             com.liferay.portlet.shopping.NoSuchCouponException {
107         return getPersistence().findByGroupId_Last(groupId, obc);
108     }
109 
110     public static com.liferay.portlet.shopping.model.ShoppingCoupon[] findByGroupId_PrevAndNext(
111         long couponId, long groupId,
112         com.liferay.portal.kernel.util.OrderByComparator obc)
113         throws com.liferay.portal.SystemException, 
114             com.liferay.portlet.shopping.NoSuchCouponException {
115         return getPersistence().findByGroupId_PrevAndNext(couponId, groupId, obc);
116     }
117 
118     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByCode(
119         java.lang.String code)
120         throws com.liferay.portal.SystemException, 
121             com.liferay.portlet.shopping.NoSuchCouponException {
122         return getPersistence().findByCode(code);
123     }
124 
125     public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode(
126         java.lang.String code) throws com.liferay.portal.SystemException {
127         return getPersistence().fetchByCode(code);
128     }
129 
130     public static java.util.List findWithDynamicQuery(
131         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
132         throws com.liferay.portal.SystemException {
133         return getPersistence().findWithDynamicQuery(queryInitializer);
134     }
135 
136     public static java.util.List findWithDynamicQuery(
137         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
138         int begin, int end) throws com.liferay.portal.SystemException {
139         return getPersistence().findWithDynamicQuery(queryInitializer, begin,
140             end);
141     }
142 
143     public static java.util.List findAll()
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findAll();
146     }
147 
148     public static java.util.List findAll(int begin, int end)
149         throws com.liferay.portal.SystemException {
150         return getPersistence().findAll(begin, end);
151     }
152 
153     public static java.util.List findAll(int begin, int end,
154         com.liferay.portal.kernel.util.OrderByComparator obc)
155         throws com.liferay.portal.SystemException {
156         return getPersistence().findAll(begin, end, obc);
157     }
158 
159     public static void removeByGroupId(long groupId)
160         throws com.liferay.portal.SystemException {
161         getPersistence().removeByGroupId(groupId);
162     }
163 
164     public static void removeByCode(java.lang.String code)
165         throws com.liferay.portal.SystemException, 
166             com.liferay.portlet.shopping.NoSuchCouponException {
167         getPersistence().removeByCode(code);
168     }
169 
170     public static void removeAll() throws com.liferay.portal.SystemException {
171         getPersistence().removeAll();
172     }
173 
174     public static int countByGroupId(long groupId)
175         throws com.liferay.portal.SystemException {
176         return getPersistence().countByGroupId(groupId);
177     }
178 
179     public static int countByCode(java.lang.String code)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().countByCode(code);
182     }
183 
184     public static int countAll() throws com.liferay.portal.SystemException {
185         return getPersistence().countAll();
186     }
187 
188     public static ShoppingCouponPersistence getPersistence() {
189         return _getUtil()._persistence;
190     }
191 
192     public void setPersistence(ShoppingCouponPersistence persistence) {
193         _persistence = persistence;
194     }
195 
196     private static ShoppingCouponUtil _getUtil() {
197         if (_util == null) {
198             _util = (ShoppingCouponUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
199         }
200 
201         return _util;
202     }
203 
204     private static final String _UTIL = ShoppingCouponUtil.class.getName();
205     private static ShoppingCouponUtil _util;
206     private ShoppingCouponPersistence _persistence;
207 }