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 com.liferay.portlet.shopping.service.persistence.impl.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 com.liferay.portlet.shopping.service.persistence.impl.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 List<ShoppingItemField> findByItemId(long itemId) {
119                    return getPersistence().findByItemId(itemId);
120            }
121    
122            /**
123            * Returns a range of all the shopping item fields where itemId = &#63;.
124            *
125            * <p>
126            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
127            * </p>
128            *
129            * @param itemId the item ID
130            * @param start the lower bound of the range of shopping item fields
131            * @param end the upper bound of the range of shopping item fields (not inclusive)
132            * @return the range of matching shopping item fields
133            */
134            public static List<ShoppingItemField> findByItemId(long itemId, int start,
135                    int end) {
136                    return getPersistence().findByItemId(itemId, start, end);
137            }
138    
139            /**
140            * Returns an ordered range of all the shopping item fields where itemId = &#63;.
141            *
142            * <p>
143            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
144            * </p>
145            *
146            * @param itemId the item ID
147            * @param start the lower bound of the range of shopping item fields
148            * @param end the upper bound of the range of shopping item fields (not inclusive)
149            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
150            * @return the ordered range of matching shopping item fields
151            */
152            public static List<ShoppingItemField> findByItemId(long itemId, int start,
153                    int end, OrderByComparator<ShoppingItemField> orderByComparator) {
154                    return getPersistence()
155                                       .findByItemId(itemId, start, end, orderByComparator);
156            }
157    
158            /**
159            * Returns the first shopping item field in the ordered set where itemId = &#63;.
160            *
161            * @param itemId the item ID
162            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
163            * @return the first matching shopping item field
164            * @throws NoSuchItemFieldException if a matching shopping item field could not be found
165            */
166            public static ShoppingItemField findByItemId_First(long itemId,
167                    OrderByComparator<ShoppingItemField> orderByComparator)
168                    throws com.liferay.portlet.shopping.NoSuchItemFieldException {
169                    return getPersistence().findByItemId_First(itemId, orderByComparator);
170            }
171    
172            /**
173            * Returns the first shopping item field in the ordered set where itemId = &#63;.
174            *
175            * @param itemId the item ID
176            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
177            * @return the first matching shopping item field, or <code>null</code> if a matching shopping item field could not be found
178            */
179            public static ShoppingItemField fetchByItemId_First(long itemId,
180                    OrderByComparator<ShoppingItemField> orderByComparator) {
181                    return getPersistence().fetchByItemId_First(itemId, orderByComparator);
182            }
183    
184            /**
185            * Returns the last shopping item field in the ordered set where itemId = &#63;.
186            *
187            * @param itemId the item ID
188            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
189            * @return the last matching shopping item field
190            * @throws NoSuchItemFieldException if a matching shopping item field could not be found
191            */
192            public static ShoppingItemField findByItemId_Last(long itemId,
193                    OrderByComparator<ShoppingItemField> orderByComparator)
194                    throws com.liferay.portlet.shopping.NoSuchItemFieldException {
195                    return getPersistence().findByItemId_Last(itemId, orderByComparator);
196            }
197    
198            /**
199            * Returns the last shopping item field in the ordered set where itemId = &#63;.
200            *
201            * @param itemId the item ID
202            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
203            * @return the last matching shopping item field, or <code>null</code> if a matching shopping item field could not be found
204            */
205            public static ShoppingItemField fetchByItemId_Last(long itemId,
206                    OrderByComparator<ShoppingItemField> orderByComparator) {
207                    return getPersistence().fetchByItemId_Last(itemId, orderByComparator);
208            }
209    
210            /**
211            * Returns the shopping item fields before and after the current shopping item field in the ordered set where itemId = &#63;.
212            *
213            * @param itemFieldId the primary key of the current shopping item field
214            * @param itemId the item ID
215            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
216            * @return the previous, current, and next shopping item field
217            * @throws NoSuchItemFieldException if a shopping item field with the primary key could not be found
218            */
219            public static ShoppingItemField[] findByItemId_PrevAndNext(
220                    long itemFieldId, long itemId,
221                    OrderByComparator<ShoppingItemField> orderByComparator)
222                    throws com.liferay.portlet.shopping.NoSuchItemFieldException {
223                    return getPersistence()
224                                       .findByItemId_PrevAndNext(itemFieldId, itemId,
225                            orderByComparator);
226            }
227    
228            /**
229            * Removes all the shopping item fields where itemId = &#63; from the database.
230            *
231            * @param itemId the item ID
232            */
233            public static void removeByItemId(long itemId) {
234                    getPersistence().removeByItemId(itemId);
235            }
236    
237            /**
238            * Returns the number of shopping item fields where itemId = &#63;.
239            *
240            * @param itemId the item ID
241            * @return the number of matching shopping item fields
242            */
243            public static int countByItemId(long itemId) {
244                    return getPersistence().countByItemId(itemId);
245            }
246    
247            /**
248            * Caches the shopping item field in the entity cache if it is enabled.
249            *
250            * @param shoppingItemField the shopping item field
251            */
252            public static void cacheResult(ShoppingItemField shoppingItemField) {
253                    getPersistence().cacheResult(shoppingItemField);
254            }
255    
256            /**
257            * Caches the shopping item fields in the entity cache if it is enabled.
258            *
259            * @param shoppingItemFields the shopping item fields
260            */
261            public static void cacheResult(List<ShoppingItemField> shoppingItemFields) {
262                    getPersistence().cacheResult(shoppingItemFields);
263            }
264    
265            /**
266            * Creates a new shopping item field with the primary key. Does not add the shopping item field to the database.
267            *
268            * @param itemFieldId the primary key for the new shopping item field
269            * @return the new shopping item field
270            */
271            public static ShoppingItemField create(long itemFieldId) {
272                    return getPersistence().create(itemFieldId);
273            }
274    
275            /**
276            * Removes the shopping item field with the primary key from the database. Also notifies the appropriate model listeners.
277            *
278            * @param itemFieldId the primary key of the shopping item field
279            * @return the shopping item field that was removed
280            * @throws NoSuchItemFieldException if a shopping item field with the primary key could not be found
281            */
282            public static ShoppingItemField remove(long itemFieldId)
283                    throws com.liferay.portlet.shopping.NoSuchItemFieldException {
284                    return getPersistence().remove(itemFieldId);
285            }
286    
287            public static ShoppingItemField updateImpl(
288                    ShoppingItemField shoppingItemField) {
289                    return getPersistence().updateImpl(shoppingItemField);
290            }
291    
292            /**
293            * Returns the shopping item field with the primary key or throws a {@link NoSuchItemFieldException} if it could not be found.
294            *
295            * @param itemFieldId the primary key of the shopping item field
296            * @return the shopping item field
297            * @throws NoSuchItemFieldException if a shopping item field with the primary key could not be found
298            */
299            public static ShoppingItemField findByPrimaryKey(long itemFieldId)
300                    throws com.liferay.portlet.shopping.NoSuchItemFieldException {
301                    return getPersistence().findByPrimaryKey(itemFieldId);
302            }
303    
304            /**
305            * Returns the shopping item field with the primary key or returns <code>null</code> if it could not be found.
306            *
307            * @param itemFieldId the primary key of the shopping item field
308            * @return the shopping item field, or <code>null</code> if a shopping item field with the primary key could not be found
309            */
310            public static ShoppingItemField fetchByPrimaryKey(long itemFieldId) {
311                    return getPersistence().fetchByPrimaryKey(itemFieldId);
312            }
313    
314            public static java.util.Map<java.io.Serializable, ShoppingItemField> fetchByPrimaryKeys(
315                    java.util.Set<java.io.Serializable> primaryKeys) {
316                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
317            }
318    
319            /**
320            * Returns all the shopping item fields.
321            *
322            * @return the shopping item fields
323            */
324            public static List<ShoppingItemField> findAll() {
325                    return getPersistence().findAll();
326            }
327    
328            /**
329            * Returns a range of all the shopping item fields.
330            *
331            * <p>
332            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
333            * </p>
334            *
335            * @param start the lower bound of the range of shopping item fields
336            * @param end the upper bound of the range of shopping item fields (not inclusive)
337            * @return the range of shopping item fields
338            */
339            public static List<ShoppingItemField> findAll(int start, int end) {
340                    return getPersistence().findAll(start, end);
341            }
342    
343            /**
344            * Returns an ordered range of all the shopping item fields.
345            *
346            * <p>
347            * 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 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 QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
348            * </p>
349            *
350            * @param start the lower bound of the range of shopping item fields
351            * @param end the upper bound of the range of shopping item fields (not inclusive)
352            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
353            * @return the ordered range of shopping item fields
354            */
355            public static List<ShoppingItemField> findAll(int start, int end,
356                    OrderByComparator<ShoppingItemField> orderByComparator) {
357                    return getPersistence().findAll(start, end, orderByComparator);
358            }
359    
360            /**
361            * Removes all the shopping item fields from the database.
362            */
363            public static void removeAll() {
364                    getPersistence().removeAll();
365            }
366    
367            /**
368            * Returns the number of shopping item fields.
369            *
370            * @return the number of shopping item fields
371            */
372            public static int countAll() {
373                    return getPersistence().countAll();
374            }
375    
376            public static ShoppingItemFieldPersistence getPersistence() {
377                    if (_persistence == null) {
378                            _persistence = (ShoppingItemFieldPersistence)PortalBeanLocatorUtil.locate(ShoppingItemFieldPersistence.class.getName());
379    
380                            ReferenceRegistry.registerReference(ShoppingItemFieldUtil.class,
381                                    "_persistence");
382                    }
383    
384                    return _persistence;
385            }
386    
387            /**
388             * @deprecated As of 6.2.0
389             */
390            @Deprecated
391            public void setPersistence(ShoppingItemFieldPersistence persistence) {
392            }
393    
394            private static ShoppingItemFieldPersistence _persistence;
395    }