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.portal.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.model.BrowserTracker;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the browser tracker service. This utility wraps {@link BrowserTrackerPersistenceImpl} 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 BrowserTrackerPersistence
037     * @see BrowserTrackerPersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class BrowserTrackerUtil {
042            /*
043             * NOTE FOR DEVELOPERS:
044             *
045             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
046             */
047    
048            /**
049             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
050             */
051            public static void clearCache() {
052                    getPersistence().clearCache();
053            }
054    
055            /**
056             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
057             */
058            public static void clearCache(BrowserTracker browserTracker) {
059                    getPersistence().clearCache(browserTracker);
060            }
061    
062            /**
063             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
064             */
065            public static long countWithDynamicQuery(DynamicQuery dynamicQuery) {
066                    return getPersistence().countWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
071             */
072            public static List<BrowserTracker> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery) {
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<BrowserTracker> findWithDynamicQuery(
081                    DynamicQuery dynamicQuery, int start, int end) {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<BrowserTracker> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator<BrowserTracker> orderByComparator) {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
098             */
099            public static BrowserTracker update(BrowserTracker browserTracker) {
100                    return getPersistence().update(browserTracker);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static BrowserTracker update(BrowserTracker browserTracker,
107                    ServiceContext serviceContext) {
108                    return getPersistence().update(browserTracker, serviceContext);
109            }
110    
111            /**
112            * Returns the browser tracker where userId = &#63; or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found.
113            *
114            * @param userId the user ID
115            * @return the matching browser tracker
116            * @throws com.liferay.portal.NoSuchBrowserTrackerException if a matching browser tracker could not be found
117            */
118            public static com.liferay.portal.model.BrowserTracker findByUserId(
119                    long userId) throws com.liferay.portal.NoSuchBrowserTrackerException {
120                    return getPersistence().findByUserId(userId);
121            }
122    
123            /**
124            * Returns the browser tracker where userId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
125            *
126            * @param userId the user ID
127            * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found
128            */
129            public static com.liferay.portal.model.BrowserTracker fetchByUserId(
130                    long userId) {
131                    return getPersistence().fetchByUserId(userId);
132            }
133    
134            /**
135            * Returns the browser tracker where userId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
136            *
137            * @param userId the user ID
138            * @param retrieveFromCache whether to use the finder cache
139            * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found
140            */
141            public static com.liferay.portal.model.BrowserTracker fetchByUserId(
142                    long userId, boolean retrieveFromCache) {
143                    return getPersistence().fetchByUserId(userId, retrieveFromCache);
144            }
145    
146            /**
147            * Removes the browser tracker where userId = &#63; from the database.
148            *
149            * @param userId the user ID
150            * @return the browser tracker that was removed
151            */
152            public static com.liferay.portal.model.BrowserTracker removeByUserId(
153                    long userId) throws com.liferay.portal.NoSuchBrowserTrackerException {
154                    return getPersistence().removeByUserId(userId);
155            }
156    
157            /**
158            * Returns the number of browser trackers where userId = &#63;.
159            *
160            * @param userId the user ID
161            * @return the number of matching browser trackers
162            */
163            public static int countByUserId(long userId) {
164                    return getPersistence().countByUserId(userId);
165            }
166    
167            /**
168            * Caches the browser tracker in the entity cache if it is enabled.
169            *
170            * @param browserTracker the browser tracker
171            */
172            public static void cacheResult(
173                    com.liferay.portal.model.BrowserTracker browserTracker) {
174                    getPersistence().cacheResult(browserTracker);
175            }
176    
177            /**
178            * Caches the browser trackers in the entity cache if it is enabled.
179            *
180            * @param browserTrackers the browser trackers
181            */
182            public static void cacheResult(
183                    java.util.List<com.liferay.portal.model.BrowserTracker> browserTrackers) {
184                    getPersistence().cacheResult(browserTrackers);
185            }
186    
187            /**
188            * Creates a new browser tracker with the primary key. Does not add the browser tracker to the database.
189            *
190            * @param browserTrackerId the primary key for the new browser tracker
191            * @return the new browser tracker
192            */
193            public static com.liferay.portal.model.BrowserTracker create(
194                    long browserTrackerId) {
195                    return getPersistence().create(browserTrackerId);
196            }
197    
198            /**
199            * Removes the browser tracker with the primary key from the database. Also notifies the appropriate model listeners.
200            *
201            * @param browserTrackerId the primary key of the browser tracker
202            * @return the browser tracker that was removed
203            * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found
204            */
205            public static com.liferay.portal.model.BrowserTracker remove(
206                    long browserTrackerId)
207                    throws com.liferay.portal.NoSuchBrowserTrackerException {
208                    return getPersistence().remove(browserTrackerId);
209            }
210    
211            public static com.liferay.portal.model.BrowserTracker updateImpl(
212                    com.liferay.portal.model.BrowserTracker browserTracker) {
213                    return getPersistence().updateImpl(browserTracker);
214            }
215    
216            /**
217            * Returns the browser tracker with the primary key or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found.
218            *
219            * @param browserTrackerId the primary key of the browser tracker
220            * @return the browser tracker
221            * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found
222            */
223            public static com.liferay.portal.model.BrowserTracker findByPrimaryKey(
224                    long browserTrackerId)
225                    throws com.liferay.portal.NoSuchBrowserTrackerException {
226                    return getPersistence().findByPrimaryKey(browserTrackerId);
227            }
228    
229            /**
230            * Returns the browser tracker with the primary key or returns <code>null</code> if it could not be found.
231            *
232            * @param browserTrackerId the primary key of the browser tracker
233            * @return the browser tracker, or <code>null</code> if a browser tracker with the primary key could not be found
234            */
235            public static com.liferay.portal.model.BrowserTracker fetchByPrimaryKey(
236                    long browserTrackerId) {
237                    return getPersistence().fetchByPrimaryKey(browserTrackerId);
238            }
239    
240            public static java.util.Map<java.io.Serializable, com.liferay.portal.model.BrowserTracker> fetchByPrimaryKeys(
241                    java.util.Set<java.io.Serializable> primaryKeys) {
242                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
243            }
244    
245            /**
246            * Returns all the browser trackers.
247            *
248            * @return the browser trackers
249            */
250            public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll() {
251                    return getPersistence().findAll();
252            }
253    
254            /**
255            * Returns a range of all the browser trackers.
256            *
257            * <p>
258            * 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.portal.model.impl.BrowserTrackerModelImpl}. 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.
259            * </p>
260            *
261            * @param start the lower bound of the range of browser trackers
262            * @param end the upper bound of the range of browser trackers (not inclusive)
263            * @return the range of browser trackers
264            */
265            public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll(
266                    int start, int end) {
267                    return getPersistence().findAll(start, end);
268            }
269    
270            /**
271            * Returns an ordered range of all the browser trackers.
272            *
273            * <p>
274            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. 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.portal.model.impl.BrowserTrackerModelImpl}. 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.
275            * </p>
276            *
277            * @param start the lower bound of the range of browser trackers
278            * @param end the upper bound of the range of browser trackers (not inclusive)
279            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
280            * @return the ordered range of browser trackers
281            */
282            public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll(
283                    int start, int end,
284                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.BrowserTracker> orderByComparator) {
285                    return getPersistence().findAll(start, end, orderByComparator);
286            }
287    
288            /**
289            * Removes all the browser trackers from the database.
290            */
291            public static void removeAll() {
292                    getPersistence().removeAll();
293            }
294    
295            /**
296            * Returns the number of browser trackers.
297            *
298            * @return the number of browser trackers
299            */
300            public static int countAll() {
301                    return getPersistence().countAll();
302            }
303    
304            public static BrowserTrackerPersistence getPersistence() {
305                    if (_persistence == null) {
306                            _persistence = (BrowserTrackerPersistence)PortalBeanLocatorUtil.locate(BrowserTrackerPersistence.class.getName());
307    
308                            ReferenceRegistry.registerReference(BrowserTrackerUtil.class,
309                                    "_persistence");
310                    }
311    
312                    return _persistence;
313            }
314    
315            /**
316             * @deprecated As of 6.2.0
317             */
318            @Deprecated
319            public void setPersistence(BrowserTrackerPersistence persistence) {
320            }
321    
322            private static BrowserTrackerPersistence _persistence;
323    }