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