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