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