001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.service.ServiceContext;
022    
023    import com.liferay.portlet.shopping.model.ShoppingItemPrice;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the shopping item price service.
029     *
030     * <p>
031     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ShoppingItemPricePersistence
036     * @see ShoppingItemPricePersistenceImpl
037     * @generated
038     */
039    public class ShoppingItemPriceUtil {
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
042             */
043            public static void clearCache() {
044                    getPersistence().clearCache();
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
049             */
050            public static void clearCache(ShoppingItemPrice shoppingItemPrice) {
051                    getPersistence().clearCache(shoppingItemPrice);
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
056             */
057            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
058                    throws SystemException {
059                    return getPersistence().countWithDynamicQuery(dynamicQuery);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
064             */
065            public static List<ShoppingItemPrice> findWithDynamicQuery(
066                    DynamicQuery dynamicQuery) throws SystemException {
067                    return getPersistence().findWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
072             */
073            public static List<ShoppingItemPrice> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery, int start, int end)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
081             */
082            public static List<ShoppingItemPrice> findWithDynamicQuery(
083                    DynamicQuery dynamicQuery, int start, int end,
084                    OrderByComparator orderByComparator) throws SystemException {
085                    return getPersistence()
086                                       .findWithDynamicQuery(dynamicQuery, start, end,
087                            orderByComparator);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
092             */
093            public static ShoppingItemPrice remove(ShoppingItemPrice shoppingItemPrice)
094                    throws SystemException {
095                    return getPersistence().remove(shoppingItemPrice);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
100             */
101            public static ShoppingItemPrice update(
102                    ShoppingItemPrice shoppingItemPrice, boolean merge)
103                    throws SystemException {
104                    return getPersistence().update(shoppingItemPrice, merge);
105            }
106    
107            /**
108             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
109             */
110            public static ShoppingItemPrice update(
111                    ShoppingItemPrice shoppingItemPrice, boolean merge,
112                    ServiceContext serviceContext) throws SystemException {
113                    return getPersistence().update(shoppingItemPrice, merge, serviceContext);
114            }
115    
116            /**
117            * Caches the shopping item price in the entity cache if it is enabled.
118            *
119            * @param shoppingItemPrice the shopping item price to cache
120            */
121            public static void cacheResult(
122                    com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice) {
123                    getPersistence().cacheResult(shoppingItemPrice);
124            }
125    
126            /**
127            * Caches the shopping item prices in the entity cache if it is enabled.
128            *
129            * @param shoppingItemPrices the shopping item prices to cache
130            */
131            public static void cacheResult(
132                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> shoppingItemPrices) {
133                    getPersistence().cacheResult(shoppingItemPrices);
134            }
135    
136            /**
137            * Creates a new shopping item price with the primary key.
138            *
139            * @param itemPriceId the primary key for the new shopping item price
140            * @return the new shopping item price
141            */
142            public static com.liferay.portlet.shopping.model.ShoppingItemPrice create(
143                    long itemPriceId) {
144                    return getPersistence().create(itemPriceId);
145            }
146    
147            /**
148            * Removes the shopping item price with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param itemPriceId the primary key of the shopping item price to remove
151            * @return the shopping item price that was removed
152            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portlet.shopping.model.ShoppingItemPrice remove(
156                    long itemPriceId)
157                    throws com.liferay.portal.kernel.exception.SystemException,
158                            com.liferay.portlet.shopping.NoSuchItemPriceException {
159                    return getPersistence().remove(itemPriceId);
160            }
161    
162            public static com.liferay.portlet.shopping.model.ShoppingItemPrice updateImpl(
163                    com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice,
164                    boolean merge)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence().updateImpl(shoppingItemPrice, merge);
167            }
168    
169            /**
170            * Finds the shopping item price with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchItemPriceException} if it could not be found.
171            *
172            * @param itemPriceId the primary key of the shopping item price to find
173            * @return the shopping item price
174            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByPrimaryKey(
178                    long itemPriceId)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.shopping.NoSuchItemPriceException {
181                    return getPersistence().findByPrimaryKey(itemPriceId);
182            }
183    
184            /**
185            * Finds the shopping item price with the primary key or returns <code>null</code> if it could not be found.
186            *
187            * @param itemPriceId the primary key of the shopping item price to find
188            * @return the shopping item price, or <code>null</code> if a shopping item price with the primary key could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public static com.liferay.portlet.shopping.model.ShoppingItemPrice fetchByPrimaryKey(
192                    long itemPriceId)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByPrimaryKey(itemPriceId);
195            }
196    
197            /**
198            * Finds all the shopping item prices where itemId = &#63;.
199            *
200            * @param itemId the item id to search with
201            * @return the matching shopping item prices
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
205                    long itemId) throws com.liferay.portal.kernel.exception.SystemException {
206                    return getPersistence().findByItemId(itemId);
207            }
208    
209            /**
210            * Finds a range of all the shopping item prices where itemId = &#63;.
211            *
212            * <p>
213            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
214            * </p>
215            *
216            * @param itemId the item id to search with
217            * @param start the lower bound of the range of shopping item prices to return
218            * @param end the upper bound of the range of shopping item prices to return (not inclusive)
219            * @return the range of matching shopping item prices
220            * @throws SystemException if a system exception occurred
221            */
222            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
223                    long itemId, int start, int end)
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getPersistence().findByItemId(itemId, start, end);
226            }
227    
228            /**
229            * Finds an ordered range of all the shopping item prices where itemId = &#63;.
230            *
231            * <p>
232            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
233            * </p>
234            *
235            * @param itemId the item id to search with
236            * @param start the lower bound of the range of shopping item prices to return
237            * @param end the upper bound of the range of shopping item prices to return (not inclusive)
238            * @param orderByComparator the comparator to order the results by
239            * @return the ordered range of matching shopping item prices
240            * @throws SystemException if a system exception occurred
241            */
242            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
243                    long itemId, int start, int end,
244                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    return getPersistence()
247                                       .findByItemId(itemId, start, end, orderByComparator);
248            }
249    
250            /**
251            * Finds the first shopping item price in the ordered set where itemId = &#63;.
252            *
253            * <p>
254            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
255            * </p>
256            *
257            * @param itemId the item id to search with
258            * @param orderByComparator the comparator to order the set by
259            * @return the first matching shopping item price
260            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a matching shopping item price could not be found
261            * @throws SystemException if a system exception occurred
262            */
263            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByItemId_First(
264                    long itemId,
265                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266                    throws com.liferay.portal.kernel.exception.SystemException,
267                            com.liferay.portlet.shopping.NoSuchItemPriceException {
268                    return getPersistence().findByItemId_First(itemId, orderByComparator);
269            }
270    
271            /**
272            * Finds the last shopping item price in the ordered set where itemId = &#63;.
273            *
274            * <p>
275            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
276            * </p>
277            *
278            * @param itemId the item id to search with
279            * @param orderByComparator the comparator to order the set by
280            * @return the last matching shopping item price
281            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a matching shopping item price could not be found
282            * @throws SystemException if a system exception occurred
283            */
284            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByItemId_Last(
285                    long itemId,
286                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
287                    throws com.liferay.portal.kernel.exception.SystemException,
288                            com.liferay.portlet.shopping.NoSuchItemPriceException {
289                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
290            }
291    
292            /**
293            * Finds the shopping item prices before and after the current shopping item price in the ordered set where itemId = &#63;.
294            *
295            * <p>
296            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
297            * </p>
298            *
299            * @param itemPriceId the primary key of the current shopping item price
300            * @param itemId the item id to search with
301            * @param orderByComparator the comparator to order the set by
302            * @return the previous, current, and next shopping item price
303            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
304            * @throws SystemException if a system exception occurred
305            */
306            public static com.liferay.portlet.shopping.model.ShoppingItemPrice[] findByItemId_PrevAndNext(
307                    long itemPriceId, long itemId,
308                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
309                    throws com.liferay.portal.kernel.exception.SystemException,
310                            com.liferay.portlet.shopping.NoSuchItemPriceException {
311                    return getPersistence()
312                                       .findByItemId_PrevAndNext(itemPriceId, itemId,
313                            orderByComparator);
314            }
315    
316            /**
317            * Finds all the shopping item prices.
318            *
319            * @return the shopping item prices
320            * @throws SystemException if a system exception occurred
321            */
322            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll()
323                    throws com.liferay.portal.kernel.exception.SystemException {
324                    return getPersistence().findAll();
325            }
326    
327            /**
328            * Finds a range of all the shopping item prices.
329            *
330            * <p>
331            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
332            * </p>
333            *
334            * @param start the lower bound of the range of shopping item prices to return
335            * @param end the upper bound of the range of shopping item prices to return (not inclusive)
336            * @return the range of shopping item prices
337            * @throws SystemException if a system exception occurred
338            */
339            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll(
340                    int start, int end)
341                    throws com.liferay.portal.kernel.exception.SystemException {
342                    return getPersistence().findAll(start, end);
343            }
344    
345            /**
346            * Finds an ordered range of all the shopping item prices.
347            *
348            * <p>
349            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
350            * </p>
351            *
352            * @param start the lower bound of the range of shopping item prices to return
353            * @param end the upper bound of the range of shopping item prices to return (not inclusive)
354            * @param orderByComparator the comparator to order the results by
355            * @return the ordered range of shopping item prices
356            * @throws SystemException if a system exception occurred
357            */
358            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll(
359                    int start, int end,
360                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getPersistence().findAll(start, end, orderByComparator);
363            }
364    
365            /**
366            * Removes all the shopping item prices where itemId = &#63; from the database.
367            *
368            * @param itemId the item id to search with
369            * @throws SystemException if a system exception occurred
370            */
371            public static void removeByItemId(long itemId)
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    getPersistence().removeByItemId(itemId);
374            }
375    
376            /**
377            * Removes all the shopping item prices from the database.
378            *
379            * @throws SystemException if a system exception occurred
380            */
381            public static void removeAll()
382                    throws com.liferay.portal.kernel.exception.SystemException {
383                    getPersistence().removeAll();
384            }
385    
386            /**
387            * Counts all the shopping item prices where itemId = &#63;.
388            *
389            * @param itemId the item id to search with
390            * @return the number of matching shopping item prices
391            * @throws SystemException if a system exception occurred
392            */
393            public static int countByItemId(long itemId)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    return getPersistence().countByItemId(itemId);
396            }
397    
398            /**
399            * Counts all the shopping item prices.
400            *
401            * @return the number of shopping item prices
402            * @throws SystemException if a system exception occurred
403            */
404            public static int countAll()
405                    throws com.liferay.portal.kernel.exception.SystemException {
406                    return getPersistence().countAll();
407            }
408    
409            public static ShoppingItemPricePersistence getPersistence() {
410                    if (_persistence == null) {
411                            _persistence = (ShoppingItemPricePersistence)PortalBeanLocatorUtil.locate(ShoppingItemPricePersistence.class.getName());
412                    }
413    
414                    return _persistence;
415            }
416    
417            public void setPersistence(ShoppingItemPricePersistence persistence) {
418                    _persistence = persistence;
419            }
420    
421            private static ShoppingItemPricePersistence _persistence;
422    }