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