001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service.persistence;
016    
017    import 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.ShoppingItemField;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the shopping item field service. This utility wraps {@link ShoppingItemFieldPersistenceImpl} 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 ShoppingItemFieldPersistence
037     * @see ShoppingItemFieldPersistenceImpl
038     * @generated
039     */
040    public class ShoppingItemFieldUtil {
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(ShoppingItemField shoppingItemField) {
058                    getPersistence().clearCache(shoppingItemField);
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<ShoppingItemField> 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<ShoppingItemField> 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<ShoppingItemField> 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 ShoppingItemField update(ShoppingItemField shoppingItemField)
101                    throws SystemException {
102                    return getPersistence().update(shoppingItemField);
103            }
104    
105            /**
106             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
107             */
108            public static ShoppingItemField update(
109                    ShoppingItemField shoppingItemField, ServiceContext serviceContext)
110                    throws SystemException {
111                    return getPersistence().update(shoppingItemField, serviceContext);
112            }
113    
114            /**
115            * Returns all the shopping item fields where itemId = &#63;.
116            *
117            * @param itemId the item ID
118            * @return the matching shopping item fields
119            * @throws SystemException if a system exception occurred
120            */
121            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
122                    long itemId) throws com.liferay.portal.kernel.exception.SystemException {
123                    return getPersistence().findByItemId(itemId);
124            }
125    
126            /**
127            * Returns a range of all the shopping item fields where itemId = &#63;.
128            *
129            * <p>
130            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemFieldModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
131            * </p>
132            *
133            * @param itemId the item ID
134            * @param start the lower bound of the range of shopping item fields
135            * @param end the upper bound of the range of shopping item fields (not inclusive)
136            * @return the range of matching shopping item fields
137            * @throws SystemException if a system exception occurred
138            */
139            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
140                    long itemId, int start, int end)
141                    throws com.liferay.portal.kernel.exception.SystemException {
142                    return getPersistence().findByItemId(itemId, start, end);
143            }
144    
145            /**
146            * Returns an ordered range of all the shopping item fields where itemId = &#63;.
147            *
148            * <p>
149            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemFieldModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
150            * </p>
151            *
152            * @param itemId the item ID
153            * @param start the lower bound of the range of shopping item fields
154            * @param end the upper bound of the range of shopping item fields (not inclusive)
155            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
156            * @return the ordered range of matching shopping item fields
157            * @throws SystemException if a system exception occurred
158            */
159            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
160                    long itemId, int start, int end,
161                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
162                    throws com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence()
164                                       .findByItemId(itemId, start, end, orderByComparator);
165            }
166    
167            /**
168            * Returns the first shopping item field in the ordered set where itemId = &#63;.
169            *
170            * @param itemId the item ID
171            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
172            * @return the first matching shopping item field
173            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
174            * @throws SystemException if a system exception occurred
175            */
176            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_First(
177                    long itemId,
178                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
179                    throws com.liferay.portal.kernel.exception.SystemException,
180                            com.liferay.portlet.shopping.NoSuchItemFieldException {
181                    return getPersistence().findByItemId_First(itemId, orderByComparator);
182            }
183    
184            /**
185            * Returns the first shopping item field in the ordered set where itemId = &#63;.
186            *
187            * @param itemId the item ID
188            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
189            * @return the first matching shopping item field, or <code>null</code> if a matching shopping item field could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public static com.liferay.portlet.shopping.model.ShoppingItemField fetchByItemId_First(
193                    long itemId,
194                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence().fetchByItemId_First(itemId, orderByComparator);
197            }
198    
199            /**
200            * Returns the last shopping item field in the ordered set where itemId = &#63;.
201            *
202            * @param itemId the item ID
203            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
204            * @return the last matching shopping item field
205            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
206            * @throws SystemException if a system exception occurred
207            */
208            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_Last(
209                    long itemId,
210                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
211                    throws com.liferay.portal.kernel.exception.SystemException,
212                            com.liferay.portlet.shopping.NoSuchItemFieldException {
213                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
214            }
215    
216            /**
217            * Returns the last shopping item field in the ordered set where itemId = &#63;.
218            *
219            * @param itemId the item ID
220            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
221            * @return the last matching shopping item field, or <code>null</code> if a matching shopping item field could not be found
222            * @throws SystemException if a system exception occurred
223            */
224            public static com.liferay.portlet.shopping.model.ShoppingItemField fetchByItemId_Last(
225                    long itemId,
226                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
227                    throws com.liferay.portal.kernel.exception.SystemException {
228                    return getPersistence().fetchByItemId_Last(itemId, orderByComparator);
229            }
230    
231            /**
232            * Returns the shopping item fields before and after the current shopping item field in the ordered set where itemId = &#63;.
233            *
234            * @param itemFieldId the primary key of the current shopping item field
235            * @param itemId the item ID
236            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
237            * @return the previous, current, and next shopping item field
238            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
239            * @throws SystemException if a system exception occurred
240            */
241            public static com.liferay.portlet.shopping.model.ShoppingItemField[] findByItemId_PrevAndNext(
242                    long itemFieldId, long itemId,
243                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
244                    throws com.liferay.portal.kernel.exception.SystemException,
245                            com.liferay.portlet.shopping.NoSuchItemFieldException {
246                    return getPersistence()
247                                       .findByItemId_PrevAndNext(itemFieldId, itemId,
248                            orderByComparator);
249            }
250    
251            /**
252            * Removes all the shopping item fields where itemId = &#63; from the database.
253            *
254            * @param itemId the item ID
255            * @throws SystemException if a system exception occurred
256            */
257            public static void removeByItemId(long itemId)
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    getPersistence().removeByItemId(itemId);
260            }
261    
262            /**
263            * Returns the number of shopping item fields where itemId = &#63;.
264            *
265            * @param itemId the item ID
266            * @return the number of matching shopping item fields
267            * @throws SystemException if a system exception occurred
268            */
269            public static int countByItemId(long itemId)
270                    throws com.liferay.portal.kernel.exception.SystemException {
271                    return getPersistence().countByItemId(itemId);
272            }
273    
274            /**
275            * Caches the shopping item field in the entity cache if it is enabled.
276            *
277            * @param shoppingItemField the shopping item field
278            */
279            public static void cacheResult(
280                    com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField) {
281                    getPersistence().cacheResult(shoppingItemField);
282            }
283    
284            /**
285            * Caches the shopping item fields in the entity cache if it is enabled.
286            *
287            * @param shoppingItemFields the shopping item fields
288            */
289            public static void cacheResult(
290                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> shoppingItemFields) {
291                    getPersistence().cacheResult(shoppingItemFields);
292            }
293    
294            /**
295            * Creates a new shopping item field with the primary key. Does not add the shopping item field to the database.
296            *
297            * @param itemFieldId the primary key for the new shopping item field
298            * @return the new shopping item field
299            */
300            public static com.liferay.portlet.shopping.model.ShoppingItemField create(
301                    long itemFieldId) {
302                    return getPersistence().create(itemFieldId);
303            }
304    
305            /**
306            * Removes the shopping item field with the primary key from the database. Also notifies the appropriate model listeners.
307            *
308            * @param itemFieldId the primary key of the shopping item field
309            * @return the shopping item field that was removed
310            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
311            * @throws SystemException if a system exception occurred
312            */
313            public static com.liferay.portlet.shopping.model.ShoppingItemField remove(
314                    long itemFieldId)
315                    throws com.liferay.portal.kernel.exception.SystemException,
316                            com.liferay.portlet.shopping.NoSuchItemFieldException {
317                    return getPersistence().remove(itemFieldId);
318            }
319    
320            public static com.liferay.portlet.shopping.model.ShoppingItemField updateImpl(
321                    com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField)
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    return getPersistence().updateImpl(shoppingItemField);
324            }
325    
326            /**
327            * Returns the shopping item field with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchItemFieldException} if it could not be found.
328            *
329            * @param itemFieldId the primary key of the shopping item field
330            * @return the shopping item field
331            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
332            * @throws SystemException if a system exception occurred
333            */
334            public static com.liferay.portlet.shopping.model.ShoppingItemField findByPrimaryKey(
335                    long itemFieldId)
336                    throws com.liferay.portal.kernel.exception.SystemException,
337                            com.liferay.portlet.shopping.NoSuchItemFieldException {
338                    return getPersistence().findByPrimaryKey(itemFieldId);
339            }
340    
341            /**
342            * Returns the shopping item field with the primary key or returns <code>null</code> if it could not be found.
343            *
344            * @param itemFieldId the primary key of the shopping item field
345            * @return the shopping item field, or <code>null</code> if a shopping item field with the primary key could not be found
346            * @throws SystemException if a system exception occurred
347            */
348            public static com.liferay.portlet.shopping.model.ShoppingItemField fetchByPrimaryKey(
349                    long itemFieldId)
350                    throws com.liferay.portal.kernel.exception.SystemException {
351                    return getPersistence().fetchByPrimaryKey(itemFieldId);
352            }
353    
354            /**
355            * Returns all the shopping item fields.
356            *
357            * @return the shopping item fields
358            * @throws SystemException if a system exception occurred
359            */
360            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll()
361                    throws com.liferay.portal.kernel.exception.SystemException {
362                    return getPersistence().findAll();
363            }
364    
365            /**
366            * Returns a range of all the shopping item fields.
367            *
368            * <p>
369            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemFieldModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
370            * </p>
371            *
372            * @param start the lower bound of the range of shopping item fields
373            * @param end the upper bound of the range of shopping item fields (not inclusive)
374            * @return the range of shopping item fields
375            * @throws SystemException if a system exception occurred
376            */
377            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll(
378                    int start, int end)
379                    throws com.liferay.portal.kernel.exception.SystemException {
380                    return getPersistence().findAll(start, end);
381            }
382    
383            /**
384            * Returns an ordered range of all the shopping item fields.
385            *
386            * <p>
387            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portlet.shopping.model.impl.ShoppingItemFieldModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
388            * </p>
389            *
390            * @param start the lower bound of the range of shopping item fields
391            * @param end the upper bound of the range of shopping item fields (not inclusive)
392            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
393            * @return the ordered range of shopping item fields
394            * @throws SystemException if a system exception occurred
395            */
396            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll(
397                    int start, int end,
398                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
399                    throws com.liferay.portal.kernel.exception.SystemException {
400                    return getPersistence().findAll(start, end, orderByComparator);
401            }
402    
403            /**
404            * Removes all the shopping item fields from the database.
405            *
406            * @throws SystemException if a system exception occurred
407            */
408            public static void removeAll()
409                    throws com.liferay.portal.kernel.exception.SystemException {
410                    getPersistence().removeAll();
411            }
412    
413            /**
414            * Returns the number of shopping item fields.
415            *
416            * @return the number of shopping item fields
417            * @throws SystemException if a system exception occurred
418            */
419            public static int countAll()
420                    throws com.liferay.portal.kernel.exception.SystemException {
421                    return getPersistence().countAll();
422            }
423    
424            public static ShoppingItemFieldPersistence getPersistence() {
425                    if (_persistence == null) {
426                            _persistence = (ShoppingItemFieldPersistence)PortalBeanLocatorUtil.locate(ShoppingItemFieldPersistence.class.getName());
427    
428                            ReferenceRegistry.registerReference(ShoppingItemFieldUtil.class,
429                                    "_persistence");
430                    }
431    
432                    return _persistence;
433            }
434    
435            /**
436             * @deprecated As of 6.2.0
437             */
438            public void setPersistence(ShoppingItemFieldPersistence persistence) {
439            }
440    
441            private static ShoppingItemFieldPersistence _persistence;
442    }