001    /**
002     * Copyright (c) 2000-2012 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            * <p>
149            * 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.
150            * </p>
151            *
152            * @param uuid the uuid
153            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
154            * @return the first matching lock
155            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
156            * @throws SystemException if a system exception occurred
157            */
158            public com.liferay.portal.model.Lock findByUuid_First(
159                    java.lang.String uuid,
160                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
161                    throws com.liferay.portal.NoSuchLockException,
162                            com.liferay.portal.kernel.exception.SystemException;
163    
164            /**
165            * Returns the last lock in the ordered set where uuid = &#63;.
166            *
167            * <p>
168            * 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.
169            * </p>
170            *
171            * @param uuid the uuid
172            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
173            * @return the last matching lock
174            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
175            * @throws SystemException if a system exception occurred
176            */
177            public com.liferay.portal.model.Lock findByUuid_Last(
178                    java.lang.String uuid,
179                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
180                    throws com.liferay.portal.NoSuchLockException,
181                            com.liferay.portal.kernel.exception.SystemException;
182    
183            /**
184            * Returns the locks before and after the current lock in the ordered set where uuid = &#63;.
185            *
186            * <p>
187            * 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.
188            * </p>
189            *
190            * @param lockId the primary key of the current lock
191            * @param uuid the uuid
192            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
193            * @return the previous, current, and next lock
194            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
195            * @throws SystemException if a system exception occurred
196            */
197            public com.liferay.portal.model.Lock[] findByUuid_PrevAndNext(long lockId,
198                    java.lang.String uuid,
199                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
200                    throws com.liferay.portal.NoSuchLockException,
201                            com.liferay.portal.kernel.exception.SystemException;
202    
203            /**
204            * Returns all the locks where expirationDate &lt; &#63;.
205            *
206            * @param expirationDate the expiration date
207            * @return the matching locks
208            * @throws SystemException if a system exception occurred
209            */
210            public java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
211                    java.util.Date expirationDate)
212                    throws com.liferay.portal.kernel.exception.SystemException;
213    
214            /**
215            * Returns a range of all the locks where expirationDate &lt; &#63;.
216            *
217            * <p>
218            * 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.
219            * </p>
220            *
221            * @param expirationDate the expiration date
222            * @param start the lower bound of the range of locks
223            * @param end the upper bound of the range of locks (not inclusive)
224            * @return the range of matching locks
225            * @throws SystemException if a system exception occurred
226            */
227            public java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
228                    java.util.Date expirationDate, int start, int end)
229                    throws com.liferay.portal.kernel.exception.SystemException;
230    
231            /**
232            * Returns an ordered range of all the locks where expirationDate &lt; &#63;.
233            *
234            * <p>
235            * 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.
236            * </p>
237            *
238            * @param expirationDate the expiration date
239            * @param start the lower bound of the range of locks
240            * @param end the upper bound of the range of locks (not inclusive)
241            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
242            * @return the ordered range of matching locks
243            * @throws SystemException if a system exception occurred
244            */
245            public java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
246                    java.util.Date expirationDate, int start, int end,
247                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
248                    throws com.liferay.portal.kernel.exception.SystemException;
249    
250            /**
251            * Returns the first lock in the ordered set where expirationDate &lt; &#63;.
252            *
253            * <p>
254            * 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.
255            * </p>
256            *
257            * @param expirationDate the expiration date
258            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
259            * @return the first matching lock
260            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
261            * @throws SystemException if a system exception occurred
262            */
263            public com.liferay.portal.model.Lock findByLtExpirationDate_First(
264                    java.util.Date expirationDate,
265                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266                    throws com.liferay.portal.NoSuchLockException,
267                            com.liferay.portal.kernel.exception.SystemException;
268    
269            /**
270            * Returns the last lock in the ordered set where expirationDate &lt; &#63;.
271            *
272            * <p>
273            * 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.
274            * </p>
275            *
276            * @param expirationDate the expiration date
277            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
278            * @return the last matching lock
279            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
280            * @throws SystemException if a system exception occurred
281            */
282            public com.liferay.portal.model.Lock findByLtExpirationDate_Last(
283                    java.util.Date expirationDate,
284                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
285                    throws com.liferay.portal.NoSuchLockException,
286                            com.liferay.portal.kernel.exception.SystemException;
287    
288            /**
289            * Returns the locks before and after the current lock in the ordered set where expirationDate &lt; &#63;.
290            *
291            * <p>
292            * 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.
293            * </p>
294            *
295            * @param lockId the primary key of the current lock
296            * @param expirationDate the expiration date
297            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
298            * @return the previous, current, and next lock
299            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
300            * @throws SystemException if a system exception occurred
301            */
302            public com.liferay.portal.model.Lock[] findByLtExpirationDate_PrevAndNext(
303                    long lockId, java.util.Date expirationDate,
304                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
305                    throws com.liferay.portal.NoSuchLockException,
306                            com.liferay.portal.kernel.exception.SystemException;
307    
308            /**
309            * Returns the lock where className = &#63; and key = &#63; or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found.
310            *
311            * @param className the class name
312            * @param key the key
313            * @return the matching lock
314            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
315            * @throws SystemException if a system exception occurred
316            */
317            public com.liferay.portal.model.Lock findByC_K(java.lang.String className,
318                    java.lang.String key)
319                    throws com.liferay.portal.NoSuchLockException,
320                            com.liferay.portal.kernel.exception.SystemException;
321    
322            /**
323            * Returns the lock where className = &#63; and key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
324            *
325            * @param className the class name
326            * @param key the key
327            * @return the matching lock, or <code>null</code> if a matching lock could not be found
328            * @throws SystemException if a system exception occurred
329            */
330            public com.liferay.portal.model.Lock fetchByC_K(
331                    java.lang.String className, java.lang.String key)
332                    throws com.liferay.portal.kernel.exception.SystemException;
333    
334            /**
335            * 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.
336            *
337            * @param className the class name
338            * @param key the key
339            * @param retrieveFromCache whether to use the finder cache
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            * 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.
350            *
351            * @param className the class name
352            * @param key the key
353            * @param owner the owner
354            * @return the matching lock
355            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
356            * @throws SystemException if a system exception occurred
357            */
358            public com.liferay.portal.model.Lock findByC_K_O(
359                    java.lang.String className, java.lang.String key, java.lang.String owner)
360                    throws com.liferay.portal.NoSuchLockException,
361                            com.liferay.portal.kernel.exception.SystemException;
362    
363            /**
364            * 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.
365            *
366            * @param className the class name
367            * @param key the key
368            * @param owner the owner
369            * @return the matching lock, or <code>null</code> if a matching lock could not be found
370            * @throws SystemException if a system exception occurred
371            */
372            public com.liferay.portal.model.Lock fetchByC_K_O(
373                    java.lang.String className, java.lang.String key, java.lang.String owner)
374                    throws com.liferay.portal.kernel.exception.SystemException;
375    
376            /**
377            * 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.
378            *
379            * @param className the class name
380            * @param key the key
381            * @param owner the owner
382            * @param retrieveFromCache whether to use the finder cache
383            * @return the matching lock, or <code>null</code> if a matching lock could not be found
384            * @throws SystemException if a system exception occurred
385            */
386            public com.liferay.portal.model.Lock fetchByC_K_O(
387                    java.lang.String className, java.lang.String key,
388                    java.lang.String owner, boolean retrieveFromCache)
389                    throws com.liferay.portal.kernel.exception.SystemException;
390    
391            /**
392            * Returns all the locks.
393            *
394            * @return the locks
395            * @throws SystemException if a system exception occurred
396            */
397            public java.util.List<com.liferay.portal.model.Lock> findAll()
398                    throws com.liferay.portal.kernel.exception.SystemException;
399    
400            /**
401            * Returns a range of all the locks.
402            *
403            * <p>
404            * 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.
405            * </p>
406            *
407            * @param start the lower bound of the range of locks
408            * @param end the upper bound of the range of locks (not inclusive)
409            * @return the range of locks
410            * @throws SystemException if a system exception occurred
411            */
412            public java.util.List<com.liferay.portal.model.Lock> findAll(int start,
413                    int end) throws com.liferay.portal.kernel.exception.SystemException;
414    
415            /**
416            * Returns an ordered range of all the locks.
417            *
418            * <p>
419            * 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.
420            * </p>
421            *
422            * @param start the lower bound of the range of locks
423            * @param end the upper bound of the range of locks (not inclusive)
424            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
425            * @return the ordered range of locks
426            * @throws SystemException if a system exception occurred
427            */
428            public java.util.List<com.liferay.portal.model.Lock> findAll(int start,
429                    int end,
430                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
431                    throws com.liferay.portal.kernel.exception.SystemException;
432    
433            /**
434            * Removes all the locks where uuid = &#63; from the database.
435            *
436            * @param uuid the uuid
437            * @throws SystemException if a system exception occurred
438            */
439            public void removeByUuid(java.lang.String uuid)
440                    throws com.liferay.portal.kernel.exception.SystemException;
441    
442            /**
443            * Removes all the locks where expirationDate &lt; &#63; from the database.
444            *
445            * @param expirationDate the expiration date
446            * @throws SystemException if a system exception occurred
447            */
448            public void removeByLtExpirationDate(java.util.Date expirationDate)
449                    throws com.liferay.portal.kernel.exception.SystemException;
450    
451            /**
452            * Removes the lock where className = &#63; and key = &#63; from the database.
453            *
454            * @param className the class name
455            * @param key the key
456            * @throws SystemException if a system exception occurred
457            */
458            public void removeByC_K(java.lang.String className, java.lang.String key)
459                    throws com.liferay.portal.NoSuchLockException,
460                            com.liferay.portal.kernel.exception.SystemException;
461    
462            /**
463            * Removes the lock where className = &#63; and key = &#63; and owner = &#63; from the database.
464            *
465            * @param className the class name
466            * @param key the key
467            * @param owner the owner
468            * @throws SystemException if a system exception occurred
469            */
470            public void removeByC_K_O(java.lang.String className, java.lang.String key,
471                    java.lang.String owner)
472                    throws com.liferay.portal.NoSuchLockException,
473                            com.liferay.portal.kernel.exception.SystemException;
474    
475            /**
476            * Removes all the locks from the database.
477            *
478            * @throws SystemException if a system exception occurred
479            */
480            public void removeAll()
481                    throws com.liferay.portal.kernel.exception.SystemException;
482    
483            /**
484            * Returns the number of locks where uuid = &#63;.
485            *
486            * @param uuid the uuid
487            * @return the number of matching locks
488            * @throws SystemException if a system exception occurred
489            */
490            public int countByUuid(java.lang.String uuid)
491                    throws com.liferay.portal.kernel.exception.SystemException;
492    
493            /**
494            * Returns the number of locks where expirationDate &lt; &#63;.
495            *
496            * @param expirationDate the expiration date
497            * @return the number of matching locks
498            * @throws SystemException if a system exception occurred
499            */
500            public int countByLtExpirationDate(java.util.Date expirationDate)
501                    throws com.liferay.portal.kernel.exception.SystemException;
502    
503            /**
504            * Returns the number of locks where className = &#63; and key = &#63;.
505            *
506            * @param className the class name
507            * @param key the key
508            * @return the number of matching locks
509            * @throws SystemException if a system exception occurred
510            */
511            public int countByC_K(java.lang.String className, java.lang.String key)
512                    throws com.liferay.portal.kernel.exception.SystemException;
513    
514            /**
515            * Returns the number of locks where className = &#63; and key = &#63; and owner = &#63;.
516            *
517            * @param className the class name
518            * @param key the key
519            * @param owner the owner
520            * @return the number of matching locks
521            * @throws SystemException if a system exception occurred
522            */
523            public int countByC_K_O(java.lang.String className, java.lang.String key,
524                    java.lang.String owner)
525                    throws com.liferay.portal.kernel.exception.SystemException;
526    
527            /**
528            * Returns the number of locks.
529            *
530            * @return the number of locks
531            * @throws SystemException if a system exception occurred
532            */
533            public int countAll()
534                    throws com.liferay.portal.kernel.exception.SystemException;
535    }