1   /**
2    * Copyright (c) 2000-2009 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="ShoppingItemUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class ShoppingItemUtil {
32      public static void cacheResult(
33          com.liferay.portlet.shopping.model.ShoppingItem shoppingItem) {
34          getPersistence().cacheResult(shoppingItem);
35      }
36  
37      public static void cacheResult(
38          java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> shoppingItems) {
39          getPersistence().cacheResult(shoppingItems);
40      }
41  
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      public static com.liferay.portlet.shopping.model.ShoppingItem create(
47          long itemId) {
48          return getPersistence().create(itemId);
49      }
50  
51      public static com.liferay.portlet.shopping.model.ShoppingItem remove(
52          long itemId)
53          throws com.liferay.portal.SystemException,
54              com.liferay.portlet.shopping.NoSuchItemException {
55          return getPersistence().remove(itemId);
56      }
57  
58      public static com.liferay.portlet.shopping.model.ShoppingItem remove(
59          com.liferay.portlet.shopping.model.ShoppingItem shoppingItem)
60          throws com.liferay.portal.SystemException {
61          return getPersistence().remove(shoppingItem);
62      }
63  
64      /**
65       * @deprecated Use <code>update(ShoppingItem shoppingItem, boolean merge)</code>.
66       */
67      public static com.liferay.portlet.shopping.model.ShoppingItem update(
68          com.liferay.portlet.shopping.model.ShoppingItem shoppingItem)
69          throws com.liferay.portal.SystemException {
70          return getPersistence().update(shoppingItem);
71      }
72  
73      /**
74       * Add, update, or merge, the entity. This method also calls the model
75       * listeners to trigger the proper events associated with adding, deleting,
76       * or updating an entity.
77       *
78       * @param        shoppingItem the entity to add, update, or merge
79       * @param        merge boolean value for whether to merge the entity. The
80       *                default value is false. Setting merge to true is more
81       *                expensive and should only be true when shoppingItem is
82       *                transient. See LEP-5473 for a detailed discussion of this
83       *                method.
84       * @return        true if the portlet can be displayed via Ajax
85       */
86      public static com.liferay.portlet.shopping.model.ShoppingItem update(
87          com.liferay.portlet.shopping.model.ShoppingItem shoppingItem,
88          boolean merge) throws com.liferay.portal.SystemException {
89          return getPersistence().update(shoppingItem, merge);
90      }
91  
92      public static com.liferay.portlet.shopping.model.ShoppingItem updateImpl(
93          com.liferay.portlet.shopping.model.ShoppingItem shoppingItem,
94          boolean merge) throws com.liferay.portal.SystemException {
95          return getPersistence().updateImpl(shoppingItem, merge);
96      }
97  
98      public static com.liferay.portlet.shopping.model.ShoppingItem findByPrimaryKey(
99          long itemId)
100         throws com.liferay.portal.SystemException,
101             com.liferay.portlet.shopping.NoSuchItemException {
102         return getPersistence().findByPrimaryKey(itemId);
103     }
104 
105     public static com.liferay.portlet.shopping.model.ShoppingItem fetchByPrimaryKey(
106         long itemId) throws com.liferay.portal.SystemException {
107         return getPersistence().fetchByPrimaryKey(itemId);
108     }
109 
110     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByCategoryId(
111         long categoryId) throws com.liferay.portal.SystemException {
112         return getPersistence().findByCategoryId(categoryId);
113     }
114 
115     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByCategoryId(
116         long categoryId, int start, int end)
117         throws com.liferay.portal.SystemException {
118         return getPersistence().findByCategoryId(categoryId, start, end);
119     }
120 
121     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByCategoryId(
122         long categoryId, int start, int end,
123         com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.SystemException {
125         return getPersistence().findByCategoryId(categoryId, start, end, obc);
126     }
127 
128     public static com.liferay.portlet.shopping.model.ShoppingItem findByCategoryId_First(
129         long categoryId, com.liferay.portal.kernel.util.OrderByComparator obc)
130         throws com.liferay.portal.SystemException,
131             com.liferay.portlet.shopping.NoSuchItemException {
132         return getPersistence().findByCategoryId_First(categoryId, obc);
133     }
134 
135     public static com.liferay.portlet.shopping.model.ShoppingItem findByCategoryId_Last(
136         long categoryId, com.liferay.portal.kernel.util.OrderByComparator obc)
137         throws com.liferay.portal.SystemException,
138             com.liferay.portlet.shopping.NoSuchItemException {
139         return getPersistence().findByCategoryId_Last(categoryId, obc);
140     }
141 
142     public static com.liferay.portlet.shopping.model.ShoppingItem[] findByCategoryId_PrevAndNext(
143         long itemId, long categoryId,
144         com.liferay.portal.kernel.util.OrderByComparator obc)
145         throws com.liferay.portal.SystemException,
146             com.liferay.portlet.shopping.NoSuchItemException {
147         return getPersistence()
148                    .findByCategoryId_PrevAndNext(itemId, categoryId, obc);
149     }
150 
151     public static com.liferay.portlet.shopping.model.ShoppingItem findBySmallImageId(
152         long smallImageId)
153         throws com.liferay.portal.SystemException,
154             com.liferay.portlet.shopping.NoSuchItemException {
155         return getPersistence().findBySmallImageId(smallImageId);
156     }
157 
158     public static com.liferay.portlet.shopping.model.ShoppingItem fetchBySmallImageId(
159         long smallImageId) throws com.liferay.portal.SystemException {
160         return getPersistence().fetchBySmallImageId(smallImageId);
161     }
162 
163     public static com.liferay.portlet.shopping.model.ShoppingItem fetchBySmallImageId(
164         long smallImageId, boolean retrieveFromCache)
165         throws com.liferay.portal.SystemException {
166         return getPersistence()
167                    .fetchBySmallImageId(smallImageId, retrieveFromCache);
168     }
169 
170     public static com.liferay.portlet.shopping.model.ShoppingItem findByMediumImageId(
171         long mediumImageId)
172         throws com.liferay.portal.SystemException,
173             com.liferay.portlet.shopping.NoSuchItemException {
174         return getPersistence().findByMediumImageId(mediumImageId);
175     }
176 
177     public static com.liferay.portlet.shopping.model.ShoppingItem fetchByMediumImageId(
178         long mediumImageId) throws com.liferay.portal.SystemException {
179         return getPersistence().fetchByMediumImageId(mediumImageId);
180     }
181 
182     public static com.liferay.portlet.shopping.model.ShoppingItem fetchByMediumImageId(
183         long mediumImageId, boolean retrieveFromCache)
184         throws com.liferay.portal.SystemException {
185         return getPersistence()
186                    .fetchByMediumImageId(mediumImageId, retrieveFromCache);
187     }
188 
189     public static com.liferay.portlet.shopping.model.ShoppingItem findByLargeImageId(
190         long largeImageId)
191         throws com.liferay.portal.SystemException,
192             com.liferay.portlet.shopping.NoSuchItemException {
193         return getPersistence().findByLargeImageId(largeImageId);
194     }
195 
196     public static com.liferay.portlet.shopping.model.ShoppingItem fetchByLargeImageId(
197         long largeImageId) throws com.liferay.portal.SystemException {
198         return getPersistence().fetchByLargeImageId(largeImageId);
199     }
200 
201     public static com.liferay.portlet.shopping.model.ShoppingItem fetchByLargeImageId(
202         long largeImageId, boolean retrieveFromCache)
203         throws com.liferay.portal.SystemException {
204         return getPersistence()
205                    .fetchByLargeImageId(largeImageId, retrieveFromCache);
206     }
207 
208     public static com.liferay.portlet.shopping.model.ShoppingItem findByC_S(
209         long companyId, java.lang.String sku)
210         throws com.liferay.portal.SystemException,
211             com.liferay.portlet.shopping.NoSuchItemException {
212         return getPersistence().findByC_S(companyId, sku);
213     }
214 
215     public static com.liferay.portlet.shopping.model.ShoppingItem fetchByC_S(
216         long companyId, java.lang.String sku)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().fetchByC_S(companyId, sku);
219     }
220 
221     public static com.liferay.portlet.shopping.model.ShoppingItem fetchByC_S(
222         long companyId, java.lang.String sku, boolean retrieveFromCache)
223         throws com.liferay.portal.SystemException {
224         return getPersistence().fetchByC_S(companyId, sku, retrieveFromCache);
225     }
226 
227     public static java.util.List<Object> findWithDynamicQuery(
228         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
229         throws com.liferay.portal.SystemException {
230         return getPersistence().findWithDynamicQuery(dynamicQuery);
231     }
232 
233     public static java.util.List<Object> findWithDynamicQuery(
234         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
235         int end) throws com.liferay.portal.SystemException {
236         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
237     }
238 
239     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findAll()
240         throws com.liferay.portal.SystemException {
241         return getPersistence().findAll();
242     }
243 
244     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findAll(
245         int start, int end) throws com.liferay.portal.SystemException {
246         return getPersistence().findAll(start, end);
247     }
248 
249     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findAll(
250         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
251         throws com.liferay.portal.SystemException {
252         return getPersistence().findAll(start, end, obc);
253     }
254 
255     public static void removeByCategoryId(long categoryId)
256         throws com.liferay.portal.SystemException {
257         getPersistence().removeByCategoryId(categoryId);
258     }
259 
260     public static void removeBySmallImageId(long smallImageId)
261         throws com.liferay.portal.SystemException,
262             com.liferay.portlet.shopping.NoSuchItemException {
263         getPersistence().removeBySmallImageId(smallImageId);
264     }
265 
266     public static void removeByMediumImageId(long mediumImageId)
267         throws com.liferay.portal.SystemException,
268             com.liferay.portlet.shopping.NoSuchItemException {
269         getPersistence().removeByMediumImageId(mediumImageId);
270     }
271 
272     public static void removeByLargeImageId(long largeImageId)
273         throws com.liferay.portal.SystemException,
274             com.liferay.portlet.shopping.NoSuchItemException {
275         getPersistence().removeByLargeImageId(largeImageId);
276     }
277 
278     public static void removeByC_S(long companyId, java.lang.String sku)
279         throws com.liferay.portal.SystemException,
280             com.liferay.portlet.shopping.NoSuchItemException {
281         getPersistence().removeByC_S(companyId, sku);
282     }
283 
284     public static void removeAll() throws com.liferay.portal.SystemException {
285         getPersistence().removeAll();
286     }
287 
288     public static int countByCategoryId(long categoryId)
289         throws com.liferay.portal.SystemException {
290         return getPersistence().countByCategoryId(categoryId);
291     }
292 
293     public static int countBySmallImageId(long smallImageId)
294         throws com.liferay.portal.SystemException {
295         return getPersistence().countBySmallImageId(smallImageId);
296     }
297 
298     public static int countByMediumImageId(long mediumImageId)
299         throws com.liferay.portal.SystemException {
300         return getPersistence().countByMediumImageId(mediumImageId);
301     }
302 
303     public static int countByLargeImageId(long largeImageId)
304         throws com.liferay.portal.SystemException {
305         return getPersistence().countByLargeImageId(largeImageId);
306     }
307 
308     public static int countByC_S(long companyId, java.lang.String sku)
309         throws com.liferay.portal.SystemException {
310         return getPersistence().countByC_S(companyId, sku);
311     }
312 
313     public static int countAll() throws com.liferay.portal.SystemException {
314         return getPersistence().countAll();
315     }
316 
317     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> getShoppingItemPrices(
318         long pk) throws com.liferay.portal.SystemException {
319         return getPersistence().getShoppingItemPrices(pk);
320     }
321 
322     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> getShoppingItemPrices(
323         long pk, int start, int end) throws com.liferay.portal.SystemException {
324         return getPersistence().getShoppingItemPrices(pk, start, end);
325     }
326 
327     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> getShoppingItemPrices(
328         long pk, int start, int end,
329         com.liferay.portal.kernel.util.OrderByComparator obc)
330         throws com.liferay.portal.SystemException {
331         return getPersistence().getShoppingItemPrices(pk, start, end, obc);
332     }
333 
334     public static int getShoppingItemPricesSize(long pk)
335         throws com.liferay.portal.SystemException {
336         return getPersistence().getShoppingItemPricesSize(pk);
337     }
338 
339     public static boolean containsShoppingItemPrice(long pk,
340         long shoppingItemPricePK) throws com.liferay.portal.SystemException {
341         return getPersistence()
342                    .containsShoppingItemPrice(pk, shoppingItemPricePK);
343     }
344 
345     public static boolean containsShoppingItemPrices(long pk)
346         throws com.liferay.portal.SystemException {
347         return getPersistence().containsShoppingItemPrices(pk);
348     }
349 
350     public static ShoppingItemPersistence getPersistence() {
351         return _persistence;
352     }
353 
354     public void setPersistence(ShoppingItemPersistence persistence) {
355         _persistence = persistence;
356     }
357 
358     private static ShoppingItemPersistence _persistence;
359 }