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 aQute.bnd.annotation.ProviderType; 018 019 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil; 020 import com.liferay.portal.kernel.dao.orm.DynamicQuery; 021 import com.liferay.portal.kernel.exception.SystemException; 022 import com.liferay.portal.kernel.util.OrderByComparator; 023 import com.liferay.portal.kernel.util.ReferenceRegistry; 024 import com.liferay.portal.model.PasswordTracker; 025 import com.liferay.portal.service.ServiceContext; 026 027 import java.util.List; 028 029 /** 030 * 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. 031 * 032 * <p> 033 * Caching information and settings can be found in <code>portal.properties</code> 034 * </p> 035 * 036 * @author Brian Wing Shun Chan 037 * @see PasswordTrackerPersistence 038 * @see PasswordTrackerPersistenceImpl 039 * @generated 040 */ 041 @ProviderType 042 public class PasswordTrackerUtil { 043 /* 044 * NOTE FOR DEVELOPERS: 045 * 046 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 047 */ 048 049 /** 050 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 051 */ 052 public static void clearCache() { 053 getPersistence().clearCache(); 054 } 055 056 /** 057 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 058 */ 059 public static void clearCache(PasswordTracker passwordTracker) { 060 getPersistence().clearCache(passwordTracker); 061 } 062 063 /** 064 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 065 */ 066 public static long countWithDynamicQuery(DynamicQuery dynamicQuery) 067 throws SystemException { 068 return getPersistence().countWithDynamicQuery(dynamicQuery); 069 } 070 071 /** 072 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 073 */ 074 public static List<PasswordTracker> findWithDynamicQuery( 075 DynamicQuery dynamicQuery) throws SystemException { 076 return getPersistence().findWithDynamicQuery(dynamicQuery); 077 } 078 079 /** 080 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 081 */ 082 public static List<PasswordTracker> findWithDynamicQuery( 083 DynamicQuery dynamicQuery, int start, int end) 084 throws SystemException { 085 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 086 } 087 088 /** 089 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 090 */ 091 public static List<PasswordTracker> findWithDynamicQuery( 092 DynamicQuery dynamicQuery, int start, int end, 093 OrderByComparator orderByComparator) throws SystemException { 094 return getPersistence() 095 .findWithDynamicQuery(dynamicQuery, start, end, 096 orderByComparator); 097 } 098 099 /** 100 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 101 */ 102 public static PasswordTracker update(PasswordTracker passwordTracker) 103 throws SystemException { 104 return getPersistence().update(passwordTracker); 105 } 106 107 /** 108 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 109 */ 110 public static PasswordTracker update(PasswordTracker passwordTracker, 111 ServiceContext serviceContext) throws SystemException { 112 return getPersistence().update(passwordTracker, serviceContext); 113 } 114 115 /** 116 * Returns all the password trackers where userId = ?. 117 * 118 * @param userId the user ID 119 * @return the matching password trackers 120 * @throws SystemException if a system exception occurred 121 */ 122 public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId( 123 long userId) throws com.liferay.portal.kernel.exception.SystemException { 124 return getPersistence().findByUserId(userId); 125 } 126 127 /** 128 * Returns a range of all the password trackers where userId = ?. 129 * 130 * <p> 131 * 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.PasswordTrackerModelImpl}. 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. 132 * </p> 133 * 134 * @param userId the user ID 135 * @param start the lower bound of the range of password trackers 136 * @param end the upper bound of the range of password trackers (not inclusive) 137 * @return the range of matching password trackers 138 * @throws SystemException if a system exception occurred 139 */ 140 public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId( 141 long userId, int start, int end) 142 throws com.liferay.portal.kernel.exception.SystemException { 143 return getPersistence().findByUserId(userId, start, end); 144 } 145 146 /** 147 * Returns an ordered range of all the password trackers where userId = ?. 148 * 149 * <p> 150 * 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.PasswordTrackerModelImpl}. 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. 151 * </p> 152 * 153 * @param userId the user ID 154 * @param start the lower bound of the range of password trackers 155 * @param end the upper bound of the range of password trackers (not inclusive) 156 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 157 * @return the ordered range of matching password trackers 158 * @throws SystemException if a system exception occurred 159 */ 160 public static java.util.List<com.liferay.portal.model.PasswordTracker> findByUserId( 161 long userId, int start, int end, 162 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 163 throws com.liferay.portal.kernel.exception.SystemException { 164 return getPersistence() 165 .findByUserId(userId, start, end, orderByComparator); 166 } 167 168 /** 169 * Returns the first password tracker in the ordered set where userId = ?. 170 * 171 * @param userId the user ID 172 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 173 * @return the first matching password tracker 174 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found 175 * @throws SystemException if a system exception occurred 176 */ 177 public static com.liferay.portal.model.PasswordTracker findByUserId_First( 178 long userId, 179 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 180 throws com.liferay.portal.NoSuchPasswordTrackerException, 181 com.liferay.portal.kernel.exception.SystemException { 182 return getPersistence().findByUserId_First(userId, orderByComparator); 183 } 184 185 /** 186 * Returns the first password tracker in the ordered set where userId = ?. 187 * 188 * @param userId the user ID 189 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 190 * @return the first matching password tracker, or <code>null</code> if a matching password tracker could not be found 191 * @throws SystemException if a system exception occurred 192 */ 193 public static com.liferay.portal.model.PasswordTracker fetchByUserId_First( 194 long userId, 195 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 196 throws com.liferay.portal.kernel.exception.SystemException { 197 return getPersistence().fetchByUserId_First(userId, orderByComparator); 198 } 199 200 /** 201 * Returns the last password tracker in the ordered set where userId = ?. 202 * 203 * @param userId the user ID 204 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 205 * @return the last matching password tracker 206 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a matching password tracker could not be found 207 * @throws SystemException if a system exception occurred 208 */ 209 public static com.liferay.portal.model.PasswordTracker findByUserId_Last( 210 long userId, 211 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 212 throws com.liferay.portal.NoSuchPasswordTrackerException, 213 com.liferay.portal.kernel.exception.SystemException { 214 return getPersistence().findByUserId_Last(userId, orderByComparator); 215 } 216 217 /** 218 * Returns the last password tracker in the ordered set where userId = ?. 219 * 220 * @param userId the user ID 221 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 222 * @return the last matching password tracker, or <code>null</code> if a matching password tracker could not be found 223 * @throws SystemException if a system exception occurred 224 */ 225 public static com.liferay.portal.model.PasswordTracker fetchByUserId_Last( 226 long userId, 227 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 228 throws com.liferay.portal.kernel.exception.SystemException { 229 return getPersistence().fetchByUserId_Last(userId, orderByComparator); 230 } 231 232 /** 233 * Returns the password trackers before and after the current password tracker in the ordered set where userId = ?. 234 * 235 * @param passwordTrackerId the primary key of the current password tracker 236 * @param userId the user ID 237 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 238 * @return the previous, current, and next password tracker 239 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found 240 * @throws SystemException if a system exception occurred 241 */ 242 public static com.liferay.portal.model.PasswordTracker[] findByUserId_PrevAndNext( 243 long passwordTrackerId, long userId, 244 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 245 throws com.liferay.portal.NoSuchPasswordTrackerException, 246 com.liferay.portal.kernel.exception.SystemException { 247 return getPersistence() 248 .findByUserId_PrevAndNext(passwordTrackerId, userId, 249 orderByComparator); 250 } 251 252 /** 253 * Removes all the password trackers where userId = ? from the database. 254 * 255 * @param userId the user ID 256 * @throws SystemException if a system exception occurred 257 */ 258 public static void removeByUserId(long userId) 259 throws com.liferay.portal.kernel.exception.SystemException { 260 getPersistence().removeByUserId(userId); 261 } 262 263 /** 264 * Returns the number of password trackers where userId = ?. 265 * 266 * @param userId the user ID 267 * @return the number of matching password trackers 268 * @throws SystemException if a system exception occurred 269 */ 270 public static int countByUserId(long userId) 271 throws com.liferay.portal.kernel.exception.SystemException { 272 return getPersistence().countByUserId(userId); 273 } 274 275 /** 276 * Caches the password tracker in the entity cache if it is enabled. 277 * 278 * @param passwordTracker the password tracker 279 */ 280 public static void cacheResult( 281 com.liferay.portal.model.PasswordTracker passwordTracker) { 282 getPersistence().cacheResult(passwordTracker); 283 } 284 285 /** 286 * Caches the password trackers in the entity cache if it is enabled. 287 * 288 * @param passwordTrackers the password trackers 289 */ 290 public static void cacheResult( 291 java.util.List<com.liferay.portal.model.PasswordTracker> passwordTrackers) { 292 getPersistence().cacheResult(passwordTrackers); 293 } 294 295 /** 296 * Creates a new password tracker with the primary key. Does not add the password tracker to the database. 297 * 298 * @param passwordTrackerId the primary key for the new password tracker 299 * @return the new password tracker 300 */ 301 public static com.liferay.portal.model.PasswordTracker create( 302 long passwordTrackerId) { 303 return getPersistence().create(passwordTrackerId); 304 } 305 306 /** 307 * Removes the password tracker with the primary key from the database. Also notifies the appropriate model listeners. 308 * 309 * @param passwordTrackerId the primary key of the password tracker 310 * @return the password tracker that was removed 311 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found 312 * @throws SystemException if a system exception occurred 313 */ 314 public static com.liferay.portal.model.PasswordTracker remove( 315 long passwordTrackerId) 316 throws com.liferay.portal.NoSuchPasswordTrackerException, 317 com.liferay.portal.kernel.exception.SystemException { 318 return getPersistence().remove(passwordTrackerId); 319 } 320 321 public static com.liferay.portal.model.PasswordTracker updateImpl( 322 com.liferay.portal.model.PasswordTracker passwordTracker) 323 throws com.liferay.portal.kernel.exception.SystemException { 324 return getPersistence().updateImpl(passwordTracker); 325 } 326 327 /** 328 * Returns the password tracker with the primary key or throws a {@link com.liferay.portal.NoSuchPasswordTrackerException} if it could not be found. 329 * 330 * @param passwordTrackerId the primary key of the password tracker 331 * @return the password tracker 332 * @throws com.liferay.portal.NoSuchPasswordTrackerException if a password tracker with the primary key could not be found 333 * @throws SystemException if a system exception occurred 334 */ 335 public static com.liferay.portal.model.PasswordTracker findByPrimaryKey( 336 long passwordTrackerId) 337 throws com.liferay.portal.NoSuchPasswordTrackerException, 338 com.liferay.portal.kernel.exception.SystemException { 339 return getPersistence().findByPrimaryKey(passwordTrackerId); 340 } 341 342 /** 343 * Returns the password tracker with the primary key or returns <code>null</code> if it could not be found. 344 * 345 * @param passwordTrackerId the primary key of the password tracker 346 * @return the password tracker, or <code>null</code> if a password tracker with the primary key could not be found 347 * @throws SystemException if a system exception occurred 348 */ 349 public static com.liferay.portal.model.PasswordTracker fetchByPrimaryKey( 350 long passwordTrackerId) 351 throws com.liferay.portal.kernel.exception.SystemException { 352 return getPersistence().fetchByPrimaryKey(passwordTrackerId); 353 } 354 355 /** 356 * Returns all the password trackers. 357 * 358 * @return the password trackers 359 * @throws SystemException if a system exception occurred 360 */ 361 public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll() 362 throws com.liferay.portal.kernel.exception.SystemException { 363 return getPersistence().findAll(); 364 } 365 366 /** 367 * Returns a range of all the password trackers. 368 * 369 * <p> 370 * 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.PasswordTrackerModelImpl}. 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. 371 * </p> 372 * 373 * @param start the lower bound of the range of password trackers 374 * @param end the upper bound of the range of password trackers (not inclusive) 375 * @return the range of password trackers 376 * @throws SystemException if a system exception occurred 377 */ 378 public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll( 379 int start, int end) 380 throws com.liferay.portal.kernel.exception.SystemException { 381 return getPersistence().findAll(start, end); 382 } 383 384 /** 385 * Returns an ordered range of all the password trackers. 386 * 387 * <p> 388 * 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.PasswordTrackerModelImpl}. 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. 389 * </p> 390 * 391 * @param start the lower bound of the range of password trackers 392 * @param end the upper bound of the range of password trackers (not inclusive) 393 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 394 * @return the ordered range of password trackers 395 * @throws SystemException if a system exception occurred 396 */ 397 public static java.util.List<com.liferay.portal.model.PasswordTracker> findAll( 398 int start, int end, 399 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 400 throws com.liferay.portal.kernel.exception.SystemException { 401 return getPersistence().findAll(start, end, orderByComparator); 402 } 403 404 /** 405 * Removes all the password trackers from the database. 406 * 407 * @throws SystemException if a system exception occurred 408 */ 409 public static void removeAll() 410 throws com.liferay.portal.kernel.exception.SystemException { 411 getPersistence().removeAll(); 412 } 413 414 /** 415 * Returns the number of password trackers. 416 * 417 * @return the number of password trackers 418 * @throws SystemException if a system exception occurred 419 */ 420 public static int countAll() 421 throws com.liferay.portal.kernel.exception.SystemException { 422 return getPersistence().countAll(); 423 } 424 425 public static PasswordTrackerPersistence getPersistence() { 426 if (_persistence == null) { 427 _persistence = (PasswordTrackerPersistence)PortalBeanLocatorUtil.locate(PasswordTrackerPersistence.class.getName()); 428 429 ReferenceRegistry.registerReference(PasswordTrackerUtil.class, 430 "_persistence"); 431 } 432 433 return _persistence; 434 } 435 436 /** 437 * @deprecated As of 6.2.0 438 */ 439 public void setPersistence(PasswordTrackerPersistence persistence) { 440 } 441 442 private static PasswordTrackerPersistence _persistence; 443 }