001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import com.liferay.portlet.shopping.model.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            * <p>
253            * 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.
254            * </p>
255            *
256            * @param itemId the item ID
257            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
258            * @return the first matching shopping item field
259            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
260            * @throws SystemException if a system exception occurred
261            */
262            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_First(
263                    long itemId,
264                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
265                    throws com.liferay.portal.kernel.exception.SystemException,
266                            com.liferay.portlet.shopping.NoSuchItemFieldException {
267                    return getPersistence().findByItemId_First(itemId, orderByComparator);
268            }
269    
270            /**
271            * Returns the last shopping item field in the ordered set where itemId = &#63;.
272            *
273            * <p>
274            * 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.
275            * </p>
276            *
277            * @param itemId the item ID
278            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
279            * @return the last matching shopping item field
280            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
281            * @throws SystemException if a system exception occurred
282            */
283            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_Last(
284                    long itemId,
285                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
286                    throws com.liferay.portal.kernel.exception.SystemException,
287                            com.liferay.portlet.shopping.NoSuchItemFieldException {
288                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
289            }
290    
291            /**
292            * Returns the shopping item fields before and after the current shopping item field in the ordered set where itemId = &#63;.
293            *
294            * <p>
295            * 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.
296            * </p>
297            *
298            * @param itemFieldId the primary key of the current shopping item field
299            * @param itemId the item ID
300            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
301            * @return the previous, current, and next shopping item field
302            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
303            * @throws SystemException if a system exception occurred
304            */
305            public static com.liferay.portlet.shopping.model.ShoppingItemField[] findByItemId_PrevAndNext(
306                    long itemFieldId, long itemId,
307                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
308                    throws com.liferay.portal.kernel.exception.SystemException,
309                            com.liferay.portlet.shopping.NoSuchItemFieldException {
310                    return getPersistence()
311                                       .findByItemId_PrevAndNext(itemFieldId, itemId,
312                            orderByComparator);
313            }
314    
315            /**
316            * Returns all the shopping item fields.
317            *
318            * @return the shopping item fields
319            * @throws SystemException if a system exception occurred
320            */
321            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll()
322                    throws com.liferay.portal.kernel.exception.SystemException {
323                    return getPersistence().findAll();
324            }
325    
326            /**
327            * Returns a range of all the shopping item fields.
328            *
329            * <p>
330            * 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.
331            * </p>
332            *
333            * @param start the lower bound of the range of shopping item fields
334            * @param end the upper bound of the range of shopping item fields (not inclusive)
335            * @return the range of shopping item fields
336            * @throws SystemException if a system exception occurred
337            */
338            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll(
339                    int start, int end)
340                    throws com.liferay.portal.kernel.exception.SystemException {
341                    return getPersistence().findAll(start, end);
342            }
343    
344            /**
345            * Returns an ordered 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            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
354            * @return the ordered range of shopping item fields
355            * @throws SystemException if a system exception occurred
356            */
357            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll(
358                    int start, int end,
359                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
360                    throws com.liferay.portal.kernel.exception.SystemException {
361                    return getPersistence().findAll(start, end, orderByComparator);
362            }
363    
364            /**
365            * Removes all the shopping item fields where itemId = &#63; from the database.
366            *
367            * @param itemId the item ID
368            * @throws SystemException if a system exception occurred
369            */
370            public static void removeByItemId(long itemId)
371                    throws com.liferay.portal.kernel.exception.SystemException {
372                    getPersistence().removeByItemId(itemId);
373            }
374    
375            /**
376            * Removes all the shopping item fields from the database.
377            *
378            * @throws SystemException if a system exception occurred
379            */
380            public static void removeAll()
381                    throws com.liferay.portal.kernel.exception.SystemException {
382                    getPersistence().removeAll();
383            }
384    
385            /**
386            * Returns the number of shopping item fields where itemId = &#63;.
387            *
388            * @param itemId the item ID
389            * @return the number of matching shopping item fields
390            * @throws SystemException if a system exception occurred
391            */
392            public static int countByItemId(long itemId)
393                    throws com.liferay.portal.kernel.exception.SystemException {
394                    return getPersistence().countByItemId(itemId);
395            }
396    
397            /**
398            * Returns the number of shopping item fields.
399            *
400            * @return the number of shopping item fields
401            * @throws SystemException if a system exception occurred
402            */
403            public static int countAll()
404                    throws com.liferay.portal.kernel.exception.SystemException {
405                    return getPersistence().countAll();
406            }
407    
408            public static ShoppingItemFieldPersistence getPersistence() {
409                    if (_persistence == null) {
410                            _persistence = (ShoppingItemFieldPersistence)PortalBeanLocatorUtil.locate(ShoppingItemFieldPersistence.class.getName());
411    
412                            ReferenceRegistry.registerReference(ShoppingItemFieldUtil.class,
413                                    "_persistence");
414                    }
415    
416                    return _persistence;
417            }
418    
419            public void setPersistence(ShoppingItemFieldPersistence persistence) {
420                    _persistence = persistence;
421    
422                    ReferenceRegistry.registerReference(ShoppingItemFieldUtil.class,
423                            "_persistence");
424            }
425    
426            private static ShoppingItemFieldPersistence _persistence;
427    }