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