001 /** 002 * Copyright (c) 2000-2011 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.PasswordTracker; 023 import com.liferay.portal.service.ServiceContext; 024 025 import java.util.List; 026 027 /** 028 * The persistence utility for the password tracker service. This utility wraps {@link PasswordTrackerPersistenceImpl} 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 PasswordTrackerPersistence 036 * @see PasswordTrackerPersistenceImpl 037 * @generated 038 */ 039 public class PasswordTrackerUtil { 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(PasswordTracker passwordTracker) { 057 getPersistence().clearCache(passwordTracker); 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<PasswordTracker> 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<PasswordTracker> 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<PasswordTracker> 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 PasswordTracker remove(PasswordTracker passwordTracker) 100 throws SystemException { 101 return getPersistence().remove(passwordTracker); 102 } 103 104 /** 105 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 106 */ 107 public static PasswordTracker update(PasswordTracker passwordTracker, 108 boolean merge) throws SystemException { 109 return getPersistence().update(passwordTracker, merge); 110 } 111 112 /** 113 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 114 */ 115 public static PasswordTracker update(PasswordTracker passwordTracker, 116 boolean merge, ServiceContext serviceContext) throws SystemException { 117 return getPersistence().update(passwordTracker, merge, serviceContext); 118 } 119 120 /** 121 * Caches the password tracker in the entity cache if it is enabled. 122 * 123 * @param passwordTracker the password tracker 124 */ 125 public static void cacheResult( 126 com.liferay.portal.model.PasswordTracker passwordTracker) { 127 getPersistence().cacheResult(passwordTracker); 128 } 129 130 /** 131 * Caches the password trackers in the entity cache if it is enabled. 132 * 133 * @param passwordTrackers the password trackers 134 */ 135 public static void cacheResult( 136 java.util.List<com.liferay.portal.model.PasswordTracker> passwordTrackers) { 137 getPersistence().cacheResult(passwordTrackers); 138 } 139 140 /** 141 * Creates a new password tracker with the primary key. Does not add the password tracker to the database. 142 * 143 * @param passwordTrackerId the primary key for the new password tracker 144 * @return the new password tracker 145 */ 146 public static com.liferay.portal.model.PasswordTracker create( 147 long passwordTrackerId) { 148 return getPersistence().create(passwordTrackerId); 149 } 150 151 /** 152 * Removes the password tracker with the primary key from the database. Also notifies the appropriate model listeners. 153 * 154 * @param passwordTrackerId the primary key of the password tracker 155 * @return the password tracker that was removed 156 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password 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.PasswordTracker remove( 160 long passwordTrackerId) 161 throws com.liferay.portal.NoSuchPasswordTrackerException, 162 com.liferay.portal.kernel.exception.SystemException { 163 return getPersistence().remove(passwordTrackerId); 164 } 165 166 public static com.liferay.portal.model.PasswordTracker updateImpl( 167 com.liferay.portal.model.PasswordTracker passwordTracker, boolean merge) 168 throws com.liferay.portal.kernel.exception.SystemException { 169 return getPersistence().updateImpl(passwordTracker, merge); 170 } 171 172 /** 173 * Returns the password tracker with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordTrackerException} if it could not be found. 174 * 175 * @param passwordTrackerId the primary key of the password tracker 176 * @return the password tracker 177 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password 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.PasswordTracker findByPrimaryKey( 181 long passwordTrackerId) 182 throws com.liferay.portal.NoSuchPasswordTrackerException, 183 com.liferay.portal.kernel.exception.SystemException { 184 return getPersistence().findByPrimaryKey(passwordTrackerId); 185 } 186 187 /** 188 * Returns the password tracker with the primary key or returns <code>null</code> if it could not be found. 189 * 190 * @param passwordTrackerId the primary key of the password tracker 191 * @return the password tracker, or <code>null</code> if a password 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.PasswordTracker fetchByPrimaryKey( 195 long passwordTrackerId) 196 throws com.liferay.portal.kernel.exception.SystemException { 197 return getPersistence().fetchByPrimaryKey(passwordTrackerId); 198 } 199 200 /** 201 * Returns all the password trackers where userId = ?. 202 * 203 * @param userId the user ID 204 * @return the matching password trackers 205 * @throws SystemException if a system exception occurred 206 */ 207 public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId( 208 long userId) throws com.liferay.portal.kernel.exception.SystemException { 209 return getPersistence().findByUserId(userId); 210 } 211 212 /** 213 * Returns a range of all the password trackers where userId = ?. 214 * 215 * <p> 216 * 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. 217 * </p> 218 * 219 * @param userId the user ID 220 * @param start the lower bound of the range of password trackers 221 * @param end the upper bound of the range of password trackers (not inclusive) 222 * @return the range of matching password trackers 223 * @throws SystemException if a system exception occurred 224 */ 225 public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId( 226 long userId, int start, int end) 227 throws com.liferay.portal.kernel.exception.SystemException { 228 return getPersistence().findByUserId(userId, start, end); 229 } 230 231 /** 232 * Returns an ordered range of all the password trackers where userId = ?. 233 * 234 * <p> 235 * 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. 236 * </p> 237 * 238 * @param userId the user ID 239 * @param start the lower bound of the range of password trackers 240 * @param end the upper bound of the range of password trackers (not inclusive) 241 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 242 * @return the ordered range of matching password trackers 243 * @throws SystemException if a system exception occurred 244 */ 245 public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId( 246 long userId, int start, int end, 247 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 248 throws com.liferay.portal.kernel.exception.SystemException { 249 return getPersistence() 250 .findByUserId(userId, start, end, orderByComparator); 251 } 252 253 /** 254 * Returns the first password tracker in the ordered set where userId = ?. 255 * 256 * <p> 257 * 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. 258 * </p> 259 * 260 * @param userId the user ID 261 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 262 * @return the first matching password tracker 263 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found 264 * @throws SystemException if a system exception occurred 265 */ 266 public static com.liferay.portal.model.PasswordTracker findByUserId_First( 267 long userId, 268 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 269 throws com.liferay.portal.NoSuchPasswordTrackerException, 270 com.liferay.portal.kernel.exception.SystemException { 271 return getPersistence().findByUserId_First(userId, orderByComparator); 272 } 273 274 /** 275 * Returns the last password tracker in the ordered set where userId = ?. 276 * 277 * <p> 278 * 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. 279 * </p> 280 * 281 * @param userId the user ID 282 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 283 * @return the last matching password tracker 284 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found 285 * @throws SystemException if a system exception occurred 286 */ 287 public static com.liferay.portal.model.PasswordTracker findByUserId_Last( 288 long userId, 289 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 290 throws com.liferay.portal.NoSuchPasswordTrackerException, 291 com.liferay.portal.kernel.exception.SystemException { 292 return getPersistence().findByUserId_Last(userId, orderByComparator); 293 } 294 295 /** 296 * Returns the password trackers before and after the current password tracker in the ordered set where userId = ?. 297 * 298 * <p> 299 * 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. 300 * </p> 301 * 302 * @param passwordTrackerId the primary key of the current password tracker 303 * @param userId the user ID 304 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 305 * @return the previous, current, and next password tracker 306 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found 307 * @throws SystemException if a system exception occurred 308 */ 309 public static com.liferay.portal.model.PasswordTracker[] findByUserId_PrevAndNext( 310 long passwordTrackerId, long userId, 311 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 312 throws com.liferay.portal.NoSuchPasswordTrackerException, 313 com.liferay.portal.kernel.exception.SystemException { 314 return getPersistence() 315 .findByUserId_PrevAndNext(passwordTrackerId, userId, 316 orderByComparator); 317 } 318 319 /** 320 * Returns all the password trackers. 321 * 322 * @return the password trackers 323 * @throws SystemException if a system exception occurred 324 */ 325 public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll() 326 throws com.liferay.portal.kernel.exception.SystemException { 327 return getPersistence().findAll(); 328 } 329 330 /** 331 * Returns a range of all the password trackers. 332 * 333 * <p> 334 * 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. 335 * </p> 336 * 337 * @param start the lower bound of the range of password trackers 338 * @param end the upper bound of the range of password trackers (not inclusive) 339 * @return the range of password trackers 340 * @throws SystemException if a system exception occurred 341 */ 342 public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll( 343 int start, int end) 344 throws com.liferay.portal.kernel.exception.SystemException { 345 return getPersistence().findAll(start, end); 346 } 347 348 /** 349 * Returns an ordered range of all the password trackers. 350 * 351 * <p> 352 * 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. 353 * </p> 354 * 355 * @param start the lower bound of the range of password trackers 356 * @param end the upper bound of the range of password trackers (not inclusive) 357 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 358 * @return the ordered range of password trackers 359 * @throws SystemException if a system exception occurred 360 */ 361 public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll( 362 int start, int end, 363 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 364 throws com.liferay.portal.kernel.exception.SystemException { 365 return getPersistence().findAll(start, end, orderByComparator); 366 } 367 368 /** 369 * Removes all the password trackers where userId = ? from the database. 370 * 371 * @param userId the user ID 372 * @throws SystemException if a system exception occurred 373 */ 374 public static void removeByUserId(long userId) 375 throws com.liferay.portal.kernel.exception.SystemException { 376 getPersistence().removeByUserId(userId); 377 } 378 379 /** 380 * Removes all the password trackers from the database. 381 * 382 * @throws SystemException if a system exception occurred 383 */ 384 public static void removeAll() 385 throws com.liferay.portal.kernel.exception.SystemException { 386 getPersistence().removeAll(); 387 } 388 389 /** 390 * Returns the number of password trackers where userId = ?. 391 * 392 * @param userId the user ID 393 * @return the number of matching password trackers 394 * @throws SystemException if a system exception occurred 395 */ 396 public static int countByUserId(long userId) 397 throws com.liferay.portal.kernel.exception.SystemException { 398 return getPersistence().countByUserId(userId); 399 } 400 401 /** 402 * Returns the number of password trackers. 403 * 404 * @return the number of password trackers 405 * @throws SystemException if a system exception occurred 406 */ 407 public static int countAll() 408 throws com.liferay.portal.kernel.exception.SystemException { 409 return getPersistence().countAll(); 410 } 411 412 public static PasswordTrackerPersistence getPersistence() { 413 if (_persistence == null) { 414 _persistence = (PasswordTrackerPersistence)PortalBeanLocatorUtil.locate(PasswordTrackerPersistence.class.getName()); 415 416 ReferenceRegistry.registerReference(PasswordTrackerUtil.class, 417 "_persistence"); 418 } 419 420 return _persistence; 421 } 422 423 public void setPersistence(PasswordTrackerPersistence persistence) { 424 _persistence = persistence; 425 426 ReferenceRegistry.registerReference(PasswordTrackerUtil.class, 427 "_persistence"); 428 } 429 430 private static PasswordTrackerPersistence _persistence; 431 }