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