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="ShoppingOrderUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class ShoppingOrderUtil {
29      public static void cacheResult(
30          com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder) {
31          getPersistence().cacheResult(shoppingOrder);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> shoppingOrders) {
36          getPersistence().cacheResult(shoppingOrders);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portlet.shopping.model.ShoppingOrder create(
44          long orderId) {
45          return getPersistence().create(orderId);
46      }
47  
48      public static com.liferay.portlet.shopping.model.ShoppingOrder remove(
49          long orderId)
50          throws com.liferay.portal.SystemException,
51              com.liferay.portlet.shopping.NoSuchOrderException {
52          return getPersistence().remove(orderId);
53      }
54  
55      public static com.liferay.portlet.shopping.model.ShoppingOrder remove(
56          com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(shoppingOrder);
59      }
60  
61      /**
62       * @deprecated Use <code>update(ShoppingOrder shoppingOrder, boolean merge)</code>.
63       */
64      public static com.liferay.portlet.shopping.model.ShoppingOrder update(
65          com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(shoppingOrder);
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        shoppingOrder 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 shoppingOrder 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.ShoppingOrder update(
84          com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder,
85          boolean merge) throws com.liferay.portal.SystemException {
86          return getPersistence().update(shoppingOrder, merge);
87      }
88  
89      public static com.liferay.portlet.shopping.model.ShoppingOrder updateImpl(
90          com.liferay.portlet.shopping.model.ShoppingOrder shoppingOrder,
91          boolean merge) throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(shoppingOrder, merge);
93      }
94  
95      public static com.liferay.portlet.shopping.model.ShoppingOrder findByPrimaryKey(
96          long orderId)
97          throws com.liferay.portal.SystemException,
98              com.liferay.portlet.shopping.NoSuchOrderException {
99          return getPersistence().findByPrimaryKey(orderId);
100     }
101 
102     public static com.liferay.portlet.shopping.model.ShoppingOrder fetchByPrimaryKey(
103         long orderId) throws com.liferay.portal.SystemException {
104         return getPersistence().fetchByPrimaryKey(orderId);
105     }
106 
107     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> 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.ShoppingOrder> 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.ShoppingOrder> 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.ShoppingOrder findByGroupId_First(
126         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.SystemException,
128             com.liferay.portlet.shopping.NoSuchOrderException {
129         return getPersistence().findByGroupId_First(groupId, obc);
130     }
131 
132     public static com.liferay.portlet.shopping.model.ShoppingOrder findByGroupId_Last(
133         long groupId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.SystemException,
135             com.liferay.portlet.shopping.NoSuchOrderException {
136         return getPersistence().findByGroupId_Last(groupId, obc);
137     }
138 
139     public static com.liferay.portlet.shopping.model.ShoppingOrder[] findByGroupId_PrevAndNext(
140         long orderId, long groupId,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.SystemException,
143             com.liferay.portlet.shopping.NoSuchOrderException {
144         return getPersistence().findByGroupId_PrevAndNext(orderId, groupId, obc);
145     }
146 
147     public static com.liferay.portlet.shopping.model.ShoppingOrder findByNumber(
148         java.lang.String number)
149         throws com.liferay.portal.SystemException,
150             com.liferay.portlet.shopping.NoSuchOrderException {
151         return getPersistence().findByNumber(number);
152     }
153 
154     public static com.liferay.portlet.shopping.model.ShoppingOrder fetchByNumber(
155         java.lang.String number) throws com.liferay.portal.SystemException {
156         return getPersistence().fetchByNumber(number);
157     }
158 
159     public static com.liferay.portlet.shopping.model.ShoppingOrder fetchByNumber(
160         java.lang.String number, boolean retrieveFromCache)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().fetchByNumber(number, retrieveFromCache);
163     }
164 
165     public static com.liferay.portlet.shopping.model.ShoppingOrder findByPPTxnId(
166         java.lang.String ppTxnId)
167         throws com.liferay.portal.SystemException,
168             com.liferay.portlet.shopping.NoSuchOrderException {
169         return getPersistence().findByPPTxnId(ppTxnId);
170     }
171 
172     public static com.liferay.portlet.shopping.model.ShoppingOrder fetchByPPTxnId(
173         java.lang.String ppTxnId) throws com.liferay.portal.SystemException {
174         return getPersistence().fetchByPPTxnId(ppTxnId);
175     }
176 
177     public static com.liferay.portlet.shopping.model.ShoppingOrder fetchByPPTxnId(
178         java.lang.String ppTxnId, boolean retrieveFromCache)
179         throws com.liferay.portal.SystemException {
180         return getPersistence().fetchByPPTxnId(ppTxnId, retrieveFromCache);
181     }
182 
183     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> findByG_U_PPPS(
184         long groupId, long userId, java.lang.String ppPaymentStatus)
185         throws com.liferay.portal.SystemException {
186         return getPersistence().findByG_U_PPPS(groupId, userId, ppPaymentStatus);
187     }
188 
189     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> findByG_U_PPPS(
190         long groupId, long userId, java.lang.String ppPaymentStatus, int start,
191         int end) throws com.liferay.portal.SystemException {
192         return getPersistence()
193                    .findByG_U_PPPS(groupId, userId, ppPaymentStatus, start, end);
194     }
195 
196     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> findByG_U_PPPS(
197         long groupId, long userId, java.lang.String ppPaymentStatus, int start,
198         int end, com.liferay.portal.kernel.util.OrderByComparator obc)
199         throws com.liferay.portal.SystemException {
200         return getPersistence()
201                    .findByG_U_PPPS(groupId, userId, ppPaymentStatus, start,
202             end, obc);
203     }
204 
205     public static com.liferay.portlet.shopping.model.ShoppingOrder findByG_U_PPPS_First(
206         long groupId, long userId, java.lang.String ppPaymentStatus,
207         com.liferay.portal.kernel.util.OrderByComparator obc)
208         throws com.liferay.portal.SystemException,
209             com.liferay.portlet.shopping.NoSuchOrderException {
210         return getPersistence()
211                    .findByG_U_PPPS_First(groupId, userId, ppPaymentStatus, obc);
212     }
213 
214     public static com.liferay.portlet.shopping.model.ShoppingOrder findByG_U_PPPS_Last(
215         long groupId, long userId, java.lang.String ppPaymentStatus,
216         com.liferay.portal.kernel.util.OrderByComparator obc)
217         throws com.liferay.portal.SystemException,
218             com.liferay.portlet.shopping.NoSuchOrderException {
219         return getPersistence()
220                    .findByG_U_PPPS_Last(groupId, userId, ppPaymentStatus, obc);
221     }
222 
223     public static com.liferay.portlet.shopping.model.ShoppingOrder[] findByG_U_PPPS_PrevAndNext(
224         long orderId, long groupId, long userId,
225         java.lang.String ppPaymentStatus,
226         com.liferay.portal.kernel.util.OrderByComparator obc)
227         throws com.liferay.portal.SystemException,
228             com.liferay.portlet.shopping.NoSuchOrderException {
229         return getPersistence()
230                    .findByG_U_PPPS_PrevAndNext(orderId, groupId, userId,
231             ppPaymentStatus, obc);
232     }
233 
234     public static java.util.List<Object> findWithDynamicQuery(
235         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
236         throws com.liferay.portal.SystemException {
237         return getPersistence().findWithDynamicQuery(dynamicQuery);
238     }
239 
240     public static java.util.List<Object> findWithDynamicQuery(
241         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
242         int end) throws com.liferay.portal.SystemException {
243         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
244     }
245 
246     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> findAll()
247         throws com.liferay.portal.SystemException {
248         return getPersistence().findAll();
249     }
250 
251     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> findAll(
252         int start, int end) throws com.liferay.portal.SystemException {
253         return getPersistence().findAll(start, end);
254     }
255 
256     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrder> findAll(
257         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
258         throws com.liferay.portal.SystemException {
259         return getPersistence().findAll(start, end, obc);
260     }
261 
262     public static void removeByGroupId(long groupId)
263         throws com.liferay.portal.SystemException {
264         getPersistence().removeByGroupId(groupId);
265     }
266 
267     public static void removeByNumber(java.lang.String number)
268         throws com.liferay.portal.SystemException,
269             com.liferay.portlet.shopping.NoSuchOrderException {
270         getPersistence().removeByNumber(number);
271     }
272 
273     public static void removeByPPTxnId(java.lang.String ppTxnId)
274         throws com.liferay.portal.SystemException,
275             com.liferay.portlet.shopping.NoSuchOrderException {
276         getPersistence().removeByPPTxnId(ppTxnId);
277     }
278 
279     public static void removeByG_U_PPPS(long groupId, long userId,
280         java.lang.String ppPaymentStatus)
281         throws com.liferay.portal.SystemException {
282         getPersistence().removeByG_U_PPPS(groupId, userId, ppPaymentStatus);
283     }
284 
285     public static void removeAll() throws com.liferay.portal.SystemException {
286         getPersistence().removeAll();
287     }
288 
289     public static int countByGroupId(long groupId)
290         throws com.liferay.portal.SystemException {
291         return getPersistence().countByGroupId(groupId);
292     }
293 
294     public static int countByNumber(java.lang.String number)
295         throws com.liferay.portal.SystemException {
296         return getPersistence().countByNumber(number);
297     }
298 
299     public static int countByPPTxnId(java.lang.String ppTxnId)
300         throws com.liferay.portal.SystemException {
301         return getPersistence().countByPPTxnId(ppTxnId);
302     }
303 
304     public static int countByG_U_PPPS(long groupId, long userId,
305         java.lang.String ppPaymentStatus)
306         throws com.liferay.portal.SystemException {
307         return getPersistence().countByG_U_PPPS(groupId, userId, ppPaymentStatus);
308     }
309 
310     public static int countAll() throws com.liferay.portal.SystemException {
311         return getPersistence().countAll();
312     }
313 
314     public static ShoppingOrderPersistence getPersistence() {
315         return _persistence;
316     }
317 
318     public void setPersistence(ShoppingOrderPersistence persistence) {
319         _persistence = persistence;
320     }
321 
322     private static ShoppingOrderPersistence _persistence;
323 }