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