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