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 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 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 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 * Returns 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 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 * Returns 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 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 * Returns all the locks where uuid = ?. 195 * 196 * @param uuid the uuid 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 * Returns 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 214 * @param start the lower bound of the range of locks 215 * @param end the upper bound of the range of locks (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 * Returns 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 233 * @param start the lower bound of the range of locks 234 * @param end the upper bound of the range of locks (not inclusive) 235 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 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 * Returns 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 254 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 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 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 297 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns all the locks where expirationDate < ?. 313 * 314 * @param expirationDate the expiration date 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 * Returns 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 332 * @param start the lower bound of the range of locks 333 * @param end the upper bound of the range of locks (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 * Returns 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 352 * @param start the lower bound of the range of locks 353 * @param end the upper bound of the range of locks (not inclusive) 354 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 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 * Returns 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 375 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 398 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 422 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 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 * Returns 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 441 * @param key the key 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 * Returns 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 457 * @param key the key 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 * Returns 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 471 * @param key the key 472 * @param retrieveFromCache whether to use the finder cache 473 * @return the matching lock, or <code>null</code> if a matching lock could not be found 474 * @throws SystemException if a system exception occurred 475 */ 476 public static com.liferay.portal.model.Lock fetchByC_K( 477 java.lang.String className, java.lang.String key, 478 boolean retrieveFromCache) 479 throws com.liferay.portal.kernel.exception.SystemException { 480 return getPersistence().fetchByC_K(className, key, retrieveFromCache); 481 } 482 483 /** 484 * Returns all the locks. 485 * 486 * @return the locks 487 * @throws SystemException if a system exception occurred 488 */ 489 public static java.util.List<com.liferay.portal.model.Lock> findAll() 490 throws com.liferay.portal.kernel.exception.SystemException { 491 return getPersistence().findAll(); 492 } 493 494 /** 495 * Returns a range of all the locks. 496 * 497 * <p> 498 * 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. 499 * </p> 500 * 501 * @param start the lower bound of the range of locks 502 * @param end the upper bound of the range of locks (not inclusive) 503 * @return the range of locks 504 * @throws SystemException if a system exception occurred 505 */ 506 public static java.util.List<com.liferay.portal.model.Lock> findAll( 507 int start, int end) 508 throws com.liferay.portal.kernel.exception.SystemException { 509 return getPersistence().findAll(start, end); 510 } 511 512 /** 513 * Returns an ordered range of all the locks. 514 * 515 * <p> 516 * 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. 517 * </p> 518 * 519 * @param start the lower bound of the range of locks 520 * @param end the upper bound of the range of locks (not inclusive) 521 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 522 * @return the ordered range of locks 523 * @throws SystemException if a system exception occurred 524 */ 525 public static java.util.List<com.liferay.portal.model.Lock> findAll( 526 int start, int end, 527 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 528 throws com.liferay.portal.kernel.exception.SystemException { 529 return getPersistence().findAll(start, end, orderByComparator); 530 } 531 532 /** 533 * Removes all the locks where uuid = ? from the database. 534 * 535 * @param uuid the uuid 536 * @throws SystemException if a system exception occurred 537 */ 538 public static void removeByUuid(java.lang.String uuid) 539 throws com.liferay.portal.kernel.exception.SystemException { 540 getPersistence().removeByUuid(uuid); 541 } 542 543 /** 544 * Removes all the locks where expirationDate < ? from the database. 545 * 546 * @param expirationDate the expiration date 547 * @throws SystemException if a system exception occurred 548 */ 549 public static void removeByLtExpirationDate(java.util.Date expirationDate) 550 throws com.liferay.portal.kernel.exception.SystemException { 551 getPersistence().removeByLtExpirationDate(expirationDate); 552 } 553 554 /** 555 * Removes the lock where className = ? and key = ? from the database. 556 * 557 * @param className the class name 558 * @param key the key 559 * @throws SystemException if a system exception occurred 560 */ 561 public static void removeByC_K(java.lang.String className, 562 java.lang.String key) 563 throws com.liferay.portal.NoSuchLockException, 564 com.liferay.portal.kernel.exception.SystemException { 565 getPersistence().removeByC_K(className, key); 566 } 567 568 /** 569 * Removes all the locks from the database. 570 * 571 * @throws SystemException if a system exception occurred 572 */ 573 public static void removeAll() 574 throws com.liferay.portal.kernel.exception.SystemException { 575 getPersistence().removeAll(); 576 } 577 578 /** 579 * Returns the number of locks where uuid = ?. 580 * 581 * @param uuid the uuid 582 * @return the number of matching locks 583 * @throws SystemException if a system exception occurred 584 */ 585 public static int countByUuid(java.lang.String uuid) 586 throws com.liferay.portal.kernel.exception.SystemException { 587 return getPersistence().countByUuid(uuid); 588 } 589 590 /** 591 * Returns the number of locks where expirationDate < ?. 592 * 593 * @param expirationDate the expiration date 594 * @return the number of matching locks 595 * @throws SystemException if a system exception occurred 596 */ 597 public static int countByLtExpirationDate(java.util.Date expirationDate) 598 throws com.liferay.portal.kernel.exception.SystemException { 599 return getPersistence().countByLtExpirationDate(expirationDate); 600 } 601 602 /** 603 * Returns the number of locks where className = ? and key = ?. 604 * 605 * @param className the class name 606 * @param key the key 607 * @return the number of matching locks 608 * @throws SystemException if a system exception occurred 609 */ 610 public static int countByC_K(java.lang.String className, 611 java.lang.String key) 612 throws com.liferay.portal.kernel.exception.SystemException { 613 return getPersistence().countByC_K(className, key); 614 } 615 616 /** 617 * Returns the number of locks. 618 * 619 * @return the number of locks 620 * @throws SystemException if a system exception occurred 621 */ 622 public static int countAll() 623 throws com.liferay.portal.kernel.exception.SystemException { 624 return getPersistence().countAll(); 625 } 626 627 public static LockPersistence getPersistence() { 628 if (_persistence == null) { 629 _persistence = (LockPersistence)PortalBeanLocatorUtil.locate(LockPersistence.class.getName()); 630 631 ReferenceRegistry.registerReference(LockUtil.class, "_persistence"); 632 } 633 634 return _persistence; 635 } 636 637 public void setPersistence(LockPersistence persistence) { 638 _persistence = persistence; 639 640 ReferenceRegistry.registerReference(LockUtil.class, "_persistence"); 641 } 642 643 private static LockPersistence _persistence; 644 }