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