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.ShoppingItemField;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the shopping item field service.
029     *
030     * <p>
031     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ShoppingItemFieldPersistence
036     * @see ShoppingItemFieldPersistenceImpl
037     * @generated
038     */
039    public class ShoppingItemFieldUtil {
040            /**
041             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
042             */
043            public static void clearCache() {
044                    getPersistence().clearCache();
045            }
046    
047            /**
048             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
049             */
050            public static void clearCache(ShoppingItemField shoppingItemField) {
051                    getPersistence().clearCache(shoppingItemField);
052            }
053    
054            /**
055             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
056             */
057            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
058                    throws SystemException {
059                    return getPersistence().countWithDynamicQuery(dynamicQuery);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
064             */
065            public static List<ShoppingItemField> findWithDynamicQuery(
066                    DynamicQuery dynamicQuery) throws SystemException {
067                    return getPersistence().findWithDynamicQuery(dynamicQuery);
068            }
069    
070            /**
071             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
072             */
073            public static List<ShoppingItemField> findWithDynamicQuery(
074                    DynamicQuery dynamicQuery, int start, int end)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
081             */
082            public static List<ShoppingItemField> findWithDynamicQuery(
083                    DynamicQuery dynamicQuery, int start, int end,
084                    OrderByComparator orderByComparator) throws SystemException {
085                    return getPersistence()
086                                       .findWithDynamicQuery(dynamicQuery, start, end,
087                            orderByComparator);
088            }
089    
090            /**
091             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
092             */
093            public static ShoppingItemField remove(ShoppingItemField shoppingItemField)
094                    throws SystemException {
095                    return getPersistence().remove(shoppingItemField);
096            }
097    
098            /**
099             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
100             */
101            public static ShoppingItemField update(
102                    ShoppingItemField shoppingItemField, boolean merge)
103                    throws SystemException {
104                    return getPersistence().update(shoppingItemField, merge);
105            }
106    
107            /**
108             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
109             */
110            public static ShoppingItemField update(
111                    ShoppingItemField shoppingItemField, boolean merge,
112                    ServiceContext serviceContext) throws SystemException {
113                    return getPersistence().update(shoppingItemField, merge, serviceContext);
114            }
115    
116            /**
117            * Caches the shopping item field in the entity cache if it is enabled.
118            *
119            * @param shoppingItemField the shopping item field to cache
120            */
121            public static void cacheResult(
122                    com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField) {
123                    getPersistence().cacheResult(shoppingItemField);
124            }
125    
126            /**
127            * Caches the shopping item fields in the entity cache if it is enabled.
128            *
129            * @param shoppingItemFields the shopping item fields to cache
130            */
131            public static void cacheResult(
132                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> shoppingItemFields) {
133                    getPersistence().cacheResult(shoppingItemFields);
134            }
135    
136            /**
137            * Creates a new shopping item field with the primary key.
138            *
139            * @param itemFieldId the primary key for the new shopping item field
140            * @return the new shopping item field
141            */
142            public static com.liferay.portlet.shopping.model.ShoppingItemField create(
143                    long itemFieldId) {
144                    return getPersistence().create(itemFieldId);
145            }
146    
147            /**
148            * Removes the shopping item field with the primary key from the database. Also notifies the appropriate model listeners.
149            *
150            * @param itemFieldId the primary key of the shopping item field to remove
151            * @return the shopping item field that was removed
152            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
153            * @throws SystemException if a system exception occurred
154            */
155            public static com.liferay.portlet.shopping.model.ShoppingItemField remove(
156                    long itemFieldId)
157                    throws com.liferay.portal.kernel.exception.SystemException,
158                            com.liferay.portlet.shopping.NoSuchItemFieldException {
159                    return getPersistence().remove(itemFieldId);
160            }
161    
162            public static com.liferay.portlet.shopping.model.ShoppingItemField updateImpl(
163                    com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField,
164                    boolean merge)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence().updateImpl(shoppingItemField, merge);
167            }
168    
169            /**
170            * Finds the shopping item field with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchItemFieldException} if it could not be found.
171            *
172            * @param itemFieldId the primary key of the shopping item field to find
173            * @return the shopping item field
174            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public static com.liferay.portlet.shopping.model.ShoppingItemField findByPrimaryKey(
178                    long itemFieldId)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.shopping.NoSuchItemFieldException {
181                    return getPersistence().findByPrimaryKey(itemFieldId);
182            }
183    
184            /**
185            * Finds the shopping item field with the primary key or returns <code>null</code> if it could not be found.
186            *
187            * @param itemFieldId the primary key of the shopping item field to find
188            * @return the shopping item field, or <code>null</code> if a shopping item field with the primary key could not be found
189            * @throws SystemException if a system exception occurred
190            */
191            public static com.liferay.portlet.shopping.model.ShoppingItemField fetchByPrimaryKey(
192                    long itemFieldId)
193                    throws com.liferay.portal.kernel.exception.SystemException {
194                    return getPersistence().fetchByPrimaryKey(itemFieldId);
195            }
196    
197            /**
198            * Finds all the shopping item fields where itemId = &#63;.
199            *
200            * @param itemId the item id to search with
201            * @return the matching shopping item fields
202            * @throws SystemException if a system exception occurred
203            */
204            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
205                    long itemId) throws com.liferay.portal.kernel.exception.SystemException {
206                    return getPersistence().findByItemId(itemId);
207            }
208    
209            /**
210            * Finds a range of all the shopping item fields where itemId = &#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 itemId the item id to search with
217            * @param start the lower bound of the range of shopping item fields to return
218            * @param end the upper bound of the range of shopping item fields to return (not inclusive)
219            * @return the range of matching shopping item fields
220            * @throws SystemException if a system exception occurred
221            */
222            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
223                    long itemId, int start, int end)
224                    throws com.liferay.portal.kernel.exception.SystemException {
225                    return getPersistence().findByItemId(itemId, start, end);
226            }
227    
228            /**
229            * Finds an ordered range of all the shopping item fields where itemId = &#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 itemId the item id to search with
236            * @param start the lower bound of the range of shopping item fields to return
237            * @param end the upper bound of the range of shopping item fields to return (not inclusive)
238            * @param orderByComparator the comparator to order the results by
239            * @return the ordered range of matching shopping item fields
240            * @throws SystemException if a system exception occurred
241            */
242            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
243                    long itemId, int start, int end,
244                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    return getPersistence()
247                                       .findByItemId(itemId, start, end, orderByComparator);
248            }
249    
250            /**
251            * Finds the first shopping item field in the ordered set where itemId = &#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 itemId the item id to search with
258            * @param orderByComparator the comparator to order the set by
259            * @return the first matching shopping item field
260            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
261            * @throws SystemException if a system exception occurred
262            */
263            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_First(
264                    long itemId,
265                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266                    throws com.liferay.portal.kernel.exception.SystemException,
267                            com.liferay.portlet.shopping.NoSuchItemFieldException {
268                    return getPersistence().findByItemId_First(itemId, orderByComparator);
269            }
270    
271            /**
272            * Finds the last shopping item field in the ordered set where itemId = &#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 itemId the item id to search with
279            * @param orderByComparator the comparator to order the set by
280            * @return the last matching shopping item field
281            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
282            * @throws SystemException if a system exception occurred
283            */
284            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_Last(
285                    long itemId,
286                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
287                    throws com.liferay.portal.kernel.exception.SystemException,
288                            com.liferay.portlet.shopping.NoSuchItemFieldException {
289                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
290            }
291    
292            /**
293            * Finds the shopping item fields before and after the current shopping item field in the ordered set where itemId = &#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 itemFieldId the primary key of the current shopping item field
300            * @param itemId the item id to search with
301            * @param orderByComparator the comparator to order the set by
302            * @return the previous, current, and next shopping item field
303            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field 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.ShoppingItemField[] findByItemId_PrevAndNext(
307                    long itemFieldId, long itemId,
308                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
309                    throws com.liferay.portal.kernel.exception.SystemException,
310                            com.liferay.portlet.shopping.NoSuchItemFieldException {
311                    return getPersistence()
312                                       .findByItemId_PrevAndNext(itemFieldId, itemId,
313                            orderByComparator);
314            }
315    
316            /**
317            * Finds all the shopping item fields.
318            *
319            * @return the shopping item fields
320            * @throws SystemException if a system exception occurred
321            */
322            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll()
323                    throws com.liferay.portal.kernel.exception.SystemException {
324                    return getPersistence().findAll();
325            }
326    
327            /**
328            * Finds a range of all the shopping item fields.
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 item fields to return
335            * @param end the upper bound of the range of shopping item fields to return (not inclusive)
336            * @return the range of shopping item fields
337            * @throws SystemException if a system exception occurred
338            */
339            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll(
340                    int start, int end)
341                    throws com.liferay.portal.kernel.exception.SystemException {
342                    return getPersistence().findAll(start, end);
343            }
344    
345            /**
346            * Finds an ordered range of all the shopping item fields.
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 item fields to return
353            * @param end the upper bound of the range of shopping item fields to return (not inclusive)
354            * @param orderByComparator the comparator to order the results by
355            * @return the ordered range of shopping item fields
356            * @throws SystemException if a system exception occurred
357            */
358            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> 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 item fields where itemId = &#63; from the database.
367            *
368            * @param itemId the item id to search with
369            * @throws SystemException if a system exception occurred
370            */
371            public static void removeByItemId(long itemId)
372                    throws com.liferay.portal.kernel.exception.SystemException {
373                    getPersistence().removeByItemId(itemId);
374            }
375    
376            /**
377            * Removes all the shopping item fields 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            * Counts all the shopping item fields where itemId = &#63;.
388            *
389            * @param itemId the item id to search with
390            * @return the number of matching shopping item fields
391            * @throws SystemException if a system exception occurred
392            */
393            public static int countByItemId(long itemId)
394                    throws com.liferay.portal.kernel.exception.SystemException {
395                    return getPersistence().countByItemId(itemId);
396            }
397    
398            /**
399            * Counts all the shopping item fields.
400            *
401            * @return the number of shopping item fields
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 ShoppingItemFieldPersistence getPersistence() {
410                    if (_persistence == null) {
411                            _persistence = (ShoppingItemFieldPersistence)PortalBeanLocatorUtil.locate(ShoppingItemFieldPersistence.class.getName());
412                    }
413    
414                    return _persistence;
415            }
416    
417            public void setPersistence(ShoppingItemFieldPersistence persistence) {
418                    _persistence = persistence;
419            }
420    
421            private static ShoppingItemFieldPersistence _persistence;
422    }