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="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 begin, int end)
103         throws com.liferay.portal.SystemException {
104         return getPersistence().findByCategoryId(categoryId, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findByCategoryId(
108         long categoryId, int begin, int end,
109         com.liferay.portal.kernel.util.OrderByComparator obc)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().findByCategoryId(categoryId, begin, 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<com.liferay.portlet.shopping.model.ShoppingItem> findWithDynamicQuery(
187         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().findWithDynamicQuery(queryInitializer);
190     }
191 
192     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findWithDynamicQuery(
193         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
194         int begin, int end) throws com.liferay.portal.SystemException {
195         return getPersistence()
196                    .findWithDynamicQuery(queryInitializer, begin, end);
197     }
198 
199     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findAll()
200         throws com.liferay.portal.SystemException {
201         return getPersistence().findAll();
202     }
203 
204     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findAll(
205         int begin, int end) throws com.liferay.portal.SystemException {
206         return getPersistence().findAll(begin, end);
207     }
208 
209     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItem> findAll(
210         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
211         throws com.liferay.portal.SystemException {
212         return getPersistence().findAll(begin, end, obc);
213     }
214 
215     public static void removeByCategoryId(long categoryId)
216         throws com.liferay.portal.SystemException {
217         getPersistence().removeByCategoryId(categoryId);
218     }
219 
220     public static void removeBySmallImageId(long smallImageId)
221         throws com.liferay.portal.SystemException,
222             com.liferay.portlet.shopping.NoSuchItemException {
223         getPersistence().removeBySmallImageId(smallImageId);
224     }
225 
226     public static void removeByMediumImageId(long mediumImageId)
227         throws com.liferay.portal.SystemException,
228             com.liferay.portlet.shopping.NoSuchItemException {
229         getPersistence().removeByMediumImageId(mediumImageId);
230     }
231 
232     public static void removeByLargeImageId(long largeImageId)
233         throws com.liferay.portal.SystemException,
234             com.liferay.portlet.shopping.NoSuchItemException {
235         getPersistence().removeByLargeImageId(largeImageId);
236     }
237 
238     public static void removeByC_S(long companyId, java.lang.String sku)
239         throws com.liferay.portal.SystemException,
240             com.liferay.portlet.shopping.NoSuchItemException {
241         getPersistence().removeByC_S(companyId, sku);
242     }
243 
244     public static void removeAll() throws com.liferay.portal.SystemException {
245         getPersistence().removeAll();
246     }
247 
248     public static int countByCategoryId(long categoryId)
249         throws com.liferay.portal.SystemException {
250         return getPersistence().countByCategoryId(categoryId);
251     }
252 
253     public static int countBySmallImageId(long smallImageId)
254         throws com.liferay.portal.SystemException {
255         return getPersistence().countBySmallImageId(smallImageId);
256     }
257 
258     public static int countByMediumImageId(long mediumImageId)
259         throws com.liferay.portal.SystemException {
260         return getPersistence().countByMediumImageId(mediumImageId);
261     }
262 
263     public static int countByLargeImageId(long largeImageId)
264         throws com.liferay.portal.SystemException {
265         return getPersistence().countByLargeImageId(largeImageId);
266     }
267 
268     public static int countByC_S(long companyId, java.lang.String sku)
269         throws com.liferay.portal.SystemException {
270         return getPersistence().countByC_S(companyId, sku);
271     }
272 
273     public static int countAll() throws com.liferay.portal.SystemException {
274         return getPersistence().countAll();
275     }
276 
277     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> getShoppingItemPrices(
278         long pk)
279         throws com.liferay.portal.SystemException,
280             com.liferay.portlet.shopping.NoSuchItemException {
281         return getPersistence().getShoppingItemPrices(pk);
282     }
283 
284     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> getShoppingItemPrices(
285         long pk, int begin, int end)
286         throws com.liferay.portal.SystemException,
287             com.liferay.portlet.shopping.NoSuchItemException {
288         return getPersistence().getShoppingItemPrices(pk, begin, end);
289     }
290 
291     public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> getShoppingItemPrices(
292         long pk, int begin, int end,
293         com.liferay.portal.kernel.util.OrderByComparator obc)
294         throws com.liferay.portal.SystemException,
295             com.liferay.portlet.shopping.NoSuchItemException {
296         return getPersistence().getShoppingItemPrices(pk, begin, end, obc);
297     }
298 
299     public static int getShoppingItemPricesSize(long pk)
300         throws com.liferay.portal.SystemException {
301         return getPersistence().getShoppingItemPricesSize(pk);
302     }
303 
304     public static boolean containsShoppingItemPrice(long pk,
305         long shoppingItemPricePK) throws com.liferay.portal.SystemException {
306         return getPersistence()
307                    .containsShoppingItemPrice(pk, shoppingItemPricePK);
308     }
309 
310     public static boolean containsShoppingItemPrices(long pk)
311         throws com.liferay.portal.SystemException {
312         return getPersistence().containsShoppingItemPrices(pk);
313     }
314 
315     public static ShoppingItemPersistence getPersistence() {
316         return _getUtil()._persistence;
317     }
318 
319     public void setPersistence(ShoppingItemPersistence persistence) {
320         _persistence = persistence;
321     }
322 
323     private static ShoppingItemUtil _getUtil() {
324         if (_util == null) {
325             _util = (ShoppingItemUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
326         }
327 
328         return _util;
329     }
330 
331     private static final String _UTIL = ShoppingItemUtil.class.getName();
332     private static ShoppingItemUtil _util;
333     private ShoppingItemPersistence _persistence;
334 }