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