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.Lock; 024 import com.liferay.portal.service.ServiceContext; 025 026 import java.util.List; 027 028 /** 029 * The persistence utility for the lock service. This utility wraps {@link LockPersistenceImpl} 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 LockPersistence 037 * @see LockPersistenceImpl 038 * @generated 039 */ 040 @ProviderType 041 public class LockUtil { 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(Lock lock) { 059 getPersistence().clearCache(lock); 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<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery) { 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<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery, 080 int start, int end) { 081 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 082 } 083 084 /** 085 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 086 */ 087 public static List<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery, 088 int start, int end, OrderByComparator<Lock> orderByComparator) { 089 return getPersistence() 090 .findWithDynamicQuery(dynamicQuery, start, end, 091 orderByComparator); 092 } 093 094 /** 095 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel) 096 */ 097 public static Lock update(Lock lock) { 098 return getPersistence().update(lock); 099 } 100 101 /** 102 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext) 103 */ 104 public static Lock update(Lock lock, ServiceContext serviceContext) { 105 return getPersistence().update(lock, serviceContext); 106 } 107 108 /** 109 * Returns all the locks where uuid = ?. 110 * 111 * @param uuid the uuid 112 * @return the matching locks 113 */ 114 public static java.util.List<com.liferay.portal.model.Lock> findByUuid( 115 java.lang.String uuid) { 116 return getPersistence().findByUuid(uuid); 117 } 118 119 /** 120 * Returns a range of all the locks where uuid = ?. 121 * 122 * <p> 123 * 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.LockModelImpl}. 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. 124 * </p> 125 * 126 * @param uuid the uuid 127 * @param start the lower bound of the range of locks 128 * @param end the upper bound of the range of locks (not inclusive) 129 * @return the range of matching locks 130 */ 131 public static java.util.List<com.liferay.portal.model.Lock> findByUuid( 132 java.lang.String uuid, int start, int end) { 133 return getPersistence().findByUuid(uuid, start, end); 134 } 135 136 /** 137 * Returns an ordered range of all the locks where uuid = ?. 138 * 139 * <p> 140 * 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.LockModelImpl}. 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. 141 * </p> 142 * 143 * @param uuid the uuid 144 * @param start the lower bound of the range of locks 145 * @param end the upper bound of the range of locks (not inclusive) 146 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 147 * @return the ordered range of matching locks 148 */ 149 public static java.util.List<com.liferay.portal.model.Lock> findByUuid( 150 java.lang.String uuid, int start, int end, 151 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 152 return getPersistence().findByUuid(uuid, start, end, orderByComparator); 153 } 154 155 /** 156 * Returns the first lock in the ordered set where uuid = ?. 157 * 158 * @param uuid the uuid 159 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 160 * @return the first matching lock 161 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 162 */ 163 public static com.liferay.portal.model.Lock findByUuid_First( 164 java.lang.String uuid, 165 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 166 throws com.liferay.portal.NoSuchLockException { 167 return getPersistence().findByUuid_First(uuid, orderByComparator); 168 } 169 170 /** 171 * Returns the first lock in the ordered set where uuid = ?. 172 * 173 * @param uuid the uuid 174 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 175 * @return the first matching lock, or <code>null</code> if a matching lock could not be found 176 */ 177 public static com.liferay.portal.model.Lock fetchByUuid_First( 178 java.lang.String uuid, 179 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 180 return getPersistence().fetchByUuid_First(uuid, orderByComparator); 181 } 182 183 /** 184 * Returns the last lock in the ordered set where uuid = ?. 185 * 186 * @param uuid the uuid 187 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 188 * @return the last matching lock 189 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 190 */ 191 public static com.liferay.portal.model.Lock findByUuid_Last( 192 java.lang.String uuid, 193 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 194 throws com.liferay.portal.NoSuchLockException { 195 return getPersistence().findByUuid_Last(uuid, orderByComparator); 196 } 197 198 /** 199 * Returns the last lock in the ordered set where uuid = ?. 200 * 201 * @param uuid the uuid 202 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 203 * @return the last matching lock, or <code>null</code> if a matching lock could not be found 204 */ 205 public static com.liferay.portal.model.Lock fetchByUuid_Last( 206 java.lang.String uuid, 207 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 208 return getPersistence().fetchByUuid_Last(uuid, orderByComparator); 209 } 210 211 /** 212 * Returns the locks before and after the current lock in the ordered set where uuid = ?. 213 * 214 * @param lockId the primary key of the current lock 215 * @param uuid the uuid 216 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 217 * @return the previous, current, and next lock 218 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 219 */ 220 public static com.liferay.portal.model.Lock[] findByUuid_PrevAndNext( 221 long lockId, java.lang.String uuid, 222 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 223 throws com.liferay.portal.NoSuchLockException { 224 return getPersistence() 225 .findByUuid_PrevAndNext(lockId, uuid, orderByComparator); 226 } 227 228 /** 229 * Removes all the locks where uuid = ? from the database. 230 * 231 * @param uuid the uuid 232 */ 233 public static void removeByUuid(java.lang.String uuid) { 234 getPersistence().removeByUuid(uuid); 235 } 236 237 /** 238 * Returns the number of locks where uuid = ?. 239 * 240 * @param uuid the uuid 241 * @return the number of matching locks 242 */ 243 public static int countByUuid(java.lang.String uuid) { 244 return getPersistence().countByUuid(uuid); 245 } 246 247 /** 248 * Returns all the locks where uuid = ? and companyId = ?. 249 * 250 * @param uuid the uuid 251 * @param companyId the company ID 252 * @return the matching locks 253 */ 254 public static java.util.List<com.liferay.portal.model.Lock> findByUuid_C( 255 java.lang.String uuid, long companyId) { 256 return getPersistence().findByUuid_C(uuid, companyId); 257 } 258 259 /** 260 * Returns a range of all the locks where uuid = ? and companyId = ?. 261 * 262 * <p> 263 * 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.LockModelImpl}. 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. 264 * </p> 265 * 266 * @param uuid the uuid 267 * @param companyId the company ID 268 * @param start the lower bound of the range of locks 269 * @param end the upper bound of the range of locks (not inclusive) 270 * @return the range of matching locks 271 */ 272 public static java.util.List<com.liferay.portal.model.Lock> findByUuid_C( 273 java.lang.String uuid, long companyId, int start, int end) { 274 return getPersistence().findByUuid_C(uuid, companyId, start, end); 275 } 276 277 /** 278 * Returns an ordered range of all the locks where uuid = ? and companyId = ?. 279 * 280 * <p> 281 * 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.LockModelImpl}. 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. 282 * </p> 283 * 284 * @param uuid the uuid 285 * @param companyId the company ID 286 * @param start the lower bound of the range of locks 287 * @param end the upper bound of the range of locks (not inclusive) 288 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 289 * @return the ordered range of matching locks 290 */ 291 public static java.util.List<com.liferay.portal.model.Lock> findByUuid_C( 292 java.lang.String uuid, long companyId, int start, int end, 293 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 294 return getPersistence() 295 .findByUuid_C(uuid, companyId, start, end, orderByComparator); 296 } 297 298 /** 299 * Returns the first lock in the ordered set where uuid = ? and companyId = ?. 300 * 301 * @param uuid the uuid 302 * @param companyId the company ID 303 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 304 * @return the first matching lock 305 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 306 */ 307 public static com.liferay.portal.model.Lock findByUuid_C_First( 308 java.lang.String uuid, long companyId, 309 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 310 throws com.liferay.portal.NoSuchLockException { 311 return getPersistence() 312 .findByUuid_C_First(uuid, companyId, orderByComparator); 313 } 314 315 /** 316 * Returns the first lock in the ordered set where uuid = ? and companyId = ?. 317 * 318 * @param uuid the uuid 319 * @param companyId the company ID 320 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 321 * @return the first matching lock, or <code>null</code> if a matching lock could not be found 322 */ 323 public static com.liferay.portal.model.Lock fetchByUuid_C_First( 324 java.lang.String uuid, long companyId, 325 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 326 return getPersistence() 327 .fetchByUuid_C_First(uuid, companyId, orderByComparator); 328 } 329 330 /** 331 * Returns the last lock in the ordered set where uuid = ? and companyId = ?. 332 * 333 * @param uuid the uuid 334 * @param companyId the company ID 335 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 336 * @return the last matching lock 337 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 338 */ 339 public static com.liferay.portal.model.Lock findByUuid_C_Last( 340 java.lang.String uuid, long companyId, 341 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 342 throws com.liferay.portal.NoSuchLockException { 343 return getPersistence() 344 .findByUuid_C_Last(uuid, companyId, orderByComparator); 345 } 346 347 /** 348 * Returns the last lock in the ordered set where uuid = ? and companyId = ?. 349 * 350 * @param uuid the uuid 351 * @param companyId the company ID 352 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 353 * @return the last matching lock, or <code>null</code> if a matching lock could not be found 354 */ 355 public static com.liferay.portal.model.Lock fetchByUuid_C_Last( 356 java.lang.String uuid, long companyId, 357 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 358 return getPersistence() 359 .fetchByUuid_C_Last(uuid, companyId, orderByComparator); 360 } 361 362 /** 363 * Returns the locks before and after the current lock in the ordered set where uuid = ? and companyId = ?. 364 * 365 * @param lockId the primary key of the current lock 366 * @param uuid the uuid 367 * @param companyId the company ID 368 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 369 * @return the previous, current, and next lock 370 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 371 */ 372 public static com.liferay.portal.model.Lock[] findByUuid_C_PrevAndNext( 373 long lockId, java.lang.String uuid, long companyId, 374 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 375 throws com.liferay.portal.NoSuchLockException { 376 return getPersistence() 377 .findByUuid_C_PrevAndNext(lockId, uuid, companyId, 378 orderByComparator); 379 } 380 381 /** 382 * Removes all the locks where uuid = ? and companyId = ? from the database. 383 * 384 * @param uuid the uuid 385 * @param companyId the company ID 386 */ 387 public static void removeByUuid_C(java.lang.String uuid, long companyId) { 388 getPersistence().removeByUuid_C(uuid, companyId); 389 } 390 391 /** 392 * Returns the number of locks where uuid = ? and companyId = ?. 393 * 394 * @param uuid the uuid 395 * @param companyId the company ID 396 * @return the number of matching locks 397 */ 398 public static int countByUuid_C(java.lang.String uuid, long companyId) { 399 return getPersistence().countByUuid_C(uuid, companyId); 400 } 401 402 /** 403 * Returns all the locks where expirationDate < ?. 404 * 405 * @param expirationDate the expiration date 406 * @return the matching locks 407 */ 408 public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 409 java.util.Date expirationDate) { 410 return getPersistence().findByLtExpirationDate(expirationDate); 411 } 412 413 /** 414 * Returns a range of all the locks where expirationDate < ?. 415 * 416 * <p> 417 * 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.LockModelImpl}. 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. 418 * </p> 419 * 420 * @param expirationDate the expiration date 421 * @param start the lower bound of the range of locks 422 * @param end the upper bound of the range of locks (not inclusive) 423 * @return the range of matching locks 424 */ 425 public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 426 java.util.Date expirationDate, int start, int end) { 427 return getPersistence() 428 .findByLtExpirationDate(expirationDate, start, end); 429 } 430 431 /** 432 * Returns an ordered range of all the locks where expirationDate < ?. 433 * 434 * <p> 435 * 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.LockModelImpl}. 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. 436 * </p> 437 * 438 * @param expirationDate the expiration date 439 * @param start the lower bound of the range of locks 440 * @param end the upper bound of the range of locks (not inclusive) 441 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 442 * @return the ordered range of matching locks 443 */ 444 public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 445 java.util.Date expirationDate, int start, int end, 446 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 447 return getPersistence() 448 .findByLtExpirationDate(expirationDate, start, end, 449 orderByComparator); 450 } 451 452 /** 453 * Returns the first lock in the ordered set where expirationDate < ?. 454 * 455 * @param expirationDate the expiration date 456 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 457 * @return the first matching lock 458 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 459 */ 460 public static com.liferay.portal.model.Lock findByLtExpirationDate_First( 461 java.util.Date expirationDate, 462 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 463 throws com.liferay.portal.NoSuchLockException { 464 return getPersistence() 465 .findByLtExpirationDate_First(expirationDate, 466 orderByComparator); 467 } 468 469 /** 470 * Returns the first lock in the ordered set where expirationDate < ?. 471 * 472 * @param expirationDate the expiration date 473 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 474 * @return the first matching lock, or <code>null</code> if a matching lock could not be found 475 */ 476 public static com.liferay.portal.model.Lock fetchByLtExpirationDate_First( 477 java.util.Date expirationDate, 478 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 479 return getPersistence() 480 .fetchByLtExpirationDate_First(expirationDate, 481 orderByComparator); 482 } 483 484 /** 485 * Returns the last lock in the ordered set where expirationDate < ?. 486 * 487 * @param expirationDate the expiration date 488 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 489 * @return the last matching lock 490 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 491 */ 492 public static com.liferay.portal.model.Lock findByLtExpirationDate_Last( 493 java.util.Date expirationDate, 494 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 495 throws com.liferay.portal.NoSuchLockException { 496 return getPersistence() 497 .findByLtExpirationDate_Last(expirationDate, 498 orderByComparator); 499 } 500 501 /** 502 * Returns the last lock in the ordered set where expirationDate < ?. 503 * 504 * @param expirationDate the expiration date 505 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 506 * @return the last matching lock, or <code>null</code> if a matching lock could not be found 507 */ 508 public static com.liferay.portal.model.Lock fetchByLtExpirationDate_Last( 509 java.util.Date expirationDate, 510 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 511 return getPersistence() 512 .fetchByLtExpirationDate_Last(expirationDate, 513 orderByComparator); 514 } 515 516 /** 517 * Returns the locks before and after the current lock in the ordered set where expirationDate < ?. 518 * 519 * @param lockId the primary key of the current lock 520 * @param expirationDate the expiration date 521 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 522 * @return the previous, current, and next lock 523 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 524 */ 525 public static com.liferay.portal.model.Lock[] findByLtExpirationDate_PrevAndNext( 526 long lockId, java.util.Date expirationDate, 527 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) 528 throws com.liferay.portal.NoSuchLockException { 529 return getPersistence() 530 .findByLtExpirationDate_PrevAndNext(lockId, expirationDate, 531 orderByComparator); 532 } 533 534 /** 535 * Removes all the locks where expirationDate < ? from the database. 536 * 537 * @param expirationDate the expiration date 538 */ 539 public static void removeByLtExpirationDate(java.util.Date expirationDate) { 540 getPersistence().removeByLtExpirationDate(expirationDate); 541 } 542 543 /** 544 * Returns the number of locks where expirationDate < ?. 545 * 546 * @param expirationDate the expiration date 547 * @return the number of matching locks 548 */ 549 public static int countByLtExpirationDate(java.util.Date expirationDate) { 550 return getPersistence().countByLtExpirationDate(expirationDate); 551 } 552 553 /** 554 * Returns the lock where className = ? and key = ? or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found. 555 * 556 * @param className the class name 557 * @param key the key 558 * @return the matching lock 559 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 560 */ 561 public static com.liferay.portal.model.Lock findByC_K( 562 java.lang.String className, java.lang.String key) 563 throws com.liferay.portal.NoSuchLockException { 564 return getPersistence().findByC_K(className, key); 565 } 566 567 /** 568 * Returns the lock where className = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 569 * 570 * @param className the class name 571 * @param key the key 572 * @return the matching lock, or <code>null</code> if a matching lock could not be found 573 */ 574 public static com.liferay.portal.model.Lock fetchByC_K( 575 java.lang.String className, java.lang.String key) { 576 return getPersistence().fetchByC_K(className, key); 577 } 578 579 /** 580 * Returns the lock where className = ? and key = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 581 * 582 * @param className the class name 583 * @param key the key 584 * @param retrieveFromCache whether to use the finder cache 585 * @return the matching lock, or <code>null</code> if a matching lock could not be found 586 */ 587 public static com.liferay.portal.model.Lock fetchByC_K( 588 java.lang.String className, java.lang.String key, 589 boolean retrieveFromCache) { 590 return getPersistence().fetchByC_K(className, key, retrieveFromCache); 591 } 592 593 /** 594 * Removes the lock where className = ? and key = ? from the database. 595 * 596 * @param className the class name 597 * @param key the key 598 * @return the lock that was removed 599 */ 600 public static com.liferay.portal.model.Lock removeByC_K( 601 java.lang.String className, java.lang.String key) 602 throws com.liferay.portal.NoSuchLockException { 603 return getPersistence().removeByC_K(className, key); 604 } 605 606 /** 607 * Returns the number of locks where className = ? and key = ?. 608 * 609 * @param className the class name 610 * @param key the key 611 * @return the number of matching locks 612 */ 613 public static int countByC_K(java.lang.String className, 614 java.lang.String key) { 615 return getPersistence().countByC_K(className, key); 616 } 617 618 /** 619 * Caches the lock in the entity cache if it is enabled. 620 * 621 * @param lock the lock 622 */ 623 public static void cacheResult(com.liferay.portal.model.Lock lock) { 624 getPersistence().cacheResult(lock); 625 } 626 627 /** 628 * Caches the locks in the entity cache if it is enabled. 629 * 630 * @param locks the locks 631 */ 632 public static void cacheResult( 633 java.util.List<com.liferay.portal.model.Lock> locks) { 634 getPersistence().cacheResult(locks); 635 } 636 637 /** 638 * Creates a new lock with the primary key. Does not add the lock to the database. 639 * 640 * @param lockId the primary key for the new lock 641 * @return the new lock 642 */ 643 public static com.liferay.portal.model.Lock create(long lockId) { 644 return getPersistence().create(lockId); 645 } 646 647 /** 648 * Removes the lock with the primary key from the database. Also notifies the appropriate model listeners. 649 * 650 * @param lockId the primary key of the lock 651 * @return the lock that was removed 652 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 653 */ 654 public static com.liferay.portal.model.Lock remove(long lockId) 655 throws com.liferay.portal.NoSuchLockException { 656 return getPersistence().remove(lockId); 657 } 658 659 public static com.liferay.portal.model.Lock updateImpl( 660 com.liferay.portal.model.Lock lock) { 661 return getPersistence().updateImpl(lock); 662 } 663 664 /** 665 * Returns the lock with the primary key or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found. 666 * 667 * @param lockId the primary key of the lock 668 * @return the lock 669 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 670 */ 671 public static com.liferay.portal.model.Lock findByPrimaryKey(long lockId) 672 throws com.liferay.portal.NoSuchLockException { 673 return getPersistence().findByPrimaryKey(lockId); 674 } 675 676 /** 677 * Returns the lock with the primary key or returns <code>null</code> if it could not be found. 678 * 679 * @param lockId the primary key of the lock 680 * @return the lock, or <code>null</code> if a lock with the primary key could not be found 681 */ 682 public static com.liferay.portal.model.Lock fetchByPrimaryKey(long lockId) { 683 return getPersistence().fetchByPrimaryKey(lockId); 684 } 685 686 public static java.util.Map<java.io.Serializable, com.liferay.portal.model.Lock> fetchByPrimaryKeys( 687 java.util.Set<java.io.Serializable> primaryKeys) { 688 return getPersistence().fetchByPrimaryKeys(primaryKeys); 689 } 690 691 /** 692 * Returns all the locks. 693 * 694 * @return the locks 695 */ 696 public static java.util.List<com.liferay.portal.model.Lock> findAll() { 697 return getPersistence().findAll(); 698 } 699 700 /** 701 * Returns a range of all the locks. 702 * 703 * <p> 704 * 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.LockModelImpl}. 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. 705 * </p> 706 * 707 * @param start the lower bound of the range of locks 708 * @param end the upper bound of the range of locks (not inclusive) 709 * @return the range of locks 710 */ 711 public static java.util.List<com.liferay.portal.model.Lock> findAll( 712 int start, int end) { 713 return getPersistence().findAll(start, end); 714 } 715 716 /** 717 * Returns an ordered range of all the locks. 718 * 719 * <p> 720 * 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.LockModelImpl}. 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. 721 * </p> 722 * 723 * @param start the lower bound of the range of locks 724 * @param end the upper bound of the range of locks (not inclusive) 725 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 726 * @return the ordered range of locks 727 */ 728 public static java.util.List<com.liferay.portal.model.Lock> findAll( 729 int start, int end, 730 com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Lock> orderByComparator) { 731 return getPersistence().findAll(start, end, orderByComparator); 732 } 733 734 /** 735 * Removes all the locks from the database. 736 */ 737 public static void removeAll() { 738 getPersistence().removeAll(); 739 } 740 741 /** 742 * Returns the number of locks. 743 * 744 * @return the number of locks 745 */ 746 public static int countAll() { 747 return getPersistence().countAll(); 748 } 749 750 public static LockPersistence getPersistence() { 751 if (_persistence == null) { 752 _persistence = (LockPersistence)PortalBeanLocatorUtil.locate(LockPersistence.class.getName()); 753 754 ReferenceRegistry.registerReference(LockUtil.class, "_persistence"); 755 } 756 757 return _persistence; 758 } 759 760 /** 761 * @deprecated As of 6.2.0 762 */ 763 @Deprecated 764 public void setPersistence(LockPersistence persistence) { 765 } 766 767 private static LockPersistence _persistence; 768 }