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, boolean)
099             */
100            public static ShoppingItemPrice update(
101                    ShoppingItemPrice shoppingItemPrice, boolean merge)
102                    throws SystemException {
103                    return getPersistence().update(shoppingItemPrice, merge);
104            }
105    
106            /**
107             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
108             */
109            public static ShoppingItemPrice update(
110                    ShoppingItemPrice shoppingItemPrice, boolean merge,
111                    ServiceContext serviceContext) throws SystemException {
112                    return getPersistence().update(shoppingItemPrice, merge, serviceContext);
113            }
114    
115            /**
116            * Caches the shopping item price in the entity cache if it is enabled.
117            *
118            * @param shoppingItemPrice the shopping item price
119            */
120            public static void cacheResult(
121                    com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice) {
122                    getPersistence().cacheResult(shoppingItemPrice);
123            }
124    
125            /**
126            * Caches the shopping item prices in the entity cache if it is enabled.
127            *
128            * @param shoppingItemPrices the shopping item prices
129            */
130            public static void cacheResult(
131                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> shoppingItemPrices) {
132                    getPersistence().cacheResult(shoppingItemPrices);
133            }
134    
135            /**
136            * Creates a new shopping item price with the primary key. Does not add the shopping item price to the database.
137            *
138            * @param itemPriceId the primary key for the new shopping item price
139            * @return the new shopping item price
140            */
141            public static com.liferay.portlet.shopping.model.ShoppingItemPrice create(
142                    long itemPriceId) {
143                    return getPersistence().create(itemPriceId);
144            }
145    
146            /**
147            * Removes the shopping item price with the primary key from the database. Also notifies the appropriate model listeners.
148            *
149            * @param itemPriceId the primary key of the shopping item price
150            * @return the shopping item price that was removed
151            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
152            * @throws SystemException if a system exception occurred
153            */
154            public static com.liferay.portlet.shopping.model.ShoppingItemPrice remove(
155                    long itemPriceId)
156                    throws com.liferay.portal.kernel.exception.SystemException,
157                            com.liferay.portlet.shopping.NoSuchItemPriceException {
158                    return getPersistence().remove(itemPriceId);
159            }
160    
161            public static com.liferay.portlet.shopping.model.ShoppingItemPrice updateImpl(
162                    com.liferay.portlet.shopping.model.ShoppingItemPrice shoppingItemPrice,
163                    boolean merge)
164                    throws com.liferay.portal.kernel.exception.SystemException {
165                    return getPersistence().updateImpl(shoppingItemPrice, merge);
166            }
167    
168            /**
169            * Returns the shopping item price with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchItemPriceException} if it could not be found.
170            *
171            * @param itemPriceId the primary key of the shopping item price
172            * @return the shopping item price
173            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByPrimaryKey(
177                    long itemPriceId)
178                    throws com.liferay.portal.kernel.exception.SystemException,
179                            com.liferay.portlet.shopping.NoSuchItemPriceException {
180                    return getPersistence().findByPrimaryKey(itemPriceId);
181            }
182    
183            /**
184            * Returns the shopping item price with the primary key or returns <code>null</code> if it could not be found.
185            *
186            * @param itemPriceId the primary key of the shopping item price
187            * @return the shopping item price, or <code>null</code> if a shopping item price with the primary key could not be found
188            * @throws SystemException if a system exception occurred
189            */
190            public static com.liferay.portlet.shopping.model.ShoppingItemPrice fetchByPrimaryKey(
191                    long itemPriceId)
192                    throws com.liferay.portal.kernel.exception.SystemException {
193                    return getPersistence().fetchByPrimaryKey(itemPriceId);
194            }
195    
196            /**
197            * Returns all the shopping item prices where itemId = &#63;.
198            *
199            * @param itemId the item ID
200            * @return the matching shopping item prices
201            * @throws SystemException if a system exception occurred
202            */
203            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
204                    long itemId) throws com.liferay.portal.kernel.exception.SystemException {
205                    return getPersistence().findByItemId(itemId);
206            }
207    
208            /**
209            * Returns a range of all the shopping item prices where itemId = &#63;.
210            *
211            * <p>
212            * 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.
213            * </p>
214            *
215            * @param itemId the item ID
216            * @param start the lower bound of the range of shopping item prices
217            * @param end the upper bound of the range of shopping item prices (not inclusive)
218            * @return the range of matching shopping item prices
219            * @throws SystemException if a system exception occurred
220            */
221            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
222                    long itemId, int start, int end)
223                    throws com.liferay.portal.kernel.exception.SystemException {
224                    return getPersistence().findByItemId(itemId, start, end);
225            }
226    
227            /**
228            * Returns an ordered range of all the shopping item prices where itemId = &#63;.
229            *
230            * <p>
231            * 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.
232            * </p>
233            *
234            * @param itemId the item ID
235            * @param start the lower bound of the range of shopping item prices
236            * @param end the upper bound of the range of shopping item prices (not inclusive)
237            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
238            * @return the ordered range of matching shopping item prices
239            * @throws SystemException if a system exception occurred
240            */
241            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findByItemId(
242                    long itemId, int start, int end,
243                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
244                    throws com.liferay.portal.kernel.exception.SystemException {
245                    return getPersistence()
246                                       .findByItemId(itemId, start, end, orderByComparator);
247            }
248    
249            /**
250            * Returns the first shopping item price in the ordered set where itemId = &#63;.
251            *
252            * <p>
253            * 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.
254            * </p>
255            *
256            * @param itemId the item ID
257            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
258            * @return the first matching shopping item price
259            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a matching shopping item price could not be found
260            * @throws SystemException if a system exception occurred
261            */
262            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByItemId_First(
263                    long itemId,
264                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
265                    throws com.liferay.portal.kernel.exception.SystemException,
266                            com.liferay.portlet.shopping.NoSuchItemPriceException {
267                    return getPersistence().findByItemId_First(itemId, orderByComparator);
268            }
269    
270            /**
271            * Returns the last shopping item price in the ordered set where itemId = &#63;.
272            *
273            * <p>
274            * 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.
275            * </p>
276            *
277            * @param itemId the item ID
278            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
279            * @return the last matching shopping item price
280            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a matching shopping item price could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public static com.liferay.portlet.shopping.model.ShoppingItemPrice findByItemId_Last(
284                    long itemId,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.kernel.exception.SystemException,
287                            com.liferay.portlet.shopping.NoSuchItemPriceException {
288                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
289            }
290    
291            /**
292            * Returns the shopping item prices before and after the current shopping item price in the ordered set where itemId = &#63;.
293            *
294            * <p>
295            * 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.
296            * </p>
297            *
298            * @param itemPriceId the primary key of the current shopping item price
299            * @param itemId the item ID
300            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
301            * @return the previous, current, and next shopping item price
302            * @throws com.liferay.portlet.shopping.NoSuchItemPriceException if a shopping item price with the primary key could not be found
303            * @throws SystemException if a system exception occurred
304            */
305            public static com.liferay.portlet.shopping.model.ShoppingItemPrice[] findByItemId_PrevAndNext(
306                    long itemPriceId, long itemId,
307                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
308                    throws com.liferay.portal.kernel.exception.SystemException,
309                            com.liferay.portlet.shopping.NoSuchItemPriceException {
310                    return getPersistence()
311                                       .findByItemId_PrevAndNext(itemPriceId, itemId,
312                            orderByComparator);
313            }
314    
315            /**
316            * Returns all the shopping item prices.
317            *
318            * @return the shopping item prices
319            * @throws SystemException if a system exception occurred
320            */
321            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll()
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    return getPersistence().findAll();
324            }
325    
326            /**
327            * Returns a range of all the shopping item prices.
328            *
329            * <p>
330            * 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.
331            * </p>
332            *
333            * @param start the lower bound of the range of shopping item prices
334            * @param end the upper bound of the range of shopping item prices (not inclusive)
335            * @return the range of shopping item prices
336            * @throws SystemException if a system exception occurred
337            */
338            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll(
339                    int start, int end)
340                    throws com.liferay.portal.kernel.exception.SystemException {
341                    return getPersistence().findAll(start, end);
342            }
343    
344            /**
345            * Returns an ordered range of all the shopping item prices.
346            *
347            * <p>
348            * 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.
349            * </p>
350            *
351            * @param start the lower bound of the range of shopping item prices
352            * @param end the upper bound of the range of shopping item prices (not inclusive)
353            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
354            * @return the ordered range of shopping item prices
355            * @throws SystemException if a system exception occurred
356            */
357            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemPrice> findAll(
358                    int start, int end,
359                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
360                    throws com.liferay.portal.kernel.exception.SystemException {
361                    return getPersistence().findAll(start, end, orderByComparator);
362            }
363    
364            /**
365            * Removes all the shopping item prices where itemId = &#63; from the database.
366            *
367            * @param itemId the item ID
368            * @throws SystemException if a system exception occurred
369            */
370            public static void removeByItemId(long itemId)
371                    throws com.liferay.portal.kernel.exception.SystemException {
372                    getPersistence().removeByItemId(itemId);
373            }
374    
375            /**
376            * Removes all the shopping item prices from the database.
377            *
378            * @throws SystemException if a system exception occurred
379            */
380            public static void removeAll()
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    getPersistence().removeAll();
383            }
384    
385            /**
386            * Returns the number of shopping item prices where itemId = &#63;.
387            *
388            * @param itemId the item ID
389            * @return the number of matching shopping item prices
390            * @throws SystemException if a system exception occurred
391            */
392            public static int countByItemId(long itemId)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getPersistence().countByItemId(itemId);
395            }
396    
397            /**
398            * Returns the number of shopping item prices.
399            *
400            * @return the number of shopping item prices
401            * @throws SystemException if a system exception occurred
402            */
403            public static int countAll()
404                    throws com.liferay.portal.kernel.exception.SystemException {
405                    return getPersistence().countAll();
406            }
407    
408            public static ShoppingItemPricePersistence getPersistence() {
409                    if (_persistence == null) {
410                            _persistence = (ShoppingItemPricePersistence)PortalBeanLocatorUtil.locate(ShoppingItemPricePersistence.class.getName());
411    
412                            ReferenceRegistry.registerReference(ShoppingItemPriceUtil.class,
413                                    "_persistence");
414                    }
415    
416                    return _persistence;
417            }
418    
419            public void setPersistence(ShoppingItemPricePersistence persistence) {
420                    _persistence = persistence;
421    
422                    ReferenceRegistry.registerReference(ShoppingItemPriceUtil.class,
423                            "_persistence");
424            }
425    
426            private static ShoppingItemPricePersistence _persistence;
427    }