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