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