001    /**
002     * Copyright (c) 2000-2012 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.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import com.liferay.portlet.shopping.model.ShoppingItemPrice;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the shopping item price service. This utility wraps {@link ShoppingItemPricePersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
030     *
031     * <p>
032     * Caching information and settings can be found in <code>portal.properties</code>
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see ShoppingItemPricePersistence
037     * @see ShoppingItemPricePersistenceImpl
038     * @generated
039     */
040    public class ShoppingItemPriceUtil {
041            /*
042             * NOTE FOR DEVELOPERS:
043             *
044             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
045             */
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
049             */
050            public static void clearCache() {
051                    getPersistence().clearCache();
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
056             */
057            public static void clearCache(ShoppingItemPrice shoppingItemPrice) {
058                    getPersistence().clearCache(shoppingItemPrice);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
063             */
064            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<ShoppingItemPrice> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) throws SystemException {
074                    return getPersistence().findWithDynamicQuery(dynamicQuery);
075            }
076    
077            /**
078             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
079             */
080            public static List<ShoppingItemPrice> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end)
082                    throws SystemException {
083                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
084            }
085    
086            /**
087             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
088             */
089            public static List<ShoppingItemPrice> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator orderByComparator) throws SystemException {
092                    return getPersistence()
093                                       .findWithDynamicQuery(dynamicQuery, start, end,
094                            orderByComparator);
095            }
096    
097            /**
098             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
099             */
100            public static ShoppingItemPrice update(ShoppingItemPrice shoppingItemPrice)
101                    throws SystemException {
102                    return getPersistence().update(shoppingItemPrice);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static ShoppingItemPrice update(
109                    ShoppingItemPrice shoppingItemPrice, ServiceContext serviceContext)
110                    throws SystemException {
111                    return getPersistence().update(shoppingItemPrice, serviceContext);
112            }
113    
114            /**
115            * Returns all the shopping item prices where itemId = &#63;.
116            *
117            * @param itemId the item ID
118            * @return the matching shopping item prices
119            * @throws SystemException if a system exception occurred
120            */
121            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
122                    long itemId) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getPersistence().findByItemId(itemId);
124            }
125    
126            /**
127            * Returns a range of all the shopping item prices where itemId = &#63;.
128            *
129            * <p>
130            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemPriceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
131            * </p>
132            *
133            * @param itemId the item ID
134            * @param start the lower bound of the range of shopping item prices
135            * @param end the upper bound of the range of shopping item prices (not inclusive)
136            * @return the range of matching shopping item prices
137            * @throws SystemException if a system exception occurred
138            */
139            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
140                    long itemId, int start, int end)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getPersistence().findByItemId(itemId, start, end);
143            }
144    
145            /**
146            * Returns an ordered range of all the shopping item prices where itemId = &#63;.
147            *
148            * <p>
149            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemPriceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
150            * </p>
151            *
152            * @param itemId the item ID
153            * @param start the lower bound of the range of shopping item prices
154            * @param end the upper bound of the range of shopping item prices (not inclusive)
155            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
156            * @return the ordered range of matching shopping item prices
157            * @throws SystemException if a system exception occurred
158            */
159            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
160                    long itemId, int start, int end,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence()
164                                       .findByItemId(itemId, start, end, orderByComparator);
165            }
166    
167            /**
168            * Returns the first shopping item price in the ordered set where itemId = &#63;.
169            *
170            * @param itemId the item ID
171            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
172            * @return the first matching shopping item price
173            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a matching shopping item price could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByItemId_First(
177                    long itemId,
178                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.shopping.NoSuchItemPriceException {
181                    return getPersistence().findByItemId_First(itemId, orderByComparator);
182            }
183    
184            /**
185            * Returns the first shopping item price in the ordered set where itemId = &#63;.
186            *
187            * @param itemId the item ID
188            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
189            * @return the first matching shopping item price, or <code>null</code> if a matching shopping item price could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.shopping.model.ShoppingItemPrice fetchByItemId_First(
193                    long itemId,
194                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence().fetchByItemId_First(itemId, orderByComparator);
197            }
198    
199            /**
200            * Returns the last shopping item price in the ordered set where itemId = &#63;.
201            *
202            * @param itemId the item ID
203            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
204            * @return the last matching shopping item price
205            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a matching shopping item price could not be found
206            * @throws SystemException if a system exception occurred
207            */
208            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByItemId_Last(
209                    long itemId,
210                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
211                    throws com.liferay.portal.kernel.exception.SystemException,
212                            com.liferay.portlet.shopping.NoSuchItemPriceException {
213                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
214            }
215    
216            /**
217            * Returns the last shopping item price in the ordered set where itemId = &#63;.
218            *
219            * @param itemId the item ID
220            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
221            * @return the last matching shopping item price, or <code>null</code> if a matching shopping item price could not be found
222            * @throws SystemException if a system exception occurred
223            */
224            public static com.liferay.portlet.shopping.model.ShoppingItemPrice fetchByItemId_Last(
225                    long itemId,
226                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().fetchByItemId_Last(itemId, orderByComparator);
229            }
230    
231            /**
232            * Returns the shopping item prices before and after the current shopping item price in the ordered set where itemId = &#63;.
233            *
234            * @param itemPriceId the primary key of the current shopping item price
235            * @param itemId the item ID
236            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
237            * @return the previous, current, and next shopping item price
238            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portlet.shopping.model.ShoppingItemPrice[] findByItemId_PrevAndNext(
242                    long itemPriceId, long itemId,
243                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
244                    throws com.liferay.portal.kernel.exception.SystemException,
245                            com.liferay.portlet.shopping.NoSuchItemPriceException {
246                    return getPersistence()
247                                       .findByItemId_PrevAndNext(itemPriceId, itemId,
248                            orderByComparator);
249            }
250    
251            /**
252            * Removes all the shopping item prices where itemId = &#63; from the database.
253            *
254            * @param itemId the item ID
255            * @throws SystemException if a system exception occurred
256            */
257            public static void removeByItemId(long itemId)
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    getPersistence().removeByItemId(itemId);
260            }
261    
262            /**
263            * Returns the number of shopping item prices where itemId = &#63;.
264            *
265            * @param itemId the item ID
266            * @return the number of matching shopping item prices
267            * @throws SystemException if a system exception occurred
268            */
269            public static int countByItemId(long itemId)
270                    throws com.liferay.portal.kernel.exception.SystemException {
271                    return getPersistence().countByItemId(itemId);
272            }
273    
274            /**
275            * Caches the shopping item price in the entity cache if it is enabled.
276            *
277            * @param shoppingItemPrice the shopping item price
278            */
279            public static void cacheResult(
280                    com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice) {
281                    getPersistence().cacheResult(shoppingItemPrice);
282            }
283    
284            /**
285            * Caches the shopping item prices in the entity cache if it is enabled.
286            *
287            * @param shoppingItemPrices the shopping item prices
288            */
289            public static void cacheResult(
290                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> shoppingItemPrices) {
291                    getPersistence().cacheResult(shoppingItemPrices);
292            }
293    
294            /**
295            * Creates a new shopping item price with the primary key. Does not add the shopping item price to the database.
296            *
297            * @param itemPriceId the primary key for the new shopping item price
298            * @return the new shopping item price
299            */
300            public static com.liferay.portlet.shopping.model.ShoppingItemPrice create(
301                    long itemPriceId) {
302                    return getPersistence().create(itemPriceId);
303            }
304    
305            /**
306            * Removes the shopping item price with the primary key from the database. Also notifies the appropriate model listeners.
307            *
308            * @param itemPriceId the primary key of the shopping item price
309            * @return the shopping item price that was removed
310            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
311            * @throws SystemException if a system exception occurred
312            */
313            public static com.liferay.portlet.shopping.model.ShoppingItemPrice remove(
314                    long itemPriceId)
315                    throws com.liferay.portal.kernel.exception.SystemException,
316                            com.liferay.portlet.shopping.NoSuchItemPriceException {
317                    return getPersistence().remove(itemPriceId);
318            }
319    
320            public static com.liferay.portlet.shopping.model.ShoppingItemPrice updateImpl(
321                    com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice)
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    return getPersistence().updateImpl(shoppingItemPrice);
324            }
325    
326            /**
327            * Returns the shopping item price with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchItemPriceException} if it could not be found.
328            *
329            * @param itemPriceId the primary key of the shopping item price
330            * @return the shopping item price
331            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
332            * @throws SystemException if a system exception occurred
333            */
334            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByPrimaryKey(
335                    long itemPriceId)
336                    throws com.liferay.portal.kernel.exception.SystemException,
337                            com.liferay.portlet.shopping.NoSuchItemPriceException {
338                    return getPersistence().findByPrimaryKey(itemPriceId);
339            }
340    
341            /**
342            * Returns the shopping item price with the primary key or returns <code>null</code> if it could not be found.
343            *
344            * @param itemPriceId the primary key of the shopping item price
345            * @return the shopping item price, or <code>null</code> if a shopping item price with the primary key could not be found
346            * @throws SystemException if a system exception occurred
347            */
348            public static com.liferay.portlet.shopping.model.ShoppingItemPrice fetchByPrimaryKey(
349                    long itemPriceId)
350                    throws com.liferay.portal.kernel.exception.SystemException {
351                    return getPersistence().fetchByPrimaryKey(itemPriceId);
352            }
353    
354            /**
355            * Returns all the shopping item prices.
356            *
357            * @return the shopping item prices
358            * @throws SystemException if a system exception occurred
359            */
360            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll()
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getPersistence().findAll();
363            }
364    
365            /**
366            * Returns a range of all the shopping item prices.
367            *
368            * <p>
369            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemPriceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
370            * </p>
371            *
372            * @param start the lower bound of the range of shopping item prices
373            * @param end the upper bound of the range of shopping item prices (not inclusive)
374            * @return the range of shopping item prices
375            * @throws SystemException if a system exception occurred
376            */
377            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll(
378                    int start, int end)
379                    throws com.liferay.portal.kernel.exception.SystemException {
380                    return getPersistence().findAll(start, end);
381            }
382    
383            /**
384            * Returns an ordered range of all the shopping item prices.
385            *
386            * <p>
387            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemPriceModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
388            * </p>
389            *
390            * @param start the lower bound of the range of shopping item prices
391            * @param end the upper bound of the range of shopping item prices (not inclusive)
392            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
393            * @return the ordered range of shopping item prices
394            * @throws SystemException if a system exception occurred
395            */
396            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll(
397                    int start, int end,
398                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
399                    throws com.liferay.portal.kernel.exception.SystemException {
400                    return getPersistence().findAll(start, end, orderByComparator);
401            }
402    
403            /**
404            * Removes all the shopping item prices from the database.
405            *
406            * @throws SystemException if a system exception occurred
407            */
408            public static void removeAll()
409                    throws com.liferay.portal.kernel.exception.SystemException {
410                    getPersistence().removeAll();
411            }
412    
413            /**
414            * Returns the number of shopping item prices.
415            *
416            * @return the number of shopping item prices
417            * @throws SystemException if a system exception occurred
418            */
419            public static int countAll()
420                    throws com.liferay.portal.kernel.exception.SystemException {
421                    return getPersistence().countAll();
422            }
423    
424            public static ShoppingItemPricePersistence getPersistence() {
425                    if (_persistence == null) {
426                            _persistence = (ShoppingItemPricePersistence)PortalBeanLocatorUtil.locate(ShoppingItemPricePersistence.class.getName());
427    
428                            ReferenceRegistry.registerReference(ShoppingItemPriceUtil.class,
429                                    "_persistence");
430                    }
431    
432                    return _persistence;
433            }
434    
435            /**
436             * @deprecated
437             */
438            public void setPersistence(ShoppingItemPricePersistence persistence) {
439            }
440    
441            private static ShoppingItemPricePersistence _persistence;
442    }