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