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