001 /** 002 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.service.persistence; 016 017 import com.liferay.portal.kernel.exception.SystemException; 018 import com.liferay.portal.model.Lock; 019 020 /** 021 * The persistence interface for the lock service. 022 * 023 * <p> 024 * Caching information and settings can be found in <code>portal.properties</code> 025 * </p> 026 * 027 * @author Brian Wing Shun Chan 028 * @see LockPersistenceImpl 029 * @see LockUtil 030 * @generated 031 */ 032 public interface LockPersistence extends BasePersistence<Lock> { 033 /* 034 * NOTE FOR DEVELOPERS: 035 * 036 * Never modify or reference this interface directly. Always use {@link LockUtil} to access the lock persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface. 037 */ 038 039 /** 040 * Caches the lock in the entity cache if it is enabled. 041 * 042 * @param lock the lock 043 */ 044 public void cacheResult(com.liferay.portal.model.Lock lock); 045 046 /** 047 * Caches the locks in the entity cache if it is enabled. 048 * 049 * @param locks the locks 050 */ 051 public void cacheResult(java.util.List<com.liferay.portal.model.Lock> locks); 052 053 /** 054 * Creates a new lock with the primary key. Does not add the lock to the database. 055 * 056 * @param lockId the primary key for the new lock 057 * @return the new lock 058 */ 059 public com.liferay.portal.model.Lock create(long lockId); 060 061 /** 062 * Removes the lock with the primary key from the database. Also notifies the appropriate model listeners. 063 * 064 * @param lockId the primary key of the lock 065 * @return the lock that was removed 066 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 067 * @throws SystemException if a system exception occurred 068 */ 069 public com.liferay.portal.model.Lock remove(long lockId) 070 throws com.liferay.portal.NoSuchLockException, 071 com.liferay.portal.kernel.exception.SystemException; 072 073 public com.liferay.portal.model.Lock updateImpl( 074 com.liferay.portal.model.Lock lock, boolean merge) 075 throws com.liferay.portal.kernel.exception.SystemException; 076 077 /** 078 * Returns the lock with the primary key or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found. 079 * 080 * @param lockId the primary key of the lock 081 * @return the lock 082 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 083 * @throws SystemException if a system exception occurred 084 */ 085 public com.liferay.portal.model.Lock findByPrimaryKey(long lockId) 086 throws com.liferay.portal.NoSuchLockException, 087 com.liferay.portal.kernel.exception.SystemException; 088 089 /** 090 * Returns the lock with the primary key or returns <code>null</code> if it could not be found. 091 * 092 * @param lockId the primary key of the lock 093 * @return the lock, or <code>null</code> if a lock with the primary key could not be found 094 * @throws SystemException if a system exception occurred 095 */ 096 public com.liferay.portal.model.Lock fetchByPrimaryKey(long lockId) 097 throws com.liferay.portal.kernel.exception.SystemException; 098 099 /** 100 * Returns all the locks where uuid = ?. 101 * 102 * @param uuid the uuid 103 * @return the matching locks 104 * @throws SystemException if a system exception occurred 105 */ 106 public java.util.List<com.liferay.portal.model.Lock> findByUuid( 107 java.lang.String uuid) 108 throws com.liferay.portal.kernel.exception.SystemException; 109 110 /** 111 * Returns a range of all the locks where uuid = ?. 112 * 113 * <p> 114 * 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. 115 * </p> 116 * 117 * @param uuid the uuid 118 * @param start the lower bound of the range of locks 119 * @param end the upper bound of the range of locks (not inclusive) 120 * @return the range of matching locks 121 * @throws SystemException if a system exception occurred 122 */ 123 public java.util.List<com.liferay.portal.model.Lock> findByUuid( 124 java.lang.String uuid, int start, int end) 125 throws com.liferay.portal.kernel.exception.SystemException; 126 127 /** 128 * Returns an ordered range of all the locks where uuid = ?. 129 * 130 * <p> 131 * 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. 132 * </p> 133 * 134 * @param uuid the uuid 135 * @param start the lower bound of the range of locks 136 * @param end the upper bound of the range of locks (not inclusive) 137 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 138 * @return the ordered range of matching locks 139 * @throws SystemException if a system exception occurred 140 */ 141 public java.util.List<com.liferay.portal.model.Lock> findByUuid( 142 java.lang.String uuid, int start, int end, 143 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 144 throws com.liferay.portal.kernel.exception.SystemException; 145 146 /** 147 * Returns the first lock in the ordered set where uuid = ?. 148 * 149 * <p> 150 * 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. 151 * </p> 152 * 153 * @param uuid the uuid 154 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 155 * @return the first matching lock 156 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 157 * @throws SystemException if a system exception occurred 158 */ 159 public com.liferay.portal.model.Lock findByUuid_First( 160 java.lang.String uuid, 161 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 162 throws com.liferay.portal.NoSuchLockException, 163 com.liferay.portal.kernel.exception.SystemException; 164 165 /** 166 * Returns the last lock in the ordered set where uuid = ?. 167 * 168 * <p> 169 * 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. 170 * </p> 171 * 172 * @param uuid the uuid 173 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 174 * @return the last matching lock 175 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 176 * @throws SystemException if a system exception occurred 177 */ 178 public com.liferay.portal.model.Lock findByUuid_Last( 179 java.lang.String uuid, 180 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 181 throws com.liferay.portal.NoSuchLockException, 182 com.liferay.portal.kernel.exception.SystemException; 183 184 /** 185 * Returns the locks before and after the current lock in the ordered set where uuid = ?. 186 * 187 * <p> 188 * 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. 189 * </p> 190 * 191 * @param lockId the primary key of the current lock 192 * @param uuid the uuid 193 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 194 * @return the previous, current, and next lock 195 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 196 * @throws SystemException if a system exception occurred 197 */ 198 public com.liferay.portal.model.Lock[] findByUuid_PrevAndNext(long lockId, 199 java.lang.String uuid, 200 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 201 throws com.liferay.portal.NoSuchLockException, 202 com.liferay.portal.kernel.exception.SystemException; 203 204 /** 205 * Returns all the locks where expirationDate < ?. 206 * 207 * @param expirationDate the expiration date 208 * @return the matching locks 209 * @throws SystemException if a system exception occurred 210 */ 211 public java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 212 java.util.Date expirationDate) 213 throws com.liferay.portal.kernel.exception.SystemException; 214 215 /** 216 * Returns a range of all the locks where expirationDate < ?. 217 * 218 * <p> 219 * 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. 220 * </p> 221 * 222 * @param expirationDate the expiration date 223 * @param start the lower bound of the range of locks 224 * @param end the upper bound of the range of locks (not inclusive) 225 * @return the range of matching locks 226 * @throws SystemException if a system exception occurred 227 */ 228 public java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 229 java.util.Date expirationDate, int start, int end) 230 throws com.liferay.portal.kernel.exception.SystemException; 231 232 /** 233 * Returns an ordered range of all the locks where expirationDate < ?. 234 * 235 * <p> 236 * 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. 237 * </p> 238 * 239 * @param expirationDate the expiration date 240 * @param start the lower bound of the range of locks 241 * @param end the upper bound of the range of locks (not inclusive) 242 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 243 * @return the ordered range of matching locks 244 * @throws SystemException if a system exception occurred 245 */ 246 public java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate( 247 java.util.Date expirationDate, int start, int end, 248 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 249 throws com.liferay.portal.kernel.exception.SystemException; 250 251 /** 252 * Returns the first lock in the ordered set where expirationDate < ?. 253 * 254 * <p> 255 * 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. 256 * </p> 257 * 258 * @param expirationDate the expiration date 259 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 260 * @return the first matching lock 261 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 262 * @throws SystemException if a system exception occurred 263 */ 264 public com.liferay.portal.model.Lock findByLtExpirationDate_First( 265 java.util.Date expirationDate, 266 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 267 throws com.liferay.portal.NoSuchLockException, 268 com.liferay.portal.kernel.exception.SystemException; 269 270 /** 271 * Returns the last lock in the ordered set where expirationDate < ?. 272 * 273 * <p> 274 * 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. 275 * </p> 276 * 277 * @param expirationDate the expiration date 278 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 279 * @return the last matching lock 280 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 281 * @throws SystemException if a system exception occurred 282 */ 283 public com.liferay.portal.model.Lock findByLtExpirationDate_Last( 284 java.util.Date expirationDate, 285 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 286 throws com.liferay.portal.NoSuchLockException, 287 com.liferay.portal.kernel.exception.SystemException; 288 289 /** 290 * Returns the locks before and after the current lock in the ordered set where expirationDate < ?. 291 * 292 * <p> 293 * 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. 294 * </p> 295 * 296 * @param lockId the primary key of the current lock 297 * @param expirationDate the expiration date 298 * @param orderByComparator the comparator to order the set by (optionally <code>null</code>) 299 * @return the previous, current, and next lock 300 * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found 301 * @throws SystemException if a system exception occurred 302 */ 303 public com.liferay.portal.model.Lock[] findByLtExpirationDate_PrevAndNext( 304 long lockId, java.util.Date expirationDate, 305 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 306 throws com.liferay.portal.NoSuchLockException, 307 com.liferay.portal.kernel.exception.SystemException; 308 309 /** 310 * Returns the lock where className = ? and key = ? or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found. 311 * 312 * @param className the class name 313 * @param key the key 314 * @return the matching lock 315 * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found 316 * @throws SystemException if a system exception occurred 317 */ 318 public com.liferay.portal.model.Lock findByC_K(java.lang.String className, 319 java.lang.String key) 320 throws com.liferay.portal.NoSuchLockException, 321 com.liferay.portal.kernel.exception.SystemException; 322 323 /** 324 * Returns the lock where className = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache. 325 * 326 * @param className the class name 327 * @param key the key 328 * @return the matching lock, or <code>null</code> if a matching lock could not be found 329 * @throws SystemException if a system exception occurred 330 */ 331 public com.liferay.portal.model.Lock fetchByC_K( 332 java.lang.String className, java.lang.String key) 333 throws com.liferay.portal.kernel.exception.SystemException; 334 335 /** 336 * Returns the lock where className = ? and key = ? or returns <code>null</code> if it could not be found, optionally using the finder cache. 337 * 338 * @param className the class name 339 * @param key the key 340 * @param retrieveFromCache whether to use the finder cache 341 * @return the matching lock, or <code>null</code> if a matching lock could not be found 342 * @throws SystemException if a system exception occurred 343 */ 344 public com.liferay.portal.model.Lock fetchByC_K( 345 java.lang.String className, java.lang.String key, 346 boolean retrieveFromCache) 347 throws com.liferay.portal.kernel.exception.SystemException; 348 349 /** 350 * Returns all the locks. 351 * 352 * @return the locks 353 * @throws SystemException if a system exception occurred 354 */ 355 public java.util.List<com.liferay.portal.model.Lock> findAll() 356 throws com.liferay.portal.kernel.exception.SystemException; 357 358 /** 359 * Returns a range of all the locks. 360 * 361 * <p> 362 * 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. 363 * </p> 364 * 365 * @param start the lower bound of the range of locks 366 * @param end the upper bound of the range of locks (not inclusive) 367 * @return the range of locks 368 * @throws SystemException if a system exception occurred 369 */ 370 public java.util.List<com.liferay.portal.model.Lock> findAll(int start, 371 int end) throws com.liferay.portal.kernel.exception.SystemException; 372 373 /** 374 * Returns an ordered range of all the locks. 375 * 376 * <p> 377 * 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. 378 * </p> 379 * 380 * @param start the lower bound of the range of locks 381 * @param end the upper bound of the range of locks (not inclusive) 382 * @param orderByComparator the comparator to order the results by (optionally <code>null</code>) 383 * @return the ordered range of locks 384 * @throws SystemException if a system exception occurred 385 */ 386 public java.util.List<com.liferay.portal.model.Lock> findAll(int start, 387 int end, 388 com.liferay.portal.kernel.util.OrderByComparator orderByComparator) 389 throws com.liferay.portal.kernel.exception.SystemException; 390 391 /** 392 * Removes all the locks where uuid = ? from the database. 393 * 394 * @param uuid the uuid 395 * @throws SystemException if a system exception occurred 396 */ 397 public void removeByUuid(java.lang.String uuid) 398 throws com.liferay.portal.kernel.exception.SystemException; 399 400 /** 401 * Removes all the locks where expirationDate < ? from the database. 402 * 403 * @param expirationDate the expiration date 404 * @throws SystemException if a system exception occurred 405 */ 406 public void removeByLtExpirationDate(java.util.Date expirationDate) 407 throws com.liferay.portal.kernel.exception.SystemException; 408 409 /** 410 * Removes the lock where className = ? and key = ? from the database. 411 * 412 * @param className the class name 413 * @param key the key 414 * @throws SystemException if a system exception occurred 415 */ 416 public void removeByC_K(java.lang.String className, java.lang.String key) 417 throws com.liferay.portal.NoSuchLockException, 418 com.liferay.portal.kernel.exception.SystemException; 419 420 /** 421 * Removes all the locks from the database. 422 * 423 * @throws SystemException if a system exception occurred 424 */ 425 public void removeAll() 426 throws com.liferay.portal.kernel.exception.SystemException; 427 428 /** 429 * Returns the number of locks where uuid = ?. 430 * 431 * @param uuid the uuid 432 * @return the number of matching locks 433 * @throws SystemException if a system exception occurred 434 */ 435 public int countByUuid(java.lang.String uuid) 436 throws com.liferay.portal.kernel.exception.SystemException; 437 438 /** 439 * Returns the number of locks where expirationDate < ?. 440 * 441 * @param expirationDate the expiration date 442 * @return the number of matching locks 443 * @throws SystemException if a system exception occurred 444 */ 445 public int countByLtExpirationDate(java.util.Date expirationDate) 446 throws com.liferay.portal.kernel.exception.SystemException; 447 448 /** 449 * Returns the number of locks where className = ? and key = ?. 450 * 451 * @param className the class name 452 * @param key the key 453 * @return the number of matching locks 454 * @throws SystemException if a system exception occurred 455 */ 456 public int countByC_K(java.lang.String className, java.lang.String key) 457 throws com.liferay.portal.kernel.exception.SystemException; 458 459 /** 460 * Returns the number of locks. 461 * 462 * @return the number of locks 463 * @throws SystemException if a system exception occurred 464 */ 465 public int countAll() 466 throws com.liferay.portal.kernel.exception.SystemException; 467 468 public Lock remove(Lock lock) throws SystemException; 469 }