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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.exception.SystemException;
022    import com.liferay.portal.kernel.util.OrderByComparator;
023    import com.liferay.portal.kernel.util.ReferenceRegistry;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import com.liferay.portlet.shopping.model.ShoppingItemField;
027    
028    import java.util.List;
029    
030    /**
031     * 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.
032     *
033     * <p>
034     * Caching information and settings can be found in <code>portal.properties</code>
035     * </p>
036     *
037     * @author Brian Wing Shun Chan
038     * @see ShoppingItemFieldPersistence
039     * @see ShoppingItemFieldPersistenceImpl
040     * @generated
041     */
042    @ProviderType
043    public class ShoppingItemFieldUtil {
044            /*
045             * NOTE FOR DEVELOPERS:
046             *
047             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
048             */
049    
050            /**
051             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
052             */
053            public static void clearCache() {
054                    getPersistence().clearCache();
055            }
056    
057            /**
058             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
059             */
060            public static void clearCache(ShoppingItemField shoppingItemField) {
061                    getPersistence().clearCache(shoppingItemField);
062            }
063    
064            /**
065             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
066             */
067            public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
068                    throws SystemException {
069                    return getPersistence().countWithDynamicQuery(dynamicQuery);
070            }
071    
072            /**
073             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
074             */
075            public static List<ShoppingItemField> findWithDynamicQuery(
076                    DynamicQuery dynamicQuery) throws SystemException {
077                    return getPersistence().findWithDynamicQuery(dynamicQuery);
078            }
079    
080            /**
081             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
082             */
083            public static List<ShoppingItemField> findWithDynamicQuery(
084                    DynamicQuery dynamicQuery, int start, int end)
085                    throws SystemException {
086                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
087            }
088    
089            /**
090             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
091             */
092            public static List<ShoppingItemField> findWithDynamicQuery(
093                    DynamicQuery dynamicQuery, int start, int end,
094                    OrderByComparator orderByComparator) throws SystemException {
095                    return getPersistence()
096                                       .findWithDynamicQuery(dynamicQuery, start, end,
097                            orderByComparator);
098            }
099    
100            /**
101             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
102             */
103            public static ShoppingItemField update(ShoppingItemField shoppingItemField)
104                    throws SystemException {
105                    return getPersistence().update(shoppingItemField);
106            }
107    
108            /**
109             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
110             */
111            public static ShoppingItemField update(
112                    ShoppingItemField shoppingItemField, ServiceContext serviceContext)
113                    throws SystemException {
114                    return getPersistence().update(shoppingItemField, serviceContext);
115            }
116    
117            /**
118            * Returns all the shopping item fields where itemId = &#63;.
119            *
120            * @param itemId the item ID
121            * @return the matching shopping item fields
122            * @throws SystemException if a system exception occurred
123            */
124            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
125                    long itemId) throws com.liferay.portal.kernel.exception.SystemException {
126                    return getPersistence().findByItemId(itemId);
127            }
128    
129            /**
130            * Returns a range of all the shopping item fields where itemId = &#63;.
131            *
132            * <p>
133            * 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.
134            * </p>
135            *
136            * @param itemId the item ID
137            * @param start the lower bound of the range of shopping item fields
138            * @param end the upper bound of the range of shopping item fields (not inclusive)
139            * @return the range of matching shopping item fields
140            * @throws SystemException if a system exception occurred
141            */
142            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
143                    long itemId, int start, int end)
144                    throws com.liferay.portal.kernel.exception.SystemException {
145                    return getPersistence().findByItemId(itemId, start, end);
146            }
147    
148            /**
149            * Returns an ordered range of all the shopping item fields where itemId = &#63;.
150            *
151            * <p>
152            * 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.
153            * </p>
154            *
155            * @param itemId the item ID
156            * @param start the lower bound of the range of shopping item fields
157            * @param end the upper bound of the range of shopping item fields (not inclusive)
158            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
159            * @return the ordered range of matching shopping item fields
160            * @throws SystemException if a system exception occurred
161            */
162            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findByItemId(
163                    long itemId, int start, int end,
164                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165                    throws com.liferay.portal.kernel.exception.SystemException {
166                    return getPersistence()
167                                       .findByItemId(itemId, start, end, orderByComparator);
168            }
169    
170            /**
171            * Returns the first shopping item field in the ordered set where itemId = &#63;.
172            *
173            * @param itemId the item ID
174            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
175            * @return the first matching shopping item field
176            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
177            * @throws SystemException if a system exception occurred
178            */
179            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_First(
180                    long itemId,
181                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
182                    throws com.liferay.portal.kernel.exception.SystemException,
183                            com.liferay.portlet.shopping.NoSuchItemFieldException {
184                    return getPersistence().findByItemId_First(itemId, orderByComparator);
185            }
186    
187            /**
188            * Returns the first shopping item field in the ordered set where itemId = &#63;.
189            *
190            * @param itemId the item ID
191            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
192            * @return the first matching shopping item field, or <code>null</code> if a matching shopping item field could not be found
193            * @throws SystemException if a system exception occurred
194            */
195            public static com.liferay.portlet.shopping.model.ShoppingItemField fetchByItemId_First(
196                    long itemId,
197                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
198                    throws com.liferay.portal.kernel.exception.SystemException {
199                    return getPersistence().fetchByItemId_First(itemId, orderByComparator);
200            }
201    
202            /**
203            * Returns the last shopping item field in the ordered set where itemId = &#63;.
204            *
205            * @param itemId the item ID
206            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
207            * @return the last matching shopping item field
208            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a matching shopping item field could not be found
209            * @throws SystemException if a system exception occurred
210            */
211            public static com.liferay.portlet.shopping.model.ShoppingItemField findByItemId_Last(
212                    long itemId,
213                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
214                    throws com.liferay.portal.kernel.exception.SystemException,
215                            com.liferay.portlet.shopping.NoSuchItemFieldException {
216                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
217            }
218    
219            /**
220            * Returns the last shopping item field in the ordered set where itemId = &#63;.
221            *
222            * @param itemId the item ID
223            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
224            * @return the last matching shopping item field, or <code>null</code> if a matching shopping item field could not be found
225            * @throws SystemException if a system exception occurred
226            */
227            public static com.liferay.portlet.shopping.model.ShoppingItemField fetchByItemId_Last(
228                    long itemId,
229                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
230                    throws com.liferay.portal.kernel.exception.SystemException {
231                    return getPersistence().fetchByItemId_Last(itemId, orderByComparator);
232            }
233    
234            /**
235            * Returns the shopping item fields before and after the current shopping item field in the ordered set where itemId = &#63;.
236            *
237            * @param itemFieldId the primary key of the current shopping item field
238            * @param itemId the item ID
239            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
240            * @return the previous, current, and next shopping item field
241            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
242            * @throws SystemException if a system exception occurred
243            */
244            public static com.liferay.portlet.shopping.model.ShoppingItemField[] findByItemId_PrevAndNext(
245                    long itemFieldId, long itemId,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException,
248                            com.liferay.portlet.shopping.NoSuchItemFieldException {
249                    return getPersistence()
250                                       .findByItemId_PrevAndNext(itemFieldId, itemId,
251                            orderByComparator);
252            }
253    
254            /**
255            * Removes all the shopping item fields where itemId = &#63; from the database.
256            *
257            * @param itemId the item ID
258            * @throws SystemException if a system exception occurred
259            */
260            public static void removeByItemId(long itemId)
261                    throws com.liferay.portal.kernel.exception.SystemException {
262                    getPersistence().removeByItemId(itemId);
263            }
264    
265            /**
266            * Returns the number of shopping item fields where itemId = &#63;.
267            *
268            * @param itemId the item ID
269            * @return the number of matching shopping item fields
270            * @throws SystemException if a system exception occurred
271            */
272            public static int countByItemId(long itemId)
273                    throws com.liferay.portal.kernel.exception.SystemException {
274                    return getPersistence().countByItemId(itemId);
275            }
276    
277            /**
278            * Caches the shopping item field in the entity cache if it is enabled.
279            *
280            * @param shoppingItemField the shopping item field
281            */
282            public static void cacheResult(
283                    com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField) {
284                    getPersistence().cacheResult(shoppingItemField);
285            }
286    
287            /**
288            * Caches the shopping item fields in the entity cache if it is enabled.
289            *
290            * @param shoppingItemFields the shopping item fields
291            */
292            public static void cacheResult(
293                    java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> shoppingItemFields) {
294                    getPersistence().cacheResult(shoppingItemFields);
295            }
296    
297            /**
298            * Creates a new shopping item field with the primary key. Does not add the shopping item field to the database.
299            *
300            * @param itemFieldId the primary key for the new shopping item field
301            * @return the new shopping item field
302            */
303            public static com.liferay.portlet.shopping.model.ShoppingItemField create(
304                    long itemFieldId) {
305                    return getPersistence().create(itemFieldId);
306            }
307    
308            /**
309            * Removes the shopping item field with the primary key from the database. Also notifies the appropriate model listeners.
310            *
311            * @param itemFieldId the primary key of the shopping item field
312            * @return the shopping item field that was removed
313            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
314            * @throws SystemException if a system exception occurred
315            */
316            public static com.liferay.portlet.shopping.model.ShoppingItemField remove(
317                    long itemFieldId)
318                    throws com.liferay.portal.kernel.exception.SystemException,
319                            com.liferay.portlet.shopping.NoSuchItemFieldException {
320                    return getPersistence().remove(itemFieldId);
321            }
322    
323            public static com.liferay.portlet.shopping.model.ShoppingItemField updateImpl(
324                    com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField)
325                    throws com.liferay.portal.kernel.exception.SystemException {
326                    return getPersistence().updateImpl(shoppingItemField);
327            }
328    
329            /**
330            * Returns the shopping item field with the primary key or throws a {@link com.liferay.portlet.shopping.NoSuchItemFieldException} if it could not be found.
331            *
332            * @param itemFieldId the primary key of the shopping item field
333            * @return the shopping item field
334            * @throws com.liferay.portlet.shopping.NoSuchItemFieldException if a shopping item field with the primary key could not be found
335            * @throws SystemException if a system exception occurred
336            */
337            public static com.liferay.portlet.shopping.model.ShoppingItemField findByPrimaryKey(
338                    long itemFieldId)
339                    throws com.liferay.portal.kernel.exception.SystemException,
340                            com.liferay.portlet.shopping.NoSuchItemFieldException {
341                    return getPersistence().findByPrimaryKey(itemFieldId);
342            }
343    
344            /**
345            * Returns the shopping item field with the primary key or returns <code>null</code> if it could not be found.
346            *
347            * @param itemFieldId the primary key of the shopping item field
348            * @return the shopping item field, or <code>null</code> if a shopping item field with the primary key could not be found
349            * @throws SystemException if a system exception occurred
350            */
351            public static com.liferay.portlet.shopping.model.ShoppingItemField fetchByPrimaryKey(
352                    long itemFieldId)
353                    throws com.liferay.portal.kernel.exception.SystemException {
354                    return getPersistence().fetchByPrimaryKey(itemFieldId);
355            }
356    
357            /**
358            * Returns all the shopping item fields.
359            *
360            * @return the shopping item fields
361            * @throws SystemException if a system exception occurred
362            */
363            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll()
364                    throws com.liferay.portal.kernel.exception.SystemException {
365                    return getPersistence().findAll();
366            }
367    
368            /**
369            * Returns a range of all the shopping item fields.
370            *
371            * <p>
372            * 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.
373            * </p>
374            *
375            * @param start the lower bound of the range of shopping item fields
376            * @param end the upper bound of the range of shopping item fields (not inclusive)
377            * @return the range of shopping item fields
378            * @throws SystemException if a system exception occurred
379            */
380            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll(
381                    int start, int end)
382                    throws com.liferay.portal.kernel.exception.SystemException {
383                    return getPersistence().findAll(start, end);
384            }
385    
386            /**
387            * Returns an ordered range of all the shopping item fields.
388            *
389            * <p>
390            * 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.
391            * </p>
392            *
393            * @param start the lower bound of the range of shopping item fields
394            * @param end the upper bound of the range of shopping item fields (not inclusive)
395            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
396            * @return the ordered range of shopping item fields
397            * @throws SystemException if a system exception occurred
398            */
399            public static java.util.List<com.liferay.portlet.shopping.model.ShoppingItemField> findAll(
400                    int start, int end,
401                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
402                    throws com.liferay.portal.kernel.exception.SystemException {
403                    return getPersistence().findAll(start, end, orderByComparator);
404            }
405    
406            /**
407            * Removes all the shopping item fields from the database.
408            *
409            * @throws SystemException if a system exception occurred
410            */
411            public static void removeAll()
412                    throws com.liferay.portal.kernel.exception.SystemException {
413                    getPersistence().removeAll();
414            }
415    
416            /**
417            * Returns the number of shopping item fields.
418            *
419            * @return the number of shopping item fields
420            * @throws SystemException if a system exception occurred
421            */
422            public static int countAll()
423                    throws com.liferay.portal.kernel.exception.SystemException {
424                    return getPersistence().countAll();
425            }
426    
427            public static ShoppingItemFieldPersistence getPersistence() {
428                    if (_persistence == null) {
429                            _persistence = (ShoppingItemFieldPersistence)PortalBeanLocatorUtil.locate(ShoppingItemFieldPersistence.class.getName());
430    
431                            ReferenceRegistry.registerReference(ShoppingItemFieldUtil.class,
432                                    "_persistence");
433                    }
434    
435                    return _persistence;
436            }
437    
438            /**
439             * @deprecated As of 6.2.0
440             */
441            public void setPersistence(ShoppingItemFieldPersistence persistence) {
442            }
443    
444            private static ShoppingItemFieldPersistence _persistence;
445    }