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