001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.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 to cache
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 to cache
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 to remove
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            * Finds 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 to find
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            * Finds 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 to find
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            * Finds all the locks where uuid = &#63;.
101            *
102            * @param uuid the uuid to search with
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            * Finds a range of all the locks where uuid = &#63;.
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 to search with
118            * @param start the lower bound of the range of locks to return
119            * @param end the upper bound of the range of locks to return (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            * Finds an ordered range of all the locks where uuid = &#63;.
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 to search with
135            * @param start the lower bound of the range of locks to return
136            * @param end the upper bound of the range of locks to return (not inclusive)
137            * @param orderByComparator the comparator to order the results by
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            * Finds the first lock in the ordered set where uuid = &#63;.
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 to search with
154            * @param orderByComparator the comparator to order the set by
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            * Finds the last lock in the ordered set where uuid = &#63;.
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 to search with
173            * @param orderByComparator the comparator to order the set by
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            * Finds the locks before and after the current lock in the ordered set where uuid = &#63;.
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 to search with
193            * @param orderByComparator the comparator to order the set by
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            * Finds all the locks where expirationDate &lt; &#63;.
206            *
207            * @param expirationDate the expiration date to search with
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            * Finds a range of all the locks where expirationDate &lt; &#63;.
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 to search with
223            * @param start the lower bound of the range of locks to return
224            * @param end the upper bound of the range of locks to return (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            * Finds an ordered range of all the locks where expirationDate &lt; &#63;.
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 to search with
240            * @param start the lower bound of the range of locks to return
241            * @param end the upper bound of the range of locks to return (not inclusive)
242            * @param orderByComparator the comparator to order the results by
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            * Finds the first lock in the ordered set where expirationDate &lt; &#63;.
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 to search with
259            * @param orderByComparator the comparator to order the set by
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            * Finds the last lock in the ordered set where expirationDate &lt; &#63;.
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 to search with
278            * @param orderByComparator the comparator to order the set by
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            * Finds the locks before and after the current lock in the ordered set where expirationDate &lt; &#63;.
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 to search with
298            * @param orderByComparator the comparator to order the set by
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            * Finds the lock where className = &#63; and key = &#63; or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found.
311            *
312            * @param className the class name to search with
313            * @param key the key to search with
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            * Finds the lock where className = &#63; and key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
325            *
326            * @param className the class name to search with
327            * @param key the key to search with
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            * 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.
337            *
338            * @param className the class name to search with
339            * @param key the key to search with
340            * @return the matching lock, or <code>null</code> if a matching lock could not be found
341            * @throws SystemException if a system exception occurred
342            */
343            public com.liferay.portal.model.Lock fetchByC_K(
344                    java.lang.String className, java.lang.String key,
345                    boolean retrieveFromCache)
346                    throws com.liferay.portal.kernel.exception.SystemException;
347    
348            /**
349            * Finds all the locks.
350            *
351            * @return the locks
352            * @throws SystemException if a system exception occurred
353            */
354            public java.util.List<com.liferay.portal.model.Lock> findAll()
355                    throws com.liferay.portal.kernel.exception.SystemException;
356    
357            /**
358            * Finds a range of all the locks.
359            *
360            * <p>
361            * 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.
362            * </p>
363            *
364            * @param start the lower bound of the range of locks to return
365            * @param end the upper bound of the range of locks to return (not inclusive)
366            * @return the range of locks
367            * @throws SystemException if a system exception occurred
368            */
369            public java.util.List<com.liferay.portal.model.Lock> findAll(int start,
370                    int end) throws com.liferay.portal.kernel.exception.SystemException;
371    
372            /**
373            * Finds an ordered range of all the locks.
374            *
375            * <p>
376            * 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.
377            * </p>
378            *
379            * @param start the lower bound of the range of locks to return
380            * @param end the upper bound of the range of locks to return (not inclusive)
381            * @param orderByComparator the comparator to order the results by
382            * @return the ordered range of locks
383            * @throws SystemException if a system exception occurred
384            */
385            public java.util.List<com.liferay.portal.model.Lock> findAll(int start,
386                    int end,
387                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
388                    throws com.liferay.portal.kernel.exception.SystemException;
389    
390            /**
391            * Removes all the locks where uuid = &#63; from the database.
392            *
393            * @param uuid the uuid to search with
394            * @throws SystemException if a system exception occurred
395            */
396            public void removeByUuid(java.lang.String uuid)
397                    throws com.liferay.portal.kernel.exception.SystemException;
398    
399            /**
400            * Removes all the locks where expirationDate &lt; &#63; from the database.
401            *
402            * @param expirationDate the expiration date to search with
403            * @throws SystemException if a system exception occurred
404            */
405            public void removeByLtExpirationDate(java.util.Date expirationDate)
406                    throws com.liferay.portal.kernel.exception.SystemException;
407    
408            /**
409            * Removes the lock where className = &#63; and key = &#63; from the database.
410            *
411            * @param className the class name to search with
412            * @param key the key to search with
413            * @throws SystemException if a system exception occurred
414            */
415            public void removeByC_K(java.lang.String className, java.lang.String key)
416                    throws com.liferay.portal.NoSuchLockException,
417                            com.liferay.portal.kernel.exception.SystemException;
418    
419            /**
420            * Removes all the locks from the database.
421            *
422            * @throws SystemException if a system exception occurred
423            */
424            public void removeAll()
425                    throws com.liferay.portal.kernel.exception.SystemException;
426    
427            /**
428            * Counts all the locks where uuid = &#63;.
429            *
430            * @param uuid the uuid to search with
431            * @return the number of matching locks
432            * @throws SystemException if a system exception occurred
433            */
434            public int countByUuid(java.lang.String uuid)
435                    throws com.liferay.portal.kernel.exception.SystemException;
436    
437            /**
438            * Counts all the locks where expirationDate &lt; &#63;.
439            *
440            * @param expirationDate the expiration date to search with
441            * @return the number of matching locks
442            * @throws SystemException if a system exception occurred
443            */
444            public int countByLtExpirationDate(java.util.Date expirationDate)
445                    throws com.liferay.portal.kernel.exception.SystemException;
446    
447            /**
448            * Counts all the locks where className = &#63; and key = &#63;.
449            *
450            * @param className the class name to search with
451            * @param key the key to search with
452            * @return the number of matching locks
453            * @throws SystemException if a system exception occurred
454            */
455            public int countByC_K(java.lang.String className, java.lang.String key)
456                    throws com.liferay.portal.kernel.exception.SystemException;
457    
458            /**
459            * Counts all the locks.
460            *
461            * @return the number of locks
462            * @throws SystemException if a system exception occurred
463            */
464            public int countAll()
465                    throws com.liferay.portal.kernel.exception.SystemException;
466    
467            public Lock remove(Lock lock) throws SystemException;
468    }