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