1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.shopping.service.persistence;
21  
22  /**
23   * <a href="ShoppingCouponUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class ShoppingCouponUtil {
29      public static void cacheResult(
30          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon) {
31          getPersistence().cacheResult(shoppingCoupon);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> shoppingCoupons) {
36          getPersistence().cacheResult(shoppingCoupons);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.shopping.model.ShoppingCoupon create(
44          long couponId) {
45          return getPersistence().create(couponId);
46      }
47  
48      public static com.liferay.portlet.shopping.model.ShoppingCoupon remove(
49          long couponId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.shopping.NoSuchCouponException {
52          return getPersistence().remove(couponId);
53      }
54  
55      public static com.liferay.portlet.shopping.model.ShoppingCoupon remove(
56          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(shoppingCoupon);
59      }
60  
61      /**
62       * @deprecated Use <code>update(ShoppingCoupon shoppingCoupon, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.shopping.model.ShoppingCoupon update(
65          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(shoppingCoupon);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        shoppingCoupon the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when shoppingCoupon is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portlet.shopping.model.ShoppingCoupon update(
84          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(shoppingCoupon, merge);
87      }
88  
89      public static com.liferay.portlet.shopping.model.ShoppingCoupon updateImpl(
90          com.liferay.portlet.shopping.model.ShoppingCoupon shoppingCoupon,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(shoppingCoupon, merge);
93      }
94  
95      public static com.liferay.portlet.shopping.model.ShoppingCoupon findByPrimaryKey(
96          long couponId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.shopping.NoSuchCouponException {
99          return getPersistence().findByPrimaryKey(couponId);
100     }
101 
102     public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByPrimaryKey(
103         long couponId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(couponId);
105     }
106 
107     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
108         long groupId) throws com.liferay.portal.SystemException {
109         return getPersistence().findByGroupId(groupId);
110     }
111 
112     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
113         long groupId, int start, int end)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().findByGroupId(groupId, start, end);
116     }
117 
118     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findByGroupId(
119         long groupId, int start, int end,
120         com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByGroupId(groupId, start, end, obc);
123     }
124 
125     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_First(
126         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.SystemException,
128             com.liferay.portlet.shopping.NoSuchCouponException {
129         return getPersistence().findByGroupId_First(groupId, obc);
130     }
131 
132     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByGroupId_Last(
133         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.SystemException,
135             com.liferay.portlet.shopping.NoSuchCouponException {
136         return getPersistence().findByGroupId_Last(groupId, obc);
137     }
138 
139     public static com.liferay.portlet.shopping.model.ShoppingCoupon[] findByGroupId_PrevAndNext(
140         long couponId, long groupId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.shopping.NoSuchCouponException {
144         return getPersistence().findByGroupId_PrevAndNext(couponId, groupId, obc);
145     }
146 
147     public static com.liferay.portlet.shopping.model.ShoppingCoupon findByCode(
148         java.lang.String code)
149         throws com.liferay.portal.SystemException,
150             com.liferay.portlet.shopping.NoSuchCouponException {
151         return getPersistence().findByCode(code);
152     }
153 
154     public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode(
155         java.lang.String code) throws com.liferay.portal.SystemException {
156         return getPersistence().fetchByCode(code);
157     }
158 
159     public static com.liferay.portlet.shopping.model.ShoppingCoupon fetchByCode(
160         java.lang.String code, boolean retrieveFromCache)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().fetchByCode(code, retrieveFromCache);
163     }
164 
165     public static java.util.List<Object> findWithDynamicQuery(
166         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
167         throws com.liferay.portal.SystemException {
168         return getPersistence().findWithDynamicQuery(dynamicQuery);
169     }
170 
171     public static java.util.List<Object> findWithDynamicQuery(
172         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
173         int end) throws com.liferay.portal.SystemException {
174         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
175     }
176 
177     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll()
178         throws com.liferay.portal.SystemException {
179         return getPersistence().findAll();
180     }
181 
182     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll(
183         int start, int end) throws com.liferay.portal.SystemException {
184         return getPersistence().findAll(start, end);
185     }
186 
187     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingCoupon> findAll(
188         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
189         throws com.liferay.portal.SystemException {
190         return getPersistence().findAll(start, end, obc);
191     }
192 
193     public static void removeByGroupId(long groupId)
194         throws com.liferay.portal.SystemException {
195         getPersistence().removeByGroupId(groupId);
196     }
197 
198     public static void removeByCode(java.lang.String code)
199         throws com.liferay.portal.SystemException,
200             com.liferay.portlet.shopping.NoSuchCouponException {
201         getPersistence().removeByCode(code);
202     }
203 
204     public static void removeAll() throws com.liferay.portal.SystemException {
205         getPersistence().removeAll();
206     }
207 
208     public static int countByGroupId(long groupId)
209         throws com.liferay.portal.SystemException {
210         return getPersistence().countByGroupId(groupId);
211     }
212 
213     public static int countByCode(java.lang.String code)
214         throws com.liferay.portal.SystemException {
215         return getPersistence().countByCode(code);
216     }
217 
218     public static int countAll() throws com.liferay.portal.SystemException {
219         return getPersistence().countAll();
220     }
221 
222     public static ShoppingCouponPersistence getPersistence() {
223         return _persistence;
224     }
225 
226     public void setPersistence(ShoppingCouponPersistence persistence) {
227         _persistence = persistence;
228     }
229 
230     private static ShoppingCouponPersistence _persistence;
231 }