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 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 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 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 * Returns 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 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 * Returns 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 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 * Returns 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 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 * Returns 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 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 * Returns 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 231 * @param retrieveFromCache whether to use the finder cache 232 * @return the matching browser tracker, or <code>null</code> if a matching browser tracker could not be found 233 * @throws SystemException if a system exception occurred 234 */ 235 public static com.liferay.portal.model.BrowserTracker fetchByUserId( 236 long userId, boolean retrieveFromCache) 237 throws com.liferay.portal.kernel.exception.SystemException { 238 return getPersistence().fetchByUserId(userId, retrieveFromCache); 239 } 240 241 /** 242 * Returns all the browser trackers. 243 * 244 * @return the browser trackers 245 * @throws SystemException if a system exception occurred 246 */ 247 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll() 248 throws com.liferay.portal.kernel.exception.SystemException { 249 return getPersistence().findAll(); 250 } 251 252 /** 253 * Returns a range of all the browser trackers. 254 * 255 * <p> 256 * 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. 257 * </p> 258 * 259 * @param start the lower bound of the range of browser trackers 260 * @param end the upper bound of the range of browser trackers (not inclusive) 261 * @return the range of browser trackers 262 * @throws SystemException if a system exception occurred 263 */ 264 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll( 265 int start, int end) 266 throws com.liferay.portal.kernel.exception.SystemException { 267 return getPersistence().findAll(start, end); 268 } 269 270 /** 271 * Returns an ordered 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. 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 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 280 * @return the ordered range of browser trackers 281 * @throws SystemException if a system exception occurred 282 */ 283 public static java.util.List<com.liferay.portal.model.BrowserTracker> findAll( 284 int start, int end, 285 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 286 throws com.liferay.portal.kernel.exception.SystemException { 287 return getPersistence().findAll(start, end, orderByComparator); 288 } 289 290 /** 291 * Removes the browser tracker where userId = ? from the database. 292 * 293 * @param userId the user ID 294 * @throws SystemException if a system exception occurred 295 */ 296 public static void removeByUserId(long userId) 297 throws com.liferay.portal.NoSuchBrowserTrackerException, 298 com.liferay.portal.kernel.exception.SystemException { 299 getPersistence().removeByUserId(userId); 300 } 301 302 /** 303 * Removes all the browser trackers from the database. 304 * 305 * @throws SystemException if a system exception occurred 306 */ 307 public static void removeAll() 308 throws com.liferay.portal.kernel.exception.SystemException { 309 getPersistence().removeAll(); 310 } 311 312 /** 313 * Returns the number of browser trackers where userId = ?. 314 * 315 * @param userId the user ID 316 * @return the number of matching browser trackers 317 * @throws SystemException if a system exception occurred 318 */ 319 public static int countByUserId(long userId) 320 throws com.liferay.portal.kernel.exception.SystemException { 321 return getPersistence().countByUserId(userId); 322 } 323 324 /** 325 * Returns the number of browser trackers. 326 * 327 * @return the number of browser trackers 328 * @throws SystemException if a system exception occurred 329 */ 330 public static int countAll() 331 throws com.liferay.portal.kernel.exception.SystemException { 332 return getPersistence().countAll(); 333 } 334 335 public static BrowserTrackerPersistence getPersistence() { 336 if (_persistence == null) { 337 _persistence = (BrowserTrackerPersistence)PortalBeanLocatorUtil.locate(BrowserTrackerPersistence.class.getName()); 338 339 ReferenceRegistry.registerReference(BrowserTrackerUtil.class, 340 "_persistence"); 341 } 342 343 return _persistence; 344 } 345 346 public void setPersistence(BrowserTrackerPersistence persistence) { 347 _persistence = persistence; 348 349 ReferenceRegistry.registerReference(BrowserTrackerUtil.class, 350 "_persistence"); 351 } 352 353 private static BrowserTrackerPersistence _persistence; 354 }