001 /** 002 * Copyright (c) 2000-2010 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.model.Lock; 022 import com.liferay.portal.service.ServiceContext; 023 024 import java.util.List; 025 026 /** 027 * 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. 028 * 029 * <p> 030 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class. 031 * </p> 032 * 033 * <p> 034 * Caching information and settings can be found in <code>portal.properties</code> 035 * </p> 036 * 037 * @author Brian Wing Shun Chan 038 * @see LockPersistence 039 * @see LockPersistenceImpl 040 * @generated 041 */ 042 public class LockUtil { 043 /** 044 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache() 045 */ 046 public static void clearCache() { 047 getPersistence().clearCache(); 048 } 049 050 /** 051 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel) 052 */ 053 public static void clearCache(Lock lock) { 054 getPersistence().clearCache(lock); 055 } 056 057 /** 058 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery) 059 */ 060 public long countWithDynamicQuery(DynamicQuery dynamicQuery) 061 throws SystemException { 062 return getPersistence().countWithDynamicQuery(dynamicQuery); 063 } 064 065 /** 066 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery) 067 */ 068 public static List<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery) 069 throws SystemException { 070 return getPersistence().findWithDynamicQuery(dynamicQuery); 071 } 072 073 /** 074 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int) 075 */ 076 public static List<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery, 077 int start, int end) throws SystemException { 078 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end); 079 } 080 081 /** 082 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator) 083 */ 084 public static List<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery, 085 int start, int end, OrderByComparator orderByComparator) 086 throws SystemException { 087 return getPersistence() 088 .findWithDynamicQuery(dynamicQuery, start, end, 089 orderByComparator); 090 } 091 092 /** 093 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel) 094 */ 095 public static Lock remove(Lock lock) throws SystemException { 096 return getPersistence().remove(lock); 097 } 098 099 /** 100 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean) 101 */ 102 public static Lock update(Lock lock, boolean merge) 103 throws SystemException { 104 return getPersistence().update(lock, merge); 105 } 106 107 /** 108 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext) 109 */ 110 public static Lock update(Lock lock, boolean merge, 111 ServiceContext serviceContext) throws SystemException { 112 return getPersistence().update(lock, merge, serviceContext); 113 } 114 115 /** 116 * Caches the lock in the entity cache if it is enabled. 117 * 118 * @param lock the lock to cache 119 */ 120 public static void cacheResult(com.liferay.portal.model.Lock lock) { 121 getPersistence().cacheResult(lock); 122 } 123 124 /** 125 * Caches the locks in the entity cache if it is enabled. 126 * 127 * @param locks the locks to cache 128 */ 129 public static void cacheResult( 130 java.util.List<com.liferay.portal.model.Lock> locks) { 131 getPersistence().cacheResult(locks); 132 } 133 134 /** 135 * Creates a new lock with the primary key. Does not add the lock to the database. 136 * 137 * @param lockId the primary key for the new lock 138 * @return the new lock 139 */ 140 public static com.liferay.portal.model.Lock create(long lockId) { 141 return getPersistence().create(lockId); 142 } 143 144 /** 145 * Removes the lock with the primary key from the database. Also notifies the appropriate model listeners. 146 * 147 * @param lockId the primary key of the lock to remove 148 * @return the lock that was removed 149 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 150 * @throws SystemException if a system exception occurred 151 */ 152 public static com.liferay.portal.model.Lock remove(long lockId) 153 throws com.liferay.portal.NoSuchLockException, 154 com.liferay.portal.kernel.exception.SystemException { 155 return getPersistence().remove(lockId); 156 } 157 158 public static com.liferay.portal.model.Lock updateImpl( 159 com.liferay.portal.model.Lock lock, boolean merge) 160 throws com.liferay.portal.kernel.exception.SystemException { 161 return getPersistence().updateImpl(lock, merge); 162 } 163 164 /** 165 * Finds the lock with the primary key or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found. 166 * 167 * @param lockId the primary key of the lock to find 168 * @return the lock 169 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 170 * @throws SystemException if a system exception occurred 171 */ 172 public static com.liferay.portal.model.Lock findByPrimaryKey(long lockId) 173 throws com.liferay.portal.NoSuchLockException, 174 com.liferay.portal.kernel.exception.SystemException { 175 return getPersistence().findByPrimaryKey(lockId); 176 } 177 178 /** 179 * Finds the lock with the primary key or returns <code>null</code> if it could not be found. 180 * 181 * @param lockId the primary key of the lock to find 182 * @return the lock, or <code>null</code> if a lock with the primary key could not be found 183 * @throws SystemException if a system exception occurred 184 */ 185 public static com.liferay.portal.model.Lock fetchByPrimaryKey(long lockId) 186 throws com.liferay.portal.kernel.exception.SystemException { 187 return getPersistence().fetchByPrimaryKey(lockId); 188 } 189 190 /** 191 * Finds all the locks where uuid = ?. 192 * 193 * @param uuid the uuid to search with 194 * @return the matching locks 195 * @throws SystemException if a system exception occurred 196 */ 197 public static java.util.List<com.liferay.portal.model.Lock> findByUuid( 198 java.lang.String uuid) 199 throws com.liferay.portal.kernel.exception.SystemException { 200 return getPersistence().findByUuid(uuid); 201 } 202 203 /** 204 * Finds a range of all the locks where uuid = ?. 205 * 206 * <p> 207 * 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. 208 * </p> 209 * 210 * @param uuid the uuid to search with 211 * @param start the lower bound of the range of locks to return 212 * @param end the upper bound of the range of locks to return (not inclusive) 213 * @return the range of matching locks 214 * @throws SystemException if a system exception occurred 215 */ 216 public static java.util.List<com.liferay.portal.model.Lock> findByUuid( 217 java.lang.String uuid, int start, int end) 218 throws com.liferay.portal.kernel.exception.SystemException { 219 return getPersistence().findByUuid(uuid, start, end); 220 } 221 222 /** 223 * Finds an ordered range of all the locks where uuid = ?. 224 * 225 * <p> 226 * 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. 227 * </p> 228 * 229 * @param uuid the uuid to search with 230 * @param start the lower bound of the range of locks to return 231 * @param end the upper bound of the range of locks to return (not inclusive) 232 * @param orderByComparator the comparator to order the results by 233 * @return the ordered range of matching locks 234 * @throws SystemException if a system exception occurred 235 */ 236 public static java.util.List<com.liferay.portal.model.Lock> findByUuid( 237 java.lang.String uuid, int start, int end, 238 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 239 throws com.liferay.portal.kernel.exception.SystemException { 240 return getPersistence().findByUuid(uuid, start, end, orderByComparator); 241 } 242 243 /** 244 * Finds the first lock in the ordered set where uuid = ?. 245 * 246 * <p> 247 * 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. 248 * </p> 249 * 250 * @param uuid the uuid to search with 251 * @param orderByComparator the comparator to order the set by 252 * @return the first matching lock 253 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 254 * @throws SystemException if a system exception occurred 255 */ 256 public static com.liferay.portal.model.Lock findByUuid_First( 257 java.lang.String uuid, 258 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 259 throws com.liferay.portal.NoSuchLockException, 260 com.liferay.portal.kernel.exception.SystemException { 261 return getPersistence().findByUuid_First(uuid, orderByComparator); 262 } 263 264 /** 265 * Finds the last lock in the ordered set where uuid = ?. 266 * 267 * <p> 268 * 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. 269 * </p> 270 * 271 * @param uuid the uuid to search with 272 * @param orderByComparator the comparator to order the set by 273 * @return the last matching lock 274 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 275 * @throws SystemException if a system exception occurred 276 */ 277 public static com.liferay.portal.model.Lock findByUuid_Last( 278 java.lang.String uuid, 279 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 280 throws com.liferay.portal.NoSuchLockException, 281 com.liferay.portal.kernel.exception.SystemException { 282 return getPersistence().findByUuid_Last(uuid, orderByComparator); 283 } 284 285 /** 286 * Finds the locks before and after the current lock in the ordered set where uuid = ?. 287 * 288 * <p> 289 * 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. 290 * </p> 291 * 292 * @param lockId the primary key of the current lock 293 * @param uuid the uuid to search with 294 * @param orderByComparator the comparator to order the set by 295 * @return the previous, current, and next lock 296 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 297 * @throws SystemException if a system exception occurred 298 */ 299 public static com.liferay.portal.model.Lock[] findByUuid_PrevAndNext( 300 long lockId, java.lang.String uuid, 301 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 302 throws com.liferay.portal.NoSuchLockException, 303 com.liferay.portal.kernel.exception.SystemException { 304 return getPersistence() 305 .findByUuid_PrevAndNext(lockId, uuid, orderByComparator); 306 } 307 308 /** 309 * Finds all the locks where expirationDate < ?. 310 * 311 * @param expirationDate the expiration date to search with 312 * @return the matching locks 313 * @throws SystemException if a system exception occurred 314 */ 315 public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 316 java.util.Date expirationDate) 317 throws com.liferay.portal.kernel.exception.SystemException { 318 return getPersistence().findByLtExpirationDate(expirationDate); 319 } 320 321 /** 322 * Finds a range of all the locks where expirationDate < ?. 323 * 324 * <p> 325 * 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. 326 * </p> 327 * 328 * @param expirationDate the expiration date to search with 329 * @param start the lower bound of the range of locks to return 330 * @param end the upper bound of the range of locks to return (not inclusive) 331 * @return the range of matching locks 332 * @throws SystemException if a system exception occurred 333 */ 334 public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 335 java.util.Date expirationDate, int start, int end) 336 throws com.liferay.portal.kernel.exception.SystemException { 337 return getPersistence() 338 .findByLtExpirationDate(expirationDate, start, end); 339 } 340 341 /** 342 * Finds an ordered range of all the locks where expirationDate < ?. 343 * 344 * <p> 345 * 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. 346 * </p> 347 * 348 * @param expirationDate the expiration date to search with 349 * @param start the lower bound of the range of locks to return 350 * @param end the upper bound of the range of locks to return (not inclusive) 351 * @param orderByComparator the comparator to order the results by 352 * @return the ordered range of matching locks 353 * @throws SystemException if a system exception occurred 354 */ 355 public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 356 java.util.Date expirationDate, int start, int end, 357 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 358 throws com.liferay.portal.kernel.exception.SystemException { 359 return getPersistence() 360 .findByLtExpirationDate(expirationDate, start, end, 361 orderByComparator); 362 } 363 364 /** 365 * Finds the first lock in the ordered set where expirationDate < ?. 366 * 367 * <p> 368 * 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. 369 * </p> 370 * 371 * @param expirationDate the expiration date to search with 372 * @param orderByComparator the comparator to order the set by 373 * @return the first matching lock 374 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 375 * @throws SystemException if a system exception occurred 376 */ 377 public static com.liferay.portal.model.Lock findByLtExpirationDate_First( 378 java.util.Date expirationDate, 379 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 380 throws com.liferay.portal.NoSuchLockException, 381 com.liferay.portal.kernel.exception.SystemException { 382 return getPersistence() 383 .findByLtExpirationDate_First(expirationDate, 384 orderByComparator); 385 } 386 387 /** 388 * Finds the last lock in the ordered set where expirationDate < ?. 389 * 390 * <p> 391 * 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. 392 * </p> 393 * 394 * @param expirationDate the expiration date to search with 395 * @param orderByComparator the comparator to order the set by 396 * @return the last matching lock 397 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 398 * @throws SystemException if a system exception occurred 399 */ 400 public static com.liferay.portal.model.Lock findByLtExpirationDate_Last( 401 java.util.Date expirationDate, 402 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 403 throws com.liferay.portal.NoSuchLockException, 404 com.liferay.portal.kernel.exception.SystemException { 405 return getPersistence() 406 .findByLtExpirationDate_Last(expirationDate, 407 orderByComparator); 408 } 409 410 /** 411 * Finds the locks before and after the current lock in the ordered set where expirationDate < ?. 412 * 413 * <p> 414 * 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. 415 * </p> 416 * 417 * @param lockId the primary key of the current lock 418 * @param expirationDate the expiration date to search with 419 * @param orderByComparator the comparator to order the set by 420 * @return the previous, current, and next lock 421 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 422 * @throws SystemException if a system exception occurred 423 */ 424 public static com.liferay.portal.model.Lock[] findByLtExpirationDate_PrevAndNext( 425 long lockId, java.util.Date expirationDate, 426 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 427 throws com.liferay.portal.NoSuchLockException, 428 com.liferay.portal.kernel.exception.SystemException { 429 return getPersistence() 430 .findByLtExpirationDate_PrevAndNext(lockId, expirationDate, 431 orderByComparator); 432 } 433 434 /** 435 * Finds the lock where className = ? and key = ? or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found. 436 * 437 * @param className the class name to search with 438 * @param key the key to search with 439 * @return the matching lock 440 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 441 * @throws SystemException if a system exception occurred 442 */ 443 public static com.liferay.portal.model.Lock findByC_K( 444 java.lang.String className, java.lang.String key) 445 throws com.liferay.portal.NoSuchLockException, 446 com.liferay.portal.kernel.exception.SystemException { 447 return getPersistence().findByC_K(className, key); 448 } 449 450 /** 451 * Finds the lock where className = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 452 * 453 * @param className the class name to search with 454 * @param key the key to search with 455 * @return the matching lock, or <code>null</code> if a matching lock could not be found 456 * @throws SystemException if a system exception occurred 457 */ 458 public static com.liferay.portal.model.Lock fetchByC_K( 459 java.lang.String className, java.lang.String key) 460 throws com.liferay.portal.kernel.exception.SystemException { 461 return getPersistence().fetchByC_K(className, key); 462 } 463 464 /** 465 * Finds the lock where className = ? and key = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 466 * 467 * @param className the class name to search with 468 * @param key the key to search with 469 * @return the matching lock, or <code>null</code> if a matching lock could not be found 470 * @throws SystemException if a system exception occurred 471 */ 472 public static com.liferay.portal.model.Lock fetchByC_K( 473 java.lang.String className, java.lang.String key, 474 boolean retrieveFromCache) 475 throws com.liferay.portal.kernel.exception.SystemException { 476 return getPersistence().fetchByC_K(className, key, retrieveFromCache); 477 } 478 479 /** 480 * Finds all the locks. 481 * 482 * @return the locks 483 * @throws SystemException if a system exception occurred 484 */ 485 public static java.util.List<com.liferay.portal.model.Lock> findAll() 486 throws com.liferay.portal.kernel.exception.SystemException { 487 return getPersistence().findAll(); 488 } 489 490 /** 491 * Finds a range of all the locks. 492 * 493 * <p> 494 * 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. 495 * </p> 496 * 497 * @param start the lower bound of the range of locks to return 498 * @param end the upper bound of the range of locks to return (not inclusive) 499 * @return the range of locks 500 * @throws SystemException if a system exception occurred 501 */ 502 public static java.util.List<com.liferay.portal.model.Lock> findAll( 503 int start, int end) 504 throws com.liferay.portal.kernel.exception.SystemException { 505 return getPersistence().findAll(start, end); 506 } 507 508 /** 509 * Finds an ordered range of all the locks. 510 * 511 * <p> 512 * 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. 513 * </p> 514 * 515 * @param start the lower bound of the range of locks to return 516 * @param end the upper bound of the range of locks to return (not inclusive) 517 * @param orderByComparator the comparator to order the results by 518 * @return the ordered range of locks 519 * @throws SystemException if a system exception occurred 520 */ 521 public static java.util.List<com.liferay.portal.model.Lock> findAll( 522 int start, int end, 523 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 524 throws com.liferay.portal.kernel.exception.SystemException { 525 return getPersistence().findAll(start, end, orderByComparator); 526 } 527 528 /** 529 * Removes all the locks where uuid = ? from the database. 530 * 531 * @param uuid the uuid to search with 532 * @throws SystemException if a system exception occurred 533 */ 534 public static void removeByUuid(java.lang.String uuid) 535 throws com.liferay.portal.kernel.exception.SystemException { 536 getPersistence().removeByUuid(uuid); 537 } 538 539 /** 540 * Removes all the locks where expirationDate < ? from the database. 541 * 542 * @param expirationDate the expiration date to search with 543 * @throws SystemException if a system exception occurred 544 */ 545 public static void removeByLtExpirationDate(java.util.Date expirationDate) 546 throws com.liferay.portal.kernel.exception.SystemException { 547 getPersistence().removeByLtExpirationDate(expirationDate); 548 } 549 550 /** 551 * Removes the lock where className = ? and key = ? from the database. 552 * 553 * @param className the class name to search with 554 * @param key the key to search with 555 * @throws SystemException if a system exception occurred 556 */ 557 public static void removeByC_K(java.lang.String className, 558 java.lang.String key) 559 throws com.liferay.portal.NoSuchLockException, 560 com.liferay.portal.kernel.exception.SystemException { 561 getPersistence().removeByC_K(className, key); 562 } 563 564 /** 565 * Removes all the locks from the database. 566 * 567 * @throws SystemException if a system exception occurred 568 */ 569 public static void removeAll() 570 throws com.liferay.portal.kernel.exception.SystemException { 571 getPersistence().removeAll(); 572 } 573 574 /** 575 * Counts all the locks where uuid = ?. 576 * 577 * @param uuid the uuid to search with 578 * @return the number of matching locks 579 * @throws SystemException if a system exception occurred 580 */ 581 public static int countByUuid(java.lang.String uuid) 582 throws com.liferay.portal.kernel.exception.SystemException { 583 return getPersistence().countByUuid(uuid); 584 } 585 586 /** 587 * Counts all the locks where expirationDate < ?. 588 * 589 * @param expirationDate the expiration date to search with 590 * @return the number of matching locks 591 * @throws SystemException if a system exception occurred 592 */ 593 public static int countByLtExpirationDate(java.util.Date expirationDate) 594 throws com.liferay.portal.kernel.exception.SystemException { 595 return getPersistence().countByLtExpirationDate(expirationDate); 596 } 597 598 /** 599 * Counts all the locks where className = ? and key = ?. 600 * 601 * @param className the class name to search with 602 * @param key the key to search with 603 * @return the number of matching locks 604 * @throws SystemException if a system exception occurred 605 */ 606 public static int countByC_K(java.lang.String className, 607 java.lang.String key) 608 throws com.liferay.portal.kernel.exception.SystemException { 609 return getPersistence().countByC_K(className, key); 610 } 611 612 /** 613 * Counts all the locks. 614 * 615 * @return the number of locks 616 * @throws SystemException if a system exception occurred 617 */ 618 public static int countAll() 619 throws com.liferay.portal.kernel.exception.SystemException { 620 return getPersistence().countAll(); 621 } 622 623 public static LockPersistence getPersistence() { 624 if (_persistence == null) { 625 _persistence = (LockPersistence)PortalBeanLocatorUtil.locate(LockPersistence.class.getName()); 626 } 627 628 return _persistence; 629 } 630 631 public void setPersistence(LockPersistence persistence) { 632 _persistence = persistence; 633 } 634 635 private static LockPersistence _persistence; 636 }