001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * The contents of this file are subject to the terms of the Liferay Enterprise 005 * Subscription License ("License"). You may not use this file except in 006 * compliance with the License. You can obtain a copy of the License by 007 * contacting Liferay, Inc. See the License for the specific language governing 008 * permissions and limitations under the License, including but not limited to 009 * distribution rights of the Software. 010 * 011 * 012 * 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#remove(com.liferay.portal.model.BaseModel) 098 */ 099 public static BrowserTracker remove(BrowserTracker browserTracker) 100 throws SystemException { 101 return getPersistence().remove(browserTracker); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 106 */ 107 public static BrowserTracker update(BrowserTracker browserTracker, 108 boolean merge) throws SystemException { 109 return getPersistence().update(browserTracker, merge); 110 } 111 112 /** 113 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 114 */ 115 public static BrowserTracker update(BrowserTracker browserTracker, 116 boolean merge, ServiceContext serviceContext) throws SystemException { 117 return getPersistence().update(browserTracker, merge, serviceContext); 118 } 119 120 /** 121 * Caches the browser tracker in the entity cache if it is enabled. 122 * 123 * @param browserTracker the browser tracker to cache 124 */ 125 public static void cacheResult( 126 com.liferay.portal.model.BrowserTracker browserTracker) { 127 getPersistence().cacheResult(browserTracker); 128 } 129 130 /** 131 * Caches the browser trackers in the entity cache if it is enabled. 132 * 133 * @param browserTrackers the browser trackers to cache 134 */ 135 public static void cacheResult( 136 java.util.List<com.liferay.portal.model.BrowserTracker> browserTrackers) { 137 getPersistence().cacheResult(browserTrackers); 138 } 139 140 /** 141 * Creates a new browser tracker with the primary key. Does not add the browser tracker to the database. 142 * 143 * @param browserTrackerId the primary key for the new browser tracker 144 * @return the new browser tracker 145 */ 146 public static com.liferay.portal.model.BrowserTracker create( 147 long browserTrackerId) { 148 return getPersistence().create(browserTrackerId); 149 } 150 151 /** 152 * Removes the browser tracker with the primary key from the database. Also notifies the appropriate model listeners. 153 * 154 * @param browserTrackerId the primary key of the browser tracker to remove 155 * @return the browser tracker that was removed 156 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 public static com.liferay.portal.model.BrowserTracker remove( 160 long browserTrackerId) 161 throws com.liferay.portal.NoSuchBrowserTrackerException, 162 com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().remove(browserTrackerId); 164 } 165 166 public static com.liferay.portal.model.BrowserTracker updateImpl( 167 com.liferay.portal.model.BrowserTracker browserTracker, boolean merge) 168 throws com.liferay.portal.kernel.exception.SystemException { 169 return getPersistence().updateImpl(browserTracker, merge); 170 } 171 172 /** 173 * Finds the browser tracker with the primary key or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found. 174 * 175 * @param browserTrackerId the primary key of the browser tracker to find 176 * @return the browser tracker 177 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a browser tracker with the primary key could not be found 178 * @throws SystemException if a system exception occurred 179 */ 180 public static com.liferay.portal.model.BrowserTracker findByPrimaryKey( 181 long browserTrackerId) 182 throws com.liferay.portal.NoSuchBrowserTrackerException, 183 com.liferay.portal.kernel.exception.SystemException { 184 return getPersistence().findByPrimaryKey(browserTrackerId); 185 } 186 187 /** 188 * Finds the browser tracker with the primary key or returns <code>null</code> if it could not be found. 189 * 190 * @param browserTrackerId the primary key of the browser tracker to find 191 * @return the browser tracker, or <code>null</code> if a browser tracker with the primary key could not be found 192 * @throws SystemException if a system exception occurred 193 */ 194 public static com.liferay.portal.model.BrowserTracker fetchByPrimaryKey( 195 long browserTrackerId) 196 throws com.liferay.portal.kernel.exception.SystemException { 197 return getPersistence().fetchByPrimaryKey(browserTrackerId); 198 } 199 200 /** 201 * Finds the browser tracker where userId = ? or throws a {@link com.liferay.portal.NoSuchBrowserTrackerException} if it could not be found. 202 * 203 * @param userId the user ID to search with 204 * @return the matching browser tracker 205 * @throws com.liferay.portal.NoSuchBrowserTrackerException if a matching browser tracker could not be found 206 * @throws SystemException if a system exception occurred 207 */ 208 public static com.liferay.portal.model.BrowserTracker findByUserId( 209 long userId) 210 throws com.liferay.portal.NoSuchBrowserTrackerException, 211 com.liferay.portal.kernel.exception.SystemException { 212 return getPersistence().findByUserId(userId); 213 } 214 215 /** 216 * Finds the browser tracker where userId = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 217 * 218 * @param userId the user ID to search with 219 * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found 220 * @throws SystemException if a system exception occurred 221 */ 222 public static com.liferay.portal.model.BrowserTracker fetchByUserId( 223 long userId) throws com.liferay.portal.kernel.exception.SystemException { 224 return getPersistence().fetchByUserId(userId); 225 } 226 227 /** 228 * Finds the browser tracker where userId = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 229 * 230 * @param userId the user ID to search with 231 * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found 232 * @throws SystemException if a system exception occurred 233 */ 234 public static com.liferay.portal.model.BrowserTracker fetchByUserId( 235 long userId, boolean retrieveFromCache) 236 throws com.liferay.portal.kernel.exception.SystemException { 237 return getPersistence().fetchByUserId(userId, retrieveFromCache); 238 } 239 240 /** 241 * Finds all the browser trackers. 242 * 243 * @return the browser trackers 244 * @throws SystemException if a system exception occurred 245 */ 246 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll() 247 throws com.liferay.portal.kernel.exception.SystemException { 248 return getPersistence().findAll(); 249 } 250 251 /** 252 * Finds a range of all the browser trackers. 253 * 254 * <p> 255 * 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. 256 * </p> 257 * 258 * @param start the lower bound of the range of browser trackers to return 259 * @param end the upper bound of the range of browser trackers to return (not inclusive) 260 * @return the range of browser trackers 261 * @throws SystemException if a system exception occurred 262 */ 263 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll( 264 int start, int end) 265 throws com.liferay.portal.kernel.exception.SystemException { 266 return getPersistence().findAll(start, end); 267 } 268 269 /** 270 * Finds an ordered range of all the browser trackers. 271 * 272 * <p> 273 * 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. 274 * </p> 275 * 276 * @param start the lower bound of the range of browser trackers to return 277 * @param end the upper bound of the range of browser trackers to return (not inclusive) 278 * @param orderByComparator the comparator to order the results by 279 * @return the ordered 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 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 285 throws com.liferay.portal.kernel.exception.SystemException { 286 return getPersistence().findAll(start, end, orderByComparator); 287 } 288 289 /** 290 * Removes the browser tracker where userId = ? from the database. 291 * 292 * @param userId the user ID to search with 293 * @throws SystemException if a system exception occurred 294 */ 295 public static void removeByUserId(long userId) 296 throws com.liferay.portal.NoSuchBrowserTrackerException, 297 com.liferay.portal.kernel.exception.SystemException { 298 getPersistence().removeByUserId(userId); 299 } 300 301 /** 302 * Removes all the browser trackers from the database. 303 * 304 * @throws SystemException if a system exception occurred 305 */ 306 public static void removeAll() 307 throws com.liferay.portal.kernel.exception.SystemException { 308 getPersistence().removeAll(); 309 } 310 311 /** 312 * Counts all the browser trackers where userId = ?. 313 * 314 * @param userId the user ID to search with 315 * @return the number of matching browser trackers 316 * @throws SystemException if a system exception occurred 317 */ 318 public static int countByUserId(long userId) 319 throws com.liferay.portal.kernel.exception.SystemException { 320 return getPersistence().countByUserId(userId); 321 } 322 323 /** 324 * Counts all the browser trackers. 325 * 326 * @return the number of browser trackers 327 * @throws SystemException if a system exception occurred 328 */ 329 public static int countAll() 330 throws com.liferay.portal.kernel.exception.SystemException { 331 return getPersistence().countAll(); 332 } 333 334 public static BrowserTrackerPersistence getPersistence() { 335 if (_persistence == null) { 336 _persistence = (BrowserTrackerPersistence)PortalBeanLocatorUtil.locate(BrowserTrackerPersistence.class.getName()); 337 338 ReferenceRegistry.registerReference(BrowserTrackerUtil.class, 339 "_persistence"); 340 } 341 342 return _persistence; 343 } 344 345 public void setPersistence(BrowserTrackerPersistence persistence) { 346 _persistence = persistence; 347 348 ReferenceRegistry.registerReference(BrowserTrackerUtil.class, 349 "_persistence"); 350 } 351 352 private static BrowserTrackerPersistence _persistence; 353 }