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.ShoppingOrderItem;
026    
027    import java.util.List;
028    
029    /**
030     * The persistence utility for the shopping order item service. This utility wraps {@link ShoppingOrderItemPersistenceImpl} 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 ShoppingOrderItemPersistence
038     * @see ShoppingOrderItemPersistenceImpl
039     * @generated
040     */
041    @ProviderType
042    public class ShoppingOrderItemUtil {
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(ShoppingOrderItem shoppingOrderItem) {
060                    getPersistence().clearCache(shoppingOrderItem);
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<ShoppingOrderItem> 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<ShoppingOrderItem> 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<ShoppingOrderItem> findWithDynamicQuery(
090                    DynamicQuery dynamicQuery, int start, int end,
091                    OrderByComparator<ShoppingOrderItem> 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 ShoppingOrderItem update(ShoppingOrderItem shoppingOrderItem) {
101                    return getPersistence().update(shoppingOrderItem);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static ShoppingOrderItem update(
108                    ShoppingOrderItem shoppingOrderItem, ServiceContext serviceContext) {
109                    return getPersistence().update(shoppingOrderItem, serviceContext);
110            }
111    
112            /**
113            * Returns all the shopping order items where orderId = &#63;.
114            *
115            * @param orderId the order ID
116            * @return the matching shopping order items
117            */
118            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findByOrderId(
119                    long orderId) {
120                    return getPersistence().findByOrderId(orderId);
121            }
122    
123            /**
124            * Returns a range of all the shopping order items where orderId = &#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.ShoppingOrderItemModelImpl}. 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 orderId the order ID
131            * @param start the lower bound of the range of shopping order items
132            * @param end the upper bound of the range of shopping order items (not inclusive)
133            * @return the range of matching shopping order items
134            */
135            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findByOrderId(
136                    long orderId, int start, int end) {
137                    return getPersistence().findByOrderId(orderId, start, end);
138            }
139    
140            /**
141            * Returns an ordered range of all the shopping order items where orderId = &#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.ShoppingOrderItemModelImpl}. 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 orderId the order ID
148            * @param start the lower bound of the range of shopping order items
149            * @param end the upper bound of the range of shopping order items (not inclusive)
150            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
151            * @return the ordered range of matching shopping order items
152            */
153            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findByOrderId(
154                    long orderId, int start, int end,
155                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingOrderItem> orderByComparator) {
156                    return getPersistence()
157                                       .findByOrderId(orderId, start, end, orderByComparator);
158            }
159    
160            /**
161            * Returns the first shopping order item in the ordered set where orderId = &#63;.
162            *
163            * @param orderId the order ID
164            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
165            * @return the first matching shopping order item
166            * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a matching shopping order item could not be found
167            */
168            public static com.liferay.portlet.shopping.model.ShoppingOrderItem findByOrderId_First(
169                    long orderId,
170                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingOrderItem> orderByComparator)
171                    throws com.liferay.portlet.shopping.NoSuchOrderItemException {
172                    return getPersistence().findByOrderId_First(orderId, orderByComparator);
173            }
174    
175            /**
176            * Returns the first shopping order item in the ordered set where orderId = &#63;.
177            *
178            * @param orderId the order ID
179            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
180            * @return the first matching shopping order item, or <code>null</code> if a matching shopping order item could not be found
181            */
182            public static com.liferay.portlet.shopping.model.ShoppingOrderItem fetchByOrderId_First(
183                    long orderId,
184                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingOrderItem> orderByComparator) {
185                    return getPersistence().fetchByOrderId_First(orderId, orderByComparator);
186            }
187    
188            /**
189            * Returns the last shopping order item in the ordered set where orderId = &#63;.
190            *
191            * @param orderId the order ID
192            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
193            * @return the last matching shopping order item
194            * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a matching shopping order item could not be found
195            */
196            public static com.liferay.portlet.shopping.model.ShoppingOrderItem findByOrderId_Last(
197                    long orderId,
198                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingOrderItem> orderByComparator)
199                    throws com.liferay.portlet.shopping.NoSuchOrderItemException {
200                    return getPersistence().findByOrderId_Last(orderId, orderByComparator);
201            }
202    
203            /**
204            * Returns the last shopping order item in the ordered set where orderId = &#63;.
205            *
206            * @param orderId the order ID
207            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
208            * @return the last matching shopping order item, or <code>null</code> if a matching shopping order item could not be found
209            */
210            public static com.liferay.portlet.shopping.model.ShoppingOrderItem fetchByOrderId_Last(
211                    long orderId,
212                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingOrderItem> orderByComparator) {
213                    return getPersistence().fetchByOrderId_Last(orderId, orderByComparator);
214            }
215    
216            /**
217            * Returns the shopping order items before and after the current shopping order item in the ordered set where orderId = &#63;.
218            *
219            * @param orderItemId the primary key of the current shopping order item
220            * @param orderId the order ID
221            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
222            * @return the previous, current, and next shopping order item
223            * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a shopping order item with the primary key could not be found
224            */
225            public static com.liferay.portlet.shopping.model.ShoppingOrderItem[] findByOrderId_PrevAndNext(
226                    long orderItemId, long orderId,
227                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingOrderItem> orderByComparator)
228                    throws com.liferay.portlet.shopping.NoSuchOrderItemException {
229                    return getPersistence()
230                                       .findByOrderId_PrevAndNext(orderItemId, orderId,
231                            orderByComparator);
232            }
233    
234            /**
235            * Removes all the shopping order items where orderId = &#63; from the database.
236            *
237            * @param orderId the order ID
238            */
239            public static void removeByOrderId(long orderId) {
240                    getPersistence().removeByOrderId(orderId);
241            }
242    
243            /**
244            * Returns the number of shopping order items where orderId = &#63;.
245            *
246            * @param orderId the order ID
247            * @return the number of matching shopping order items
248            */
249            public static int countByOrderId(long orderId) {
250                    return getPersistence().countByOrderId(orderId);
251            }
252    
253            /**
254            * Caches the shopping order item in the entity cache if it is enabled.
255            *
256            * @param shoppingOrderItem the shopping order item
257            */
258            public static void cacheResult(
259                    com.liferay.portlet.shopping.model.ShoppingOrderItem shoppingOrderItem) {
260                    getPersistence().cacheResult(shoppingOrderItem);
261            }
262    
263            /**
264            * Caches the shopping order items in the entity cache if it is enabled.
265            *
266            * @param shoppingOrderItems the shopping order items
267            */
268            public static void cacheResult(
269                    java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> shoppingOrderItems) {
270                    getPersistence().cacheResult(shoppingOrderItems);
271            }
272    
273            /**
274            * Creates a new shopping order item with the primary key. Does not add the shopping order item to the database.
275            *
276            * @param orderItemId the primary key for the new shopping order item
277            * @return the new shopping order item
278            */
279            public static com.liferay.portlet.shopping.model.ShoppingOrderItem create(
280                    long orderItemId) {
281                    return getPersistence().create(orderItemId);
282            }
283    
284            /**
285            * Removes the shopping order item with the primary key from the database. Also notifies the appropriate model listeners.
286            *
287            * @param orderItemId the primary key of the shopping order item
288            * @return the shopping order item that was removed
289            * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a shopping order item with the primary key could not be found
290            */
291            public static com.liferay.portlet.shopping.model.ShoppingOrderItem remove(
292                    long orderItemId)
293                    throws com.liferay.portlet.shopping.NoSuchOrderItemException {
294                    return getPersistence().remove(orderItemId);
295            }
296    
297            public static com.liferay.portlet.shopping.model.ShoppingOrderItem updateImpl(
298                    com.liferay.portlet.shopping.model.ShoppingOrderItem shoppingOrderItem) {
299                    return getPersistence().updateImpl(shoppingOrderItem);
300            }
301    
302            /**
303            * Returns the shopping order item with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchOrderItemException} if it could not be found.
304            *
305            * @param orderItemId the primary key of the shopping order item
306            * @return the shopping order item
307            * @throws com.liferay.portlet.shopping.NoSuchOrderItemException if a shopping order item with the primary key could not be found
308            */
309            public static com.liferay.portlet.shopping.model.ShoppingOrderItem findByPrimaryKey(
310                    long orderItemId)
311                    throws com.liferay.portlet.shopping.NoSuchOrderItemException {
312                    return getPersistence().findByPrimaryKey(orderItemId);
313            }
314    
315            /**
316            * Returns the shopping order item with the primary key or returns <code>null</code> if it could not be found.
317            *
318            * @param orderItemId the primary key of the shopping order item
319            * @return the shopping order item, or <code>null</code> if a shopping order item with the primary key could not be found
320            */
321            public static com.liferay.portlet.shopping.model.ShoppingOrderItem fetchByPrimaryKey(
322                    long orderItemId) {
323                    return getPersistence().fetchByPrimaryKey(orderItemId);
324            }
325    
326            public static java.util.Map<java.io.Serializable, com.liferay.portlet.shopping.model.ShoppingOrderItem> fetchByPrimaryKeys(
327                    java.util.Set<java.io.Serializable> primaryKeys) {
328                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
329            }
330    
331            /**
332            * Returns all the shopping order items.
333            *
334            * @return the shopping order items
335            */
336            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findAll() {
337                    return getPersistence().findAll();
338            }
339    
340            /**
341            * Returns a range of all the shopping order items.
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.ShoppingOrderItemModelImpl}. 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 order items
348            * @param end the upper bound of the range of shopping order items (not inclusive)
349            * @return the range of shopping order items
350            */
351            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findAll(
352                    int start, int end) {
353                    return getPersistence().findAll(start, end);
354            }
355    
356            /**
357            * Returns an ordered range of all the shopping order items.
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.ShoppingOrderItemModelImpl}. 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 order items
364            * @param end the upper bound of the range of shopping order items (not inclusive)
365            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
366            * @return the ordered range of shopping order items
367            */
368            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingOrderItem> findAll(
369                    int start, int end,
370                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portlet.shopping.model.ShoppingOrderItem> orderByComparator) {
371                    return getPersistence().findAll(start, end, orderByComparator);
372            }
373    
374            /**
375            * Removes all the shopping order items from the database.
376            */
377            public static void removeAll() {
378                    getPersistence().removeAll();
379            }
380    
381            /**
382            * Returns the number of shopping order items.
383            *
384            * @return the number of shopping order items
385            */
386            public static int countAll() {
387                    return getPersistence().countAll();
388            }
389    
390            public static ShoppingOrderItemPersistence getPersistence() {
391                    if (_persistence == null) {
392                            _persistence = (ShoppingOrderItemPersistence)PortalBeanLocatorUtil.locate(ShoppingOrderItemPersistence.class.getName());
393    
394                            ReferenceRegistry.registerReference(ShoppingOrderItemUtil.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(ShoppingOrderItemPersistence persistence) {
406            }
407    
408            private static ShoppingOrderItemPersistence _persistence;
409    }