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