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