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 com.liferay.portal.service.persistence.impl.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 com.liferay.portal.service.persistence.impl.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 NoSuchBrowserTrackerException} if it could not be found.
113            *
114            * @param userId the user ID
115            * @return the matching browser tracker
116            * @throws NoSuchBrowserTrackerException if a matching browser tracker could not be found
117            */
118            public static BrowserTracker findByUserId(long userId)
119                    throws com.liferay.portal.exception.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 BrowserTracker fetchByUserId(long userId) {
130                    return getPersistence().fetchByUserId(userId);
131            }
132    
133            /**
134            * Returns the browser tracker where userId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
135            *
136            * @param userId the user ID
137            * @param retrieveFromCache whether to retrieve from the finder cache
138            * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found
139            */
140            public static BrowserTracker fetchByUserId(long userId,
141                    boolean retrieveFromCache) {
142                    return getPersistence().fetchByUserId(userId, retrieveFromCache);
143            }
144    
145            /**
146            * Removes the browser tracker where userId = &#63; from the database.
147            *
148            * @param userId the user ID
149            * @return the browser tracker that was removed
150            */
151            public static BrowserTracker removeByUserId(long userId)
152                    throws com.liferay.portal.exception.NoSuchBrowserTrackerException {
153                    return getPersistence().removeByUserId(userId);
154            }
155    
156            /**
157            * Returns the number of browser trackers where userId = &#63;.
158            *
159            * @param userId the user ID
160            * @return the number of matching browser trackers
161            */
162            public static int countByUserId(long userId) {
163                    return getPersistence().countByUserId(userId);
164            }
165    
166            /**
167            * Caches the browser tracker in the entity cache if it is enabled.
168            *
169            * @param browserTracker the browser tracker
170            */
171            public static void cacheResult(BrowserTracker browserTracker) {
172                    getPersistence().cacheResult(browserTracker);
173            }
174    
175            /**
176            * Caches the browser trackers in the entity cache if it is enabled.
177            *
178            * @param browserTrackers the browser trackers
179            */
180            public static void cacheResult(List<BrowserTracker> browserTrackers) {
181                    getPersistence().cacheResult(browserTrackers);
182            }
183    
184            /**
185            * Creates a new browser tracker with the primary key. Does not add the browser tracker to the database.
186            *
187            * @param browserTrackerId the primary key for the new browser tracker
188            * @return the new browser tracker
189            */
190            public static BrowserTracker create(long browserTrackerId) {
191                    return getPersistence().create(browserTrackerId);
192            }
193    
194            /**
195            * Removes the browser tracker with the primary key from the database. Also notifies the appropriate model listeners.
196            *
197            * @param browserTrackerId the primary key of the browser tracker
198            * @return the browser tracker that was removed
199            * @throws NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found
200            */
201            public static BrowserTracker remove(long browserTrackerId)
202                    throws com.liferay.portal.exception.NoSuchBrowserTrackerException {
203                    return getPersistence().remove(browserTrackerId);
204            }
205    
206            public static BrowserTracker updateImpl(BrowserTracker browserTracker) {
207                    return getPersistence().updateImpl(browserTracker);
208            }
209    
210            /**
211            * Returns the browser tracker with the primary key or throws a {@link NoSuchBrowserTrackerException} if it could not be found.
212            *
213            * @param browserTrackerId the primary key of the browser tracker
214            * @return the browser tracker
215            * @throws NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found
216            */
217            public static BrowserTracker findByPrimaryKey(long browserTrackerId)
218                    throws com.liferay.portal.exception.NoSuchBrowserTrackerException {
219                    return getPersistence().findByPrimaryKey(browserTrackerId);
220            }
221    
222            /**
223            * Returns the browser tracker with the primary key or returns <code>null</code> if it could not be found.
224            *
225            * @param browserTrackerId the primary key of the browser tracker
226            * @return the browser tracker, or <code>null</code> if a browser tracker with the primary key could not be found
227            */
228            public static BrowserTracker fetchByPrimaryKey(long browserTrackerId) {
229                    return getPersistence().fetchByPrimaryKey(browserTrackerId);
230            }
231    
232            public static java.util.Map<java.io.Serializable, BrowserTracker> fetchByPrimaryKeys(
233                    java.util.Set<java.io.Serializable> primaryKeys) {
234                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
235            }
236    
237            /**
238            * Returns all the browser trackers.
239            *
240            * @return the browser trackers
241            */
242            public static List<BrowserTracker> findAll() {
243                    return getPersistence().findAll();
244            }
245    
246            /**
247            * Returns a range of all the browser trackers.
248            *
249            * <p>
250            * 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 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.
251            * </p>
252            *
253            * @param start the lower bound of the range of browser trackers
254            * @param end the upper bound of the range of browser trackers (not inclusive)
255            * @return the range of browser trackers
256            */
257            public static List<BrowserTracker> findAll(int start, int end) {
258                    return getPersistence().findAll(start, end);
259            }
260    
261            /**
262            * Returns an ordered range of all the browser trackers.
263            *
264            * <p>
265            * 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 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.
266            * </p>
267            *
268            * @param start the lower bound of the range of browser trackers
269            * @param end the upper bound of the range of browser trackers (not inclusive)
270            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
271            * @return the ordered range of browser trackers
272            */
273            public static List<BrowserTracker> findAll(int start, int end,
274                    OrderByComparator<BrowserTracker> orderByComparator) {
275                    return getPersistence().findAll(start, end, orderByComparator);
276            }
277    
278            /**
279            * Returns an ordered range of all the browser trackers.
280            *
281            * <p>
282            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link 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 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.
283            * </p>
284            *
285            * @param start the lower bound of the range of browser trackers
286            * @param end the upper bound of the range of browser trackers (not inclusive)
287            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
288            * @param retrieveFromCache whether to retrieve from the finder cache
289            * @return the ordered range of browser trackers
290            */
291            public static List<BrowserTracker> findAll(int start, int end,
292                    OrderByComparator<BrowserTracker> orderByComparator,
293                    boolean retrieveFromCache) {
294                    return getPersistence()
295                                       .findAll(start, end, orderByComparator, retrieveFromCache);
296            }
297    
298            /**
299            * Removes all the browser trackers from the database.
300            */
301            public static void removeAll() {
302                    getPersistence().removeAll();
303            }
304    
305            /**
306            * Returns the number of browser trackers.
307            *
308            * @return the number of browser trackers
309            */
310            public static int countAll() {
311                    return getPersistence().countAll();
312            }
313    
314            public static BrowserTrackerPersistence getPersistence() {
315                    if (_persistence == null) {
316                            _persistence = (BrowserTrackerPersistence)PortalBeanLocatorUtil.locate(BrowserTrackerPersistence.class.getName());
317    
318                            ReferenceRegistry.registerReference(BrowserTrackerUtil.class,
319                                    "_persistence");
320                    }
321    
322                    return _persistence;
323            }
324    
325            private static BrowserTrackerPersistence _persistence;
326    }