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