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.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.Lock;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the lock service. This utility wraps {@link LockPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see LockPersistence
036     * @see LockPersistenceImpl
037     * @generated
038     */
039    public class LockUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(Lock lock) {
057                    getPersistence().clearCache(lock);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery)
072                    throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery,
080                    int start, int end) throws SystemException {
081                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
082            }
083    
084            /**
085             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
086             */
087            public static List<Lock> findWithDynamicQuery(DynamicQuery dynamicQuery,
088                    int start, int end, OrderByComparator orderByComparator)
089                    throws SystemException {
090                    return getPersistence()
091                                       .findWithDynamicQuery(dynamicQuery, start, end,
092                            orderByComparator);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
097             */
098            public static Lock update(Lock lock, boolean merge)
099                    throws SystemException {
100                    return getPersistence().update(lock, merge);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
105             */
106            public static Lock update(Lock lock, boolean merge,
107                    ServiceContext serviceContext) throws SystemException {
108                    return getPersistence().update(lock, merge, serviceContext);
109            }
110    
111            /**
112            * Caches the lock in the entity cache if it is enabled.
113            *
114            * @param lock the lock
115            */
116            public static void cacheResult(com.liferay.portal.model.Lock lock) {
117                    getPersistence().cacheResult(lock);
118            }
119    
120            /**
121            * Caches the locks in the entity cache if it is enabled.
122            *
123            * @param locks the locks
124            */
125            public static void cacheResult(
126                    java.util.List<com.liferay.portal.model.Lock> locks) {
127                    getPersistence().cacheResult(locks);
128            }
129    
130            /**
131            * Creates a new lock with the primary key. Does not add the lock to the database.
132            *
133            * @param lockId the primary key for the new lock
134            * @return the new lock
135            */
136            public static com.liferay.portal.model.Lock create(long lockId) {
137                    return getPersistence().create(lockId);
138            }
139    
140            /**
141            * Removes the lock with the primary key from the database. Also notifies the appropriate model listeners.
142            *
143            * @param lockId the primary key of the lock
144            * @return the lock that was removed
145            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
146            * @throws SystemException if a system exception occurred
147            */
148            public static com.liferay.portal.model.Lock remove(long lockId)
149                    throws com.liferay.portal.NoSuchLockException,
150                            com.liferay.portal.kernel.exception.SystemException {
151                    return getPersistence().remove(lockId);
152            }
153    
154            public static com.liferay.portal.model.Lock updateImpl(
155                    com.liferay.portal.model.Lock lock, boolean merge)
156                    throws com.liferay.portal.kernel.exception.SystemException {
157                    return getPersistence().updateImpl(lock, merge);
158            }
159    
160            /**
161            * Returns the lock with the primary key or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found.
162            *
163            * @param lockId the primary key of the lock
164            * @return the lock
165            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
166            * @throws SystemException if a system exception occurred
167            */
168            public static com.liferay.portal.model.Lock findByPrimaryKey(long lockId)
169                    throws com.liferay.portal.NoSuchLockException,
170                            com.liferay.portal.kernel.exception.SystemException {
171                    return getPersistence().findByPrimaryKey(lockId);
172            }
173    
174            /**
175            * Returns the lock with the primary key or returns <code>null</code> if it could not be found.
176            *
177            * @param lockId the primary key of the lock
178            * @return the lock, or <code>null</code> if a lock with the primary key could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public static com.liferay.portal.model.Lock fetchByPrimaryKey(long lockId)
182                    throws com.liferay.portal.kernel.exception.SystemException {
183                    return getPersistence().fetchByPrimaryKey(lockId);
184            }
185    
186            /**
187            * Returns all the locks where uuid = &#63;.
188            *
189            * @param uuid the uuid
190            * @return the matching locks
191            * @throws SystemException if a system exception occurred
192            */
193            public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
194                    java.lang.String uuid)
195                    throws com.liferay.portal.kernel.exception.SystemException {
196                    return getPersistence().findByUuid(uuid);
197            }
198    
199            /**
200            * Returns a range of all the locks where uuid = &#63;.
201            *
202            * <p>
203            * 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.
204            * </p>
205            *
206            * @param uuid the uuid
207            * @param start the lower bound of the range of locks
208            * @param end the upper bound of the range of locks (not inclusive)
209            * @return the range of matching locks
210            * @throws SystemException if a system exception occurred
211            */
212            public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
213                    java.lang.String uuid, int start, int end)
214                    throws com.liferay.portal.kernel.exception.SystemException {
215                    return getPersistence().findByUuid(uuid, start, end);
216            }
217    
218            /**
219            * Returns an ordered range of all the locks where uuid = &#63;.
220            *
221            * <p>
222            * 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.
223            * </p>
224            *
225            * @param uuid the uuid
226            * @param start the lower bound of the range of locks
227            * @param end the upper bound of the range of locks (not inclusive)
228            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
229            * @return the ordered range of matching locks
230            * @throws SystemException if a system exception occurred
231            */
232            public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
233                    java.lang.String uuid, int start, int end,
234                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
235                    throws com.liferay.portal.kernel.exception.SystemException {
236                    return getPersistence().findByUuid(uuid, start, end, orderByComparator);
237            }
238    
239            /**
240            * Returns the first lock in the ordered set where uuid = &#63;.
241            *
242            * <p>
243            * 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.
244            * </p>
245            *
246            * @param uuid the uuid
247            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
248            * @return the first matching lock
249            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
250            * @throws SystemException if a system exception occurred
251            */
252            public static com.liferay.portal.model.Lock findByUuid_First(
253                    java.lang.String uuid,
254                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
255                    throws com.liferay.portal.NoSuchLockException,
256                            com.liferay.portal.kernel.exception.SystemException {
257                    return getPersistence().findByUuid_First(uuid, orderByComparator);
258            }
259    
260            /**
261            * Returns the last lock in the ordered set where uuid = &#63;.
262            *
263            * <p>
264            * 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.
265            * </p>
266            *
267            * @param uuid the uuid
268            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
269            * @return the last matching lock
270            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
271            * @throws SystemException if a system exception occurred
272            */
273            public static com.liferay.portal.model.Lock findByUuid_Last(
274                    java.lang.String uuid,
275                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
276                    throws com.liferay.portal.NoSuchLockException,
277                            com.liferay.portal.kernel.exception.SystemException {
278                    return getPersistence().findByUuid_Last(uuid, orderByComparator);
279            }
280    
281            /**
282            * Returns the locks before and after the current lock in the ordered set where uuid = &#63;.
283            *
284            * <p>
285            * 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.
286            * </p>
287            *
288            * @param lockId the primary key of the current lock
289            * @param uuid the uuid
290            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
291            * @return the previous, current, and next lock
292            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
293            * @throws SystemException if a system exception occurred
294            */
295            public static com.liferay.portal.model.Lock[] findByUuid_PrevAndNext(
296                    long lockId, java.lang.String uuid,
297                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
298                    throws com.liferay.portal.NoSuchLockException,
299                            com.liferay.portal.kernel.exception.SystemException {
300                    return getPersistence()
301                                       .findByUuid_PrevAndNext(lockId, uuid, orderByComparator);
302            }
303    
304            /**
305            * Returns all the locks where expirationDate &lt; &#63;.
306            *
307            * @param expirationDate the expiration date
308            * @return the matching locks
309            * @throws SystemException if a system exception occurred
310            */
311            public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
312                    java.util.Date expirationDate)
313                    throws com.liferay.portal.kernel.exception.SystemException {
314                    return getPersistence().findByLtExpirationDate(expirationDate);
315            }
316    
317            /**
318            * Returns a range of all the locks where expirationDate &lt; &#63;.
319            *
320            * <p>
321            * 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.
322            * </p>
323            *
324            * @param expirationDate the expiration date
325            * @param start the lower bound of the range of locks
326            * @param end the upper bound of the range of locks (not inclusive)
327            * @return the range of matching locks
328            * @throws SystemException if a system exception occurred
329            */
330            public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
331                    java.util.Date expirationDate, int start, int end)
332                    throws com.liferay.portal.kernel.exception.SystemException {
333                    return getPersistence()
334                                       .findByLtExpirationDate(expirationDate, start, end);
335            }
336    
337            /**
338            * Returns an ordered range of all the locks where expirationDate &lt; &#63;.
339            *
340            * <p>
341            * 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.
342            * </p>
343            *
344            * @param expirationDate the expiration date
345            * @param start the lower bound of the range of locks
346            * @param end the upper bound of the range of locks (not inclusive)
347            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
348            * @return the ordered range of matching locks
349            * @throws SystemException if a system exception occurred
350            */
351            public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
352                    java.util.Date expirationDate, int start, int end,
353                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
354                    throws com.liferay.portal.kernel.exception.SystemException {
355                    return getPersistence()
356                                       .findByLtExpirationDate(expirationDate, start, end,
357                            orderByComparator);
358            }
359    
360            /**
361            * Returns the first lock in the ordered set where expirationDate &lt; &#63;.
362            *
363            * <p>
364            * 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.
365            * </p>
366            *
367            * @param expirationDate the expiration date
368            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
369            * @return the first matching lock
370            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
371            * @throws SystemException if a system exception occurred
372            */
373            public static com.liferay.portal.model.Lock findByLtExpirationDate_First(
374                    java.util.Date expirationDate,
375                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
376                    throws com.liferay.portal.NoSuchLockException,
377                            com.liferay.portal.kernel.exception.SystemException {
378                    return getPersistence()
379                                       .findByLtExpirationDate_First(expirationDate,
380                            orderByComparator);
381            }
382    
383            /**
384            * Returns the last lock in the ordered set where expirationDate &lt; &#63;.
385            *
386            * <p>
387            * 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.
388            * </p>
389            *
390            * @param expirationDate the expiration date
391            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
392            * @return the last matching lock
393            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
394            * @throws SystemException if a system exception occurred
395            */
396            public static com.liferay.portal.model.Lock findByLtExpirationDate_Last(
397                    java.util.Date expirationDate,
398                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
399                    throws com.liferay.portal.NoSuchLockException,
400                            com.liferay.portal.kernel.exception.SystemException {
401                    return getPersistence()
402                                       .findByLtExpirationDate_Last(expirationDate,
403                            orderByComparator);
404            }
405    
406            /**
407            * Returns the locks before and after the current lock in the ordered set where expirationDate &lt; &#63;.
408            *
409            * <p>
410            * 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.
411            * </p>
412            *
413            * @param lockId the primary key of the current lock
414            * @param expirationDate the expiration date
415            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
416            * @return the previous, current, and next lock
417            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
418            * @throws SystemException if a system exception occurred
419            */
420            public static com.liferay.portal.model.Lock[] findByLtExpirationDate_PrevAndNext(
421                    long lockId, java.util.Date expirationDate,
422                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
423                    throws com.liferay.portal.NoSuchLockException,
424                            com.liferay.portal.kernel.exception.SystemException {
425                    return getPersistence()
426                                       .findByLtExpirationDate_PrevAndNext(lockId, expirationDate,
427                            orderByComparator);
428            }
429    
430            /**
431            * Returns the lock where className = &#63; and key = &#63; or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found.
432            *
433            * @param className the class name
434            * @param key the key
435            * @return the matching lock
436            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
437            * @throws SystemException if a system exception occurred
438            */
439            public static com.liferay.portal.model.Lock findByC_K(
440                    java.lang.String className, java.lang.String key)
441                    throws com.liferay.portal.NoSuchLockException,
442                            com.liferay.portal.kernel.exception.SystemException {
443                    return getPersistence().findByC_K(className, key);
444            }
445    
446            /**
447            * Returns the lock where className = &#63; and key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
448            *
449            * @param className the class name
450            * @param key the key
451            * @return the matching lock, or <code>null</code> if a matching lock could not be found
452            * @throws SystemException if a system exception occurred
453            */
454            public static com.liferay.portal.model.Lock fetchByC_K(
455                    java.lang.String className, java.lang.String key)
456                    throws com.liferay.portal.kernel.exception.SystemException {
457                    return getPersistence().fetchByC_K(className, key);
458            }
459    
460            /**
461            * 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.
462            *
463            * @param className the class name
464            * @param key the key
465            * @param retrieveFromCache whether to use the finder cache
466            * @return the matching lock, or <code>null</code> if a matching lock could not be found
467            * @throws SystemException if a system exception occurred
468            */
469            public static com.liferay.portal.model.Lock fetchByC_K(
470                    java.lang.String className, java.lang.String key,
471                    boolean retrieveFromCache)
472                    throws com.liferay.portal.kernel.exception.SystemException {
473                    return getPersistence().fetchByC_K(className, key, retrieveFromCache);
474            }
475    
476            /**
477            * 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.
478            *
479            * @param className the class name
480            * @param key the key
481            * @param owner the owner
482            * @return the matching lock
483            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
484            * @throws SystemException if a system exception occurred
485            */
486            public static com.liferay.portal.model.Lock findByC_K_O(
487                    java.lang.String className, java.lang.String key, java.lang.String owner)
488                    throws com.liferay.portal.NoSuchLockException,
489                            com.liferay.portal.kernel.exception.SystemException {
490                    return getPersistence().findByC_K_O(className, key, owner);
491            }
492    
493            /**
494            * 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.
495            *
496            * @param className the class name
497            * @param key the key
498            * @param owner the owner
499            * @return the matching lock, or <code>null</code> if a matching lock could not be found
500            * @throws SystemException if a system exception occurred
501            */
502            public static com.liferay.portal.model.Lock fetchByC_K_O(
503                    java.lang.String className, java.lang.String key, java.lang.String owner)
504                    throws com.liferay.portal.kernel.exception.SystemException {
505                    return getPersistence().fetchByC_K_O(className, key, owner);
506            }
507    
508            /**
509            * 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.
510            *
511            * @param className the class name
512            * @param key the key
513            * @param owner the owner
514            * @param retrieveFromCache whether to use the finder cache
515            * @return the matching lock, or <code>null</code> if a matching lock could not be found
516            * @throws SystemException if a system exception occurred
517            */
518            public static com.liferay.portal.model.Lock fetchByC_K_O(
519                    java.lang.String className, java.lang.String key,
520                    java.lang.String owner, boolean retrieveFromCache)
521                    throws com.liferay.portal.kernel.exception.SystemException {
522                    return getPersistence()
523                                       .fetchByC_K_O(className, key, owner, retrieveFromCache);
524            }
525    
526            /**
527            * Returns all the locks.
528            *
529            * @return the locks
530            * @throws SystemException if a system exception occurred
531            */
532            public static java.util.List<com.liferay.portal.model.Lock> findAll()
533                    throws com.liferay.portal.kernel.exception.SystemException {
534                    return getPersistence().findAll();
535            }
536    
537            /**
538            * Returns a range of all the locks.
539            *
540            * <p>
541            * 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.
542            * </p>
543            *
544            * @param start the lower bound of the range of locks
545            * @param end the upper bound of the range of locks (not inclusive)
546            * @return the range of locks
547            * @throws SystemException if a system exception occurred
548            */
549            public static java.util.List<com.liferay.portal.model.Lock> findAll(
550                    int start, int end)
551                    throws com.liferay.portal.kernel.exception.SystemException {
552                    return getPersistence().findAll(start, end);
553            }
554    
555            /**
556            * Returns an ordered range of all the locks.
557            *
558            * <p>
559            * 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.
560            * </p>
561            *
562            * @param start the lower bound of the range of locks
563            * @param end the upper bound of the range of locks (not inclusive)
564            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
565            * @return the ordered range of locks
566            * @throws SystemException if a system exception occurred
567            */
568            public static java.util.List<com.liferay.portal.model.Lock> findAll(
569                    int start, int end,
570                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
571                    throws com.liferay.portal.kernel.exception.SystemException {
572                    return getPersistence().findAll(start, end, orderByComparator);
573            }
574    
575            /**
576            * Removes all the locks where uuid = &#63; from the database.
577            *
578            * @param uuid the uuid
579            * @throws SystemException if a system exception occurred
580            */
581            public static void removeByUuid(java.lang.String uuid)
582                    throws com.liferay.portal.kernel.exception.SystemException {
583                    getPersistence().removeByUuid(uuid);
584            }
585    
586            /**
587            * Removes all the locks where expirationDate &lt; &#63; from the database.
588            *
589            * @param expirationDate the expiration date
590            * @throws SystemException if a system exception occurred
591            */
592            public static void removeByLtExpirationDate(java.util.Date expirationDate)
593                    throws com.liferay.portal.kernel.exception.SystemException {
594                    getPersistence().removeByLtExpirationDate(expirationDate);
595            }
596    
597            /**
598            * Removes the lock where className = &#63; and key = &#63; from the database.
599            *
600            * @param className the class name
601            * @param key the key
602            * @throws SystemException if a system exception occurred
603            */
604            public static void removeByC_K(java.lang.String className,
605                    java.lang.String key)
606                    throws com.liferay.portal.NoSuchLockException,
607                            com.liferay.portal.kernel.exception.SystemException {
608                    getPersistence().removeByC_K(className, key);
609            }
610    
611            /**
612            * Removes the lock where className = &#63; and key = &#63; and owner = &#63; from the database.
613            *
614            * @param className the class name
615            * @param key the key
616            * @param owner the owner
617            * @throws SystemException if a system exception occurred
618            */
619            public static void removeByC_K_O(java.lang.String className,
620                    java.lang.String key, java.lang.String owner)
621                    throws com.liferay.portal.NoSuchLockException,
622                            com.liferay.portal.kernel.exception.SystemException {
623                    getPersistence().removeByC_K_O(className, key, owner);
624            }
625    
626            /**
627            * Removes all the locks from the database.
628            *
629            * @throws SystemException if a system exception occurred
630            */
631            public static void removeAll()
632                    throws com.liferay.portal.kernel.exception.SystemException {
633                    getPersistence().removeAll();
634            }
635    
636            /**
637            * Returns the number of locks where uuid = &#63;.
638            *
639            * @param uuid the uuid
640            * @return the number of matching locks
641            * @throws SystemException if a system exception occurred
642            */
643            public static int countByUuid(java.lang.String uuid)
644                    throws com.liferay.portal.kernel.exception.SystemException {
645                    return getPersistence().countByUuid(uuid);
646            }
647    
648            /**
649            * Returns the number of locks where expirationDate &lt; &#63;.
650            *
651            * @param expirationDate the expiration date
652            * @return the number of matching locks
653            * @throws SystemException if a system exception occurred
654            */
655            public static int countByLtExpirationDate(java.util.Date expirationDate)
656                    throws com.liferay.portal.kernel.exception.SystemException {
657                    return getPersistence().countByLtExpirationDate(expirationDate);
658            }
659    
660            /**
661            * Returns the number of locks where className = &#63; and key = &#63;.
662            *
663            * @param className the class name
664            * @param key the key
665            * @return the number of matching locks
666            * @throws SystemException if a system exception occurred
667            */
668            public static int countByC_K(java.lang.String className,
669                    java.lang.String key)
670                    throws com.liferay.portal.kernel.exception.SystemException {
671                    return getPersistence().countByC_K(className, key);
672            }
673    
674            /**
675            * Returns the number of locks where className = &#63; and key = &#63; and owner = &#63;.
676            *
677            * @param className the class name
678            * @param key the key
679            * @param owner the owner
680            * @return the number of matching locks
681            * @throws SystemException if a system exception occurred
682            */
683            public static int countByC_K_O(java.lang.String className,
684                    java.lang.String key, java.lang.String owner)
685                    throws com.liferay.portal.kernel.exception.SystemException {
686                    return getPersistence().countByC_K_O(className, key, owner);
687            }
688    
689            /**
690            * Returns the number of locks.
691            *
692            * @return the number of locks
693            * @throws SystemException if a system exception occurred
694            */
695            public static int countAll()
696                    throws com.liferay.portal.kernel.exception.SystemException {
697                    return getPersistence().countAll();
698            }
699    
700            public static LockPersistence getPersistence() {
701                    if (_persistence == null) {
702                            _persistence = (LockPersistence)PortalBeanLocatorUtil.locate(LockPersistence.class.getName());
703    
704                            ReferenceRegistry.registerReference(LockUtil.class, "_persistence");
705                    }
706    
707                    return _persistence;
708            }
709    
710            public void setPersistence(LockPersistence persistence) {
711                    _persistence = persistence;
712    
713                    ReferenceRegistry.registerReference(LockUtil.class, "_persistence");
714            }
715    
716            private static LockPersistence _persistence;
717    }