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