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