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.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.exception.SystemException; 022 import com.liferay.portal.kernel.util.OrderByComparator; 023 import com.liferay.portal.kernel.util.ReferenceRegistry; 024 import com.liferay.portal.model.BrowserTracker; 025 import com.liferay.portal.service.ServiceContext; 026 027 import java.util.List; 028 029 /** 030 * 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. 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 BrowserTrackerPersistence 038 * @see BrowserTrackerPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class BrowserTrackerUtil { 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(BrowserTracker browserTracker) { 060 getPersistence().clearCache(browserTracker); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) 067 throws SystemException { 068 return getPersistence().countWithDynamicQuery(dynamicQuery); 069 } 070 071 /** 072 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 073 */ 074 public static List<BrowserTracker> findWithDynamicQuery( 075 DynamicQuery dynamicQuery) throws SystemException { 076 return getPersistence().findWithDynamicQuery(dynamicQuery); 077 } 078 079 /** 080 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 081 */ 082 public static List<BrowserTracker> findWithDynamicQuery( 083 DynamicQuery dynamicQuery, int start, int end) 084 throws SystemException { 085 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 086 } 087 088 /** 089 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 090 */ 091 public static List<BrowserTracker> findWithDynamicQuery( 092 DynamicQuery dynamicQuery, int start, int end, 093 OrderByComparator orderByComparator) throws SystemException { 094 return getPersistence() 095 .findWithDynamicQuery(dynamicQuery, start, end, 096 orderByComparator); 097 } 098 099 /** 100 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 101 */ 102 public static BrowserTracker update(BrowserTracker browserTracker) 103 throws SystemException { 104 return getPersistence().update(browserTracker); 105 } 106 107 /** 108 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 109 */ 110 public static BrowserTracker update(BrowserTracker browserTracker, 111 ServiceContext serviceContext) throws SystemException { 112 return getPersistence().update(browserTracker, serviceContext); 113 } 114 115 /** 116 * Returns the browser tracker where userId = ? or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found. 117 * 118 * @param userId the user ID 119 * @return the matching browser tracker 120 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a matching browser tracker could not be found 121 * @throws SystemException if a system exception occurred 122 */ 123 public static com.liferay.portal.model.BrowserTracker findByUserId( 124 long userId) 125 throws com.liferay.portal.NoSuchBrowserTrackerException, 126 com.liferay.portal.kernel.exception.SystemException { 127 return getPersistence().findByUserId(userId); 128 } 129 130 /** 131 * Returns the browser tracker where userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 132 * 133 * @param userId the user ID 134 * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found 135 * @throws SystemException if a system exception occurred 136 */ 137 public static com.liferay.portal.model.BrowserTracker fetchByUserId( 138 long userId) throws com.liferay.portal.kernel.exception.SystemException { 139 return getPersistence().fetchByUserId(userId); 140 } 141 142 /** 143 * Returns the browser tracker where userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 144 * 145 * @param userId the user ID 146 * @param retrieveFromCache whether to use the finder cache 147 * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found 148 * @throws SystemException if a system exception occurred 149 */ 150 public static com.liferay.portal.model.BrowserTracker fetchByUserId( 151 long userId, boolean retrieveFromCache) 152 throws com.liferay.portal.kernel.exception.SystemException { 153 return getPersistence().fetchByUserId(userId, retrieveFromCache); 154 } 155 156 /** 157 * Removes the browser tracker where userId = ? from the database. 158 * 159 * @param userId the user ID 160 * @return the browser tracker that was removed 161 * @throws SystemException if a system exception occurred 162 */ 163 public static com.liferay.portal.model.BrowserTracker removeByUserId( 164 long userId) 165 throws com.liferay.portal.NoSuchBrowserTrackerException, 166 com.liferay.portal.kernel.exception.SystemException { 167 return getPersistence().removeByUserId(userId); 168 } 169 170 /** 171 * Returns the number of browser trackers where userId = ?. 172 * 173 * @param userId the user ID 174 * @return the number of matching browser trackers 175 * @throws SystemException if a system exception occurred 176 */ 177 public static int countByUserId(long userId) 178 throws com.liferay.portal.kernel.exception.SystemException { 179 return getPersistence().countByUserId(userId); 180 } 181 182 /** 183 * Caches the browser tracker in the entity cache if it is enabled. 184 * 185 * @param browserTracker the browser tracker 186 */ 187 public static void cacheResult( 188 com.liferay.portal.model.BrowserTracker browserTracker) { 189 getPersistence().cacheResult(browserTracker); 190 } 191 192 /** 193 * Caches the browser trackers in the entity cache if it is enabled. 194 * 195 * @param browserTrackers the browser trackers 196 */ 197 public static void cacheResult( 198 java.util.List<com.liferay.portal.model.BrowserTracker> browserTrackers) { 199 getPersistence().cacheResult(browserTrackers); 200 } 201 202 /** 203 * Creates a new browser tracker with the primary key. Does not add the browser tracker to the database. 204 * 205 * @param browserTrackerId the primary key for the new browser tracker 206 * @return the new browser tracker 207 */ 208 public static com.liferay.portal.model.BrowserTracker create( 209 long browserTrackerId) { 210 return getPersistence().create(browserTrackerId); 211 } 212 213 /** 214 * Removes the browser tracker with the primary key from the database. Also notifies the appropriate model listeners. 215 * 216 * @param browserTrackerId the primary key of the browser tracker 217 * @return the browser tracker that was removed 218 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found 219 * @throws SystemException if a system exception occurred 220 */ 221 public static com.liferay.portal.model.BrowserTracker remove( 222 long browserTrackerId) 223 throws com.liferay.portal.NoSuchBrowserTrackerException, 224 com.liferay.portal.kernel.exception.SystemException { 225 return getPersistence().remove(browserTrackerId); 226 } 227 228 public static com.liferay.portal.model.BrowserTracker updateImpl( 229 com.liferay.portal.model.BrowserTracker browserTracker) 230 throws com.liferay.portal.kernel.exception.SystemException { 231 return getPersistence().updateImpl(browserTracker); 232 } 233 234 /** 235 * Returns the browser tracker with the primary key or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found. 236 * 237 * @param browserTrackerId the primary key of the browser tracker 238 * @return the browser tracker 239 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found 240 * @throws SystemException if a system exception occurred 241 */ 242 public static com.liferay.portal.model.BrowserTracker findByPrimaryKey( 243 long browserTrackerId) 244 throws com.liferay.portal.NoSuchBrowserTrackerException, 245 com.liferay.portal.kernel.exception.SystemException { 246 return getPersistence().findByPrimaryKey(browserTrackerId); 247 } 248 249 /** 250 * Returns the browser tracker with the primary key or returns <code>null</code> if it could not be found. 251 * 252 * @param browserTrackerId the primary key of the browser tracker 253 * @return the browser tracker, or <code>null</code> if a browser tracker with the primary key could not be found 254 * @throws SystemException if a system exception occurred 255 */ 256 public static com.liferay.portal.model.BrowserTracker fetchByPrimaryKey( 257 long browserTrackerId) 258 throws com.liferay.portal.kernel.exception.SystemException { 259 return getPersistence().fetchByPrimaryKey(browserTrackerId); 260 } 261 262 /** 263 * Returns all the browser trackers. 264 * 265 * @return the browser trackers 266 * @throws SystemException if a system exception occurred 267 */ 268 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll() 269 throws com.liferay.portal.kernel.exception.SystemException { 270 return getPersistence().findAll(); 271 } 272 273 /** 274 * Returns a range of all the browser trackers. 275 * 276 * <p> 277 * 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. 278 * </p> 279 * 280 * @param start the lower bound of the range of browser trackers 281 * @param end the upper bound of the range of browser trackers (not inclusive) 282 * @return the range of browser trackers 283 * @throws SystemException if a system exception occurred 284 */ 285 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll( 286 int start, int end) 287 throws com.liferay.portal.kernel.exception.SystemException { 288 return getPersistence().findAll(start, end); 289 } 290 291 /** 292 * Returns an ordered range of all the browser trackers. 293 * 294 * <p> 295 * 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. 296 * </p> 297 * 298 * @param start the lower bound of the range of browser trackers 299 * @param end the upper bound of the range of browser trackers (not inclusive) 300 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 301 * @return the ordered range of browser trackers 302 * @throws SystemException if a system exception occurred 303 */ 304 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll( 305 int start, int end, 306 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 307 throws com.liferay.portal.kernel.exception.SystemException { 308 return getPersistence().findAll(start, end, orderByComparator); 309 } 310 311 /** 312 * Removes all the browser trackers from the database. 313 * 314 * @throws SystemException if a system exception occurred 315 */ 316 public static void removeAll() 317 throws com.liferay.portal.kernel.exception.SystemException { 318 getPersistence().removeAll(); 319 } 320 321 /** 322 * Returns the number of browser trackers. 323 * 324 * @return the number of browser trackers 325 * @throws SystemException if a system exception occurred 326 */ 327 public static int countAll() 328 throws com.liferay.portal.kernel.exception.SystemException { 329 return getPersistence().countAll(); 330 } 331 332 public static BrowserTrackerPersistence getPersistence() { 333 if (_persistence == null) { 334 _persistence = (BrowserTrackerPersistence)PortalBeanLocatorUtil.locate(BrowserTrackerPersistence.class.getName()); 335 336 ReferenceRegistry.registerReference(BrowserTrackerUtil.class, 337 "_persistence"); 338 } 339 340 return _persistence; 341 } 342 343 /** 344 * @deprecated As of 6.2.0 345 */ 346 public void setPersistence(BrowserTrackerPersistence persistence) { 347 } 348 349 private static BrowserTrackerPersistence _persistence; 350 }