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