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 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, boolean) 098 */ 099 public static BrowserTracker update(BrowserTracker browserTracker, 100 boolean merge) throws SystemException { 101 return getPersistence().update(browserTracker, merge); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 106 */ 107 public static BrowserTracker update(BrowserTracker browserTracker, 108 boolean merge, ServiceContext serviceContext) throws SystemException { 109 return getPersistence().update(browserTracker, merge, serviceContext); 110 } 111 112 /** 113 * Caches the browser tracker in the entity cache if it is enabled. 114 * 115 * @param browserTracker the browser tracker 116 */ 117 public static void cacheResult( 118 com.liferay.portal.model.BrowserTracker browserTracker) { 119 getPersistence().cacheResult(browserTracker); 120 } 121 122 /** 123 * Caches the browser trackers in the entity cache if it is enabled. 124 * 125 * @param browserTrackers the browser trackers 126 */ 127 public static void cacheResult( 128 java.util.List<com.liferay.portal.model.BrowserTracker> browserTrackers) { 129 getPersistence().cacheResult(browserTrackers); 130 } 131 132 /** 133 * Creates a new browser tracker with the primary key. Does not add the browser tracker to the database. 134 * 135 * @param browserTrackerId the primary key for the new browser tracker 136 * @return the new browser tracker 137 */ 138 public static com.liferay.portal.model.BrowserTracker create( 139 long browserTrackerId) { 140 return getPersistence().create(browserTrackerId); 141 } 142 143 /** 144 * Removes the browser tracker with the primary key from the database. Also notifies the appropriate model listeners. 145 * 146 * @param browserTrackerId the primary key of the browser tracker 147 * @return the browser tracker that was removed 148 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found 149 * @throws SystemException if a system exception occurred 150 */ 151 public static com.liferay.portal.model.BrowserTracker remove( 152 long browserTrackerId) 153 throws com.liferay.portal.NoSuchBrowserTrackerException, 154 com.liferay.portal.kernel.exception.SystemException { 155 return getPersistence().remove(browserTrackerId); 156 } 157 158 public static com.liferay.portal.model.BrowserTracker updateImpl( 159 com.liferay.portal.model.BrowserTracker browserTracker, boolean merge) 160 throws com.liferay.portal.kernel.exception.SystemException { 161 return getPersistence().updateImpl(browserTracker, merge); 162 } 163 164 /** 165 * Returns the browser tracker with the primary key or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found. 166 * 167 * @param browserTrackerId the primary key of the browser tracker 168 * @return the browser tracker 169 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found 170 * @throws SystemException if a system exception occurred 171 */ 172 public static com.liferay.portal.model.BrowserTracker findByPrimaryKey( 173 long browserTrackerId) 174 throws com.liferay.portal.NoSuchBrowserTrackerException, 175 com.liferay.portal.kernel.exception.SystemException { 176 return getPersistence().findByPrimaryKey(browserTrackerId); 177 } 178 179 /** 180 * Returns the browser tracker with the primary key or returns <code>null</code> if it could not be found. 181 * 182 * @param browserTrackerId the primary key of the browser tracker 183 * @return the browser tracker, or <code>null</code> if a browser tracker with the primary key could not be found 184 * @throws SystemException if a system exception occurred 185 */ 186 public static com.liferay.portal.model.BrowserTracker fetchByPrimaryKey( 187 long browserTrackerId) 188 throws com.liferay.portal.kernel.exception.SystemException { 189 return getPersistence().fetchByPrimaryKey(browserTrackerId); 190 } 191 192 /** 193 * Returns the browser tracker where userId = ? or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found. 194 * 195 * @param userId the user ID 196 * @return the matching browser tracker 197 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a matching browser tracker could not be found 198 * @throws SystemException if a system exception occurred 199 */ 200 public static com.liferay.portal.model.BrowserTracker findByUserId( 201 long userId) 202 throws com.liferay.portal.NoSuchBrowserTrackerException, 203 com.liferay.portal.kernel.exception.SystemException { 204 return getPersistence().findByUserId(userId); 205 } 206 207 /** 208 * Returns the browser tracker where userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 209 * 210 * @param userId the user ID 211 * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found 212 * @throws SystemException if a system exception occurred 213 */ 214 public static com.liferay.portal.model.BrowserTracker fetchByUserId( 215 long userId) throws com.liferay.portal.kernel.exception.SystemException { 216 return getPersistence().fetchByUserId(userId); 217 } 218 219 /** 220 * Returns the browser tracker where userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 221 * 222 * @param userId the user ID 223 * @param retrieveFromCache whether to use the finder cache 224 * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found 225 * @throws SystemException if a system exception occurred 226 */ 227 public static com.liferay.portal.model.BrowserTracker fetchByUserId( 228 long userId, boolean retrieveFromCache) 229 throws com.liferay.portal.kernel.exception.SystemException { 230 return getPersistence().fetchByUserId(userId, retrieveFromCache); 231 } 232 233 /** 234 * Returns all the browser trackers. 235 * 236 * @return the browser trackers 237 * @throws SystemException if a system exception occurred 238 */ 239 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll() 240 throws com.liferay.portal.kernel.exception.SystemException { 241 return getPersistence().findAll(); 242 } 243 244 /** 245 * Returns a range of all the browser trackers. 246 * 247 * <p> 248 * 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. 249 * </p> 250 * 251 * @param start the lower bound of the range of browser trackers 252 * @param end the upper bound of the range of browser trackers (not inclusive) 253 * @return the range of browser trackers 254 * @throws SystemException if a system exception occurred 255 */ 256 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll( 257 int start, int end) 258 throws com.liferay.portal.kernel.exception.SystemException { 259 return getPersistence().findAll(start, end); 260 } 261 262 /** 263 * Returns an ordered range of all the browser trackers. 264 * 265 * <p> 266 * 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. 267 * </p> 268 * 269 * @param start the lower bound of the range of browser trackers 270 * @param end the upper bound of the range of browser trackers (not inclusive) 271 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 272 * @return the ordered range of browser trackers 273 * @throws SystemException if a system exception occurred 274 */ 275 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll( 276 int start, int end, 277 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 278 throws com.liferay.portal.kernel.exception.SystemException { 279 return getPersistence().findAll(start, end, orderByComparator); 280 } 281 282 /** 283 * Removes the browser tracker where userId = ? from the database. 284 * 285 * @param userId the user ID 286 * @return the browser tracker that was removed 287 * @throws SystemException if a system exception occurred 288 */ 289 public static com.liferay.portal.model.BrowserTracker removeByUserId( 290 long userId) 291 throws com.liferay.portal.NoSuchBrowserTrackerException, 292 com.liferay.portal.kernel.exception.SystemException { 293 return getPersistence().removeByUserId(userId); 294 } 295 296 /** 297 * Removes all the browser trackers from the database. 298 * 299 * @throws SystemException if a system exception occurred 300 */ 301 public static void removeAll() 302 throws com.liferay.portal.kernel.exception.SystemException { 303 getPersistence().removeAll(); 304 } 305 306 /** 307 * Returns the number of browser trackers where userId = ?. 308 * 309 * @param userId the user ID 310 * @return the number of matching browser trackers 311 * @throws SystemException if a system exception occurred 312 */ 313 public static int countByUserId(long userId) 314 throws com.liferay.portal.kernel.exception.SystemException { 315 return getPersistence().countByUserId(userId); 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 342 */ 343 public void setPersistence(BrowserTrackerPersistence persistence) { 344 } 345 346 private static BrowserTrackerPersistence _persistence; 347 }