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)
097             */
098            public static Lock update(Lock lock) throws SystemException {
099                    return getPersistence().update(lock);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
104             */
105            public static Lock update(Lock lock, ServiceContext serviceContext)
106                    throws SystemException {
107                    return getPersistence().update(lock, serviceContext);
108            }
109    
110            /**
111            * Caches the lock in the entity cache if it is enabled.
112            *
113            * @param lock the lock
114            */
115            public static void cacheResult(com.liferay.portal.model.Lock lock) {
116                    getPersistence().cacheResult(lock);
117            }
118    
119            /**
120            * Caches the locks in the entity cache if it is enabled.
121            *
122            * @param locks the locks
123            */
124            public static void cacheResult(
125                    java.util.List<com.liferay.portal.model.Lock> locks) {
126                    getPersistence().cacheResult(locks);
127            }
128    
129            /**
130            * Creates a new lock with the primary key. Does not add the lock to the database.
131            *
132            * @param lockId the primary key for the new lock
133            * @return the new lock
134            */
135            public static com.liferay.portal.model.Lock create(long lockId) {
136                    return getPersistence().create(lockId);
137            }
138    
139            /**
140            * Removes the lock with the primary key from the database. Also notifies the appropriate model listeners.
141            *
142            * @param lockId the primary key of the lock
143            * @return the lock that was removed
144            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
145            * @throws SystemException if a system exception occurred
146            */
147            public static com.liferay.portal.model.Lock remove(long lockId)
148                    throws com.liferay.portal.NoSuchLockException,
149                            com.liferay.portal.kernel.exception.SystemException {
150                    return getPersistence().remove(lockId);
151            }
152    
153            public static com.liferay.portal.model.Lock updateImpl(
154                    com.liferay.portal.model.Lock lock)
155                    throws com.liferay.portal.kernel.exception.SystemException {
156                    return getPersistence().updateImpl(lock);
157            }
158    
159            /**
160            * Returns the lock with the primary key or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found.
161            *
162            * @param lockId the primary key of the lock
163            * @return the lock
164            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
165            * @throws SystemException if a system exception occurred
166            */
167            public static com.liferay.portal.model.Lock findByPrimaryKey(long lockId)
168                    throws com.liferay.portal.NoSuchLockException,
169                            com.liferay.portal.kernel.exception.SystemException {
170                    return getPersistence().findByPrimaryKey(lockId);
171            }
172    
173            /**
174            * Returns the lock with the primary key or returns <code>null</code> if it could not be found.
175            *
176            * @param lockId the primary key of the lock
177            * @return the lock, or <code>null</code> if a lock with the primary key could not be found
178            * @throws SystemException if a system exception occurred
179            */
180            public static com.liferay.portal.model.Lock fetchByPrimaryKey(long lockId)
181                    throws com.liferay.portal.kernel.exception.SystemException {
182                    return getPersistence().fetchByPrimaryKey(lockId);
183            }
184    
185            /**
186            * Returns all the locks where uuid = &#63;.
187            *
188            * @param uuid the uuid
189            * @return the matching locks
190            * @throws SystemException if a system exception occurred
191            */
192            public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
193                    java.lang.String uuid)
194                    throws com.liferay.portal.kernel.exception.SystemException {
195                    return getPersistence().findByUuid(uuid);
196            }
197    
198            /**
199            * Returns a range of all the locks where uuid = &#63;.
200            *
201            * <p>
202            * 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.
203            * </p>
204            *
205            * @param uuid the uuid
206            * @param start the lower bound of the range of locks
207            * @param end the upper bound of the range of locks (not inclusive)
208            * @return the range of matching locks
209            * @throws SystemException if a system exception occurred
210            */
211            public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
212                    java.lang.String uuid, int start, int end)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getPersistence().findByUuid(uuid, start, end);
215            }
216    
217            /**
218            * Returns an ordered range of all the locks where uuid = &#63;.
219            *
220            * <p>
221            * 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.
222            * </p>
223            *
224            * @param uuid the uuid
225            * @param start the lower bound of the range of locks
226            * @param end the upper bound of the range of locks (not inclusive)
227            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
228            * @return the ordered range of matching locks
229            * @throws SystemException if a system exception occurred
230            */
231            public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
232                    java.lang.String uuid, int start, int end,
233                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
234                    throws com.liferay.portal.kernel.exception.SystemException {
235                    return getPersistence().findByUuid(uuid, start, end, orderByComparator);
236            }
237    
238            /**
239            * Returns the first lock in the ordered set where uuid = &#63;.
240            *
241            * @param uuid the uuid
242            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
243            * @return the first matching lock
244            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
245            * @throws SystemException if a system exception occurred
246            */
247            public static com.liferay.portal.model.Lock findByUuid_First(
248                    java.lang.String uuid,
249                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
250                    throws com.liferay.portal.NoSuchLockException,
251                            com.liferay.portal.kernel.exception.SystemException {
252                    return getPersistence().findByUuid_First(uuid, orderByComparator);
253            }
254    
255            /**
256            * Returns the first lock in the ordered set where uuid = &#63;.
257            *
258            * @param uuid the uuid
259            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
260            * @return the first matching lock, or <code>null</code> if a matching lock could not be found
261            * @throws SystemException if a system exception occurred
262            */
263            public static com.liferay.portal.model.Lock fetchByUuid_First(
264                    java.lang.String uuid,
265                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
266                    throws com.liferay.portal.kernel.exception.SystemException {
267                    return getPersistence().fetchByUuid_First(uuid, orderByComparator);
268            }
269    
270            /**
271            * Returns the last lock in the ordered set where uuid = &#63;.
272            *
273            * @param uuid the uuid
274            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
275            * @return the last matching lock
276            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
277            * @throws SystemException if a system exception occurred
278            */
279            public static com.liferay.portal.model.Lock findByUuid_Last(
280                    java.lang.String uuid,
281                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
282                    throws com.liferay.portal.NoSuchLockException,
283                            com.liferay.portal.kernel.exception.SystemException {
284                    return getPersistence().findByUuid_Last(uuid, orderByComparator);
285            }
286    
287            /**
288            * Returns the last lock in the ordered set where uuid = &#63;.
289            *
290            * @param uuid the uuid
291            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
292            * @return the last matching lock, or <code>null</code> if a matching lock could not be found
293            * @throws SystemException if a system exception occurred
294            */
295            public static com.liferay.portal.model.Lock fetchByUuid_Last(
296                    java.lang.String uuid,
297                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
298                    throws com.liferay.portal.kernel.exception.SystemException {
299                    return getPersistence().fetchByUuid_Last(uuid, orderByComparator);
300            }
301    
302            /**
303            * Returns the locks before and after the current lock in the ordered set where uuid = &#63;.
304            *
305            * @param lockId the primary key of the current lock
306            * @param uuid the uuid
307            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
308            * @return the previous, current, and next lock
309            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
310            * @throws SystemException if a system exception occurred
311            */
312            public static com.liferay.portal.model.Lock[] findByUuid_PrevAndNext(
313                    long lockId, java.lang.String uuid,
314                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
315                    throws com.liferay.portal.NoSuchLockException,
316                            com.liferay.portal.kernel.exception.SystemException {
317                    return getPersistence()
318                                       .findByUuid_PrevAndNext(lockId, uuid, orderByComparator);
319            }
320    
321            /**
322            * Returns all the locks where uuid = &#63; and companyId = &#63;.
323            *
324            * @param uuid the uuid
325            * @param companyId the company ID
326            * @return the matching locks
327            * @throws SystemException if a system exception occurred
328            */
329            public static java.util.List<com.liferay.portal.model.Lock> findByUuid_C(
330                    java.lang.String uuid, long companyId)
331                    throws com.liferay.portal.kernel.exception.SystemException {
332                    return getPersistence().findByUuid_C(uuid, companyId);
333            }
334    
335            /**
336            * Returns a range of all the locks where uuid = &#63; and companyId = &#63;.
337            *
338            * <p>
339            * 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.
340            * </p>
341            *
342            * @param uuid the uuid
343            * @param companyId the company ID
344            * @param start the lower bound of the range of locks
345            * @param end the upper bound of the range of locks (not inclusive)
346            * @return the range of matching locks
347            * @throws SystemException if a system exception occurred
348            */
349            public static java.util.List<com.liferay.portal.model.Lock> findByUuid_C(
350                    java.lang.String uuid, long companyId, int start, int end)
351                    throws com.liferay.portal.kernel.exception.SystemException {
352                    return getPersistence().findByUuid_C(uuid, companyId, start, end);
353            }
354    
355            /**
356            * Returns an ordered range of all the locks where uuid = &#63; and companyId = &#63;.
357            *
358            * <p>
359            * 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.
360            * </p>
361            *
362            * @param uuid the uuid
363            * @param companyId the company ID
364            * @param start the lower bound of the range of locks
365            * @param end the upper bound of the range of locks (not inclusive)
366            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
367            * @return the ordered range of matching locks
368            * @throws SystemException if a system exception occurred
369            */
370            public static java.util.List<com.liferay.portal.model.Lock> findByUuid_C(
371                    java.lang.String uuid, long companyId, int start, int end,
372                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
373                    throws com.liferay.portal.kernel.exception.SystemException {
374                    return getPersistence()
375                                       .findByUuid_C(uuid, companyId, start, end, orderByComparator);
376            }
377    
378            /**
379            * Returns the first lock in the ordered set where uuid = &#63; and companyId = &#63;.
380            *
381            * @param uuid the uuid
382            * @param companyId the company ID
383            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
384            * @return the first matching lock
385            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
386            * @throws SystemException if a system exception occurred
387            */
388            public static com.liferay.portal.model.Lock findByUuid_C_First(
389                    java.lang.String uuid, long companyId,
390                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
391                    throws com.liferay.portal.NoSuchLockException,
392                            com.liferay.portal.kernel.exception.SystemException {
393                    return getPersistence()
394                                       .findByUuid_C_First(uuid, companyId, orderByComparator);
395            }
396    
397            /**
398            * Returns the first lock in the ordered set where uuid = &#63; and companyId = &#63;.
399            *
400            * @param uuid the uuid
401            * @param companyId the company ID
402            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
403            * @return the first matching lock, or <code>null</code> if a matching lock could not be found
404            * @throws SystemException if a system exception occurred
405            */
406            public static com.liferay.portal.model.Lock fetchByUuid_C_First(
407                    java.lang.String uuid, long companyId,
408                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
409                    throws com.liferay.portal.kernel.exception.SystemException {
410                    return getPersistence()
411                                       .fetchByUuid_C_First(uuid, companyId, orderByComparator);
412            }
413    
414            /**
415            * Returns the last lock in the ordered set where uuid = &#63; and companyId = &#63;.
416            *
417            * @param uuid the uuid
418            * @param companyId the company ID
419            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
420            * @return the last matching lock
421            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
422            * @throws SystemException if a system exception occurred
423            */
424            public static com.liferay.portal.model.Lock findByUuid_C_Last(
425                    java.lang.String uuid, long companyId,
426                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
427                    throws com.liferay.portal.NoSuchLockException,
428                            com.liferay.portal.kernel.exception.SystemException {
429                    return getPersistence()
430                                       .findByUuid_C_Last(uuid, companyId, orderByComparator);
431            }
432    
433            /**
434            * Returns the last lock in the ordered set where uuid = &#63; and companyId = &#63;.
435            *
436            * @param uuid the uuid
437            * @param companyId the company ID
438            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
439            * @return the last matching lock, or <code>null</code> if a matching lock could not be found
440            * @throws SystemException if a system exception occurred
441            */
442            public static com.liferay.portal.model.Lock fetchByUuid_C_Last(
443                    java.lang.String uuid, long companyId,
444                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
445                    throws com.liferay.portal.kernel.exception.SystemException {
446                    return getPersistence()
447                                       .fetchByUuid_C_Last(uuid, companyId, orderByComparator);
448            }
449    
450            /**
451            * Returns the locks before and after the current lock in the ordered set where uuid = &#63; and companyId = &#63;.
452            *
453            * @param lockId the primary key of the current lock
454            * @param uuid the uuid
455            * @param companyId the company ID
456            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
457            * @return the previous, current, and next lock
458            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
459            * @throws SystemException if a system exception occurred
460            */
461            public static com.liferay.portal.model.Lock[] findByUuid_C_PrevAndNext(
462                    long lockId, java.lang.String uuid, long companyId,
463                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
464                    throws com.liferay.portal.NoSuchLockException,
465                            com.liferay.portal.kernel.exception.SystemException {
466                    return getPersistence()
467                                       .findByUuid_C_PrevAndNext(lockId, uuid, companyId,
468                            orderByComparator);
469            }
470    
471            /**
472            * Returns all the locks where expirationDate &lt; &#63;.
473            *
474            * @param expirationDate the expiration date
475            * @return the matching locks
476            * @throws SystemException if a system exception occurred
477            */
478            public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
479                    java.util.Date expirationDate)
480                    throws com.liferay.portal.kernel.exception.SystemException {
481                    return getPersistence().findByLtExpirationDate(expirationDate);
482            }
483    
484            /**
485            * Returns a range of all the locks where expirationDate &lt; &#63;.
486            *
487            * <p>
488            * 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.
489            * </p>
490            *
491            * @param expirationDate the expiration date
492            * @param start the lower bound of the range of locks
493            * @param end the upper bound of the range of locks (not inclusive)
494            * @return the range of matching locks
495            * @throws SystemException if a system exception occurred
496            */
497            public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
498                    java.util.Date expirationDate, int start, int end)
499                    throws com.liferay.portal.kernel.exception.SystemException {
500                    return getPersistence()
501                                       .findByLtExpirationDate(expirationDate, start, end);
502            }
503    
504            /**
505            * Returns an ordered range of all the locks where expirationDate &lt; &#63;.
506            *
507            * <p>
508            * 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.
509            * </p>
510            *
511            * @param expirationDate the expiration date
512            * @param start the lower bound of the range of locks
513            * @param end the upper bound of the range of locks (not inclusive)
514            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
515            * @return the ordered range of matching locks
516            * @throws SystemException if a system exception occurred
517            */
518            public static java.util.List<com.liferay.portal.model.Lock> findByLtExpirationDate(
519                    java.util.Date expirationDate, int start, int end,
520                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
521                    throws com.liferay.portal.kernel.exception.SystemException {
522                    return getPersistence()
523                                       .findByLtExpirationDate(expirationDate, start, end,
524                            orderByComparator);
525            }
526    
527            /**
528            * Returns the first lock in the ordered set where expirationDate &lt; &#63;.
529            *
530            * @param expirationDate the expiration date
531            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
532            * @return the first matching lock
533            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
534            * @throws SystemException if a system exception occurred
535            */
536            public static com.liferay.portal.model.Lock findByLtExpirationDate_First(
537                    java.util.Date expirationDate,
538                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
539                    throws com.liferay.portal.NoSuchLockException,
540                            com.liferay.portal.kernel.exception.SystemException {
541                    return getPersistence()
542                                       .findByLtExpirationDate_First(expirationDate,
543                            orderByComparator);
544            }
545    
546            /**
547            * Returns the first lock in the ordered set where expirationDate &lt; &#63;.
548            *
549            * @param expirationDate the expiration date
550            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
551            * @return the first matching lock, or <code>null</code> if a matching lock could not be found
552            * @throws SystemException if a system exception occurred
553            */
554            public static com.liferay.portal.model.Lock fetchByLtExpirationDate_First(
555                    java.util.Date expirationDate,
556                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
557                    throws com.liferay.portal.kernel.exception.SystemException {
558                    return getPersistence()
559                                       .fetchByLtExpirationDate_First(expirationDate,
560                            orderByComparator);
561            }
562    
563            /**
564            * Returns the last lock in the ordered set where expirationDate &lt; &#63;.
565            *
566            * @param expirationDate the expiration date
567            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
568            * @return the last matching lock
569            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
570            * @throws SystemException if a system exception occurred
571            */
572            public static com.liferay.portal.model.Lock findByLtExpirationDate_Last(
573                    java.util.Date expirationDate,
574                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
575                    throws com.liferay.portal.NoSuchLockException,
576                            com.liferay.portal.kernel.exception.SystemException {
577                    return getPersistence()
578                                       .findByLtExpirationDate_Last(expirationDate,
579                            orderByComparator);
580            }
581    
582            /**
583            * Returns the last lock in the ordered set where expirationDate &lt; &#63;.
584            *
585            * @param expirationDate the expiration date
586            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
587            * @return the last matching lock, or <code>null</code> if a matching lock could not be found
588            * @throws SystemException if a system exception occurred
589            */
590            public static com.liferay.portal.model.Lock fetchByLtExpirationDate_Last(
591                    java.util.Date expirationDate,
592                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
593                    throws com.liferay.portal.kernel.exception.SystemException {
594                    return getPersistence()
595                                       .fetchByLtExpirationDate_Last(expirationDate,
596                            orderByComparator);
597            }
598    
599            /**
600            * Returns the locks before and after the current lock in the ordered set where expirationDate &lt; &#63;.
601            *
602            * @param lockId the primary key of the current lock
603            * @param expirationDate the expiration date
604            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
605            * @return the previous, current, and next lock
606            * @throws com.liferay.portal.NoSuchLockException if a lock with the primary key could not be found
607            * @throws SystemException if a system exception occurred
608            */
609            public static com.liferay.portal.model.Lock[] findByLtExpirationDate_PrevAndNext(
610                    long lockId, java.util.Date expirationDate,
611                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
612                    throws com.liferay.portal.NoSuchLockException,
613                            com.liferay.portal.kernel.exception.SystemException {
614                    return getPersistence()
615                                       .findByLtExpirationDate_PrevAndNext(lockId, expirationDate,
616                            orderByComparator);
617            }
618    
619            /**
620            * Returns the lock where className = &#63; and key = &#63; or throws a {@link com.liferay.portal.NoSuchLockException} if it could not be found.
621            *
622            * @param className the class name
623            * @param key the key
624            * @return the matching lock
625            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
626            * @throws SystemException if a system exception occurred
627            */
628            public static com.liferay.portal.model.Lock findByC_K(
629                    java.lang.String className, java.lang.String key)
630                    throws com.liferay.portal.NoSuchLockException,
631                            com.liferay.portal.kernel.exception.SystemException {
632                    return getPersistence().findByC_K(className, key);
633            }
634    
635            /**
636            * Returns the lock where className = &#63; and key = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
637            *
638            * @param className the class name
639            * @param key the key
640            * @return the matching lock, or <code>null</code> if a matching lock could not be found
641            * @throws SystemException if a system exception occurred
642            */
643            public static com.liferay.portal.model.Lock fetchByC_K(
644                    java.lang.String className, java.lang.String key)
645                    throws com.liferay.portal.kernel.exception.SystemException {
646                    return getPersistence().fetchByC_K(className, key);
647            }
648    
649            /**
650            * 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.
651            *
652            * @param className the class name
653            * @param key the key
654            * @param retrieveFromCache whether to use the finder cache
655            * @return the matching lock, or <code>null</code> if a matching lock could not be found
656            * @throws SystemException if a system exception occurred
657            */
658            public static com.liferay.portal.model.Lock fetchByC_K(
659                    java.lang.String className, java.lang.String key,
660                    boolean retrieveFromCache)
661                    throws com.liferay.portal.kernel.exception.SystemException {
662                    return getPersistence().fetchByC_K(className, key, retrieveFromCache);
663            }
664    
665            /**
666            * 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.
667            *
668            * @param className the class name
669            * @param key the key
670            * @param owner the owner
671            * @return the matching lock
672            * @throws com.liferay.portal.NoSuchLockException if a matching lock could not be found
673            * @throws SystemException if a system exception occurred
674            */
675            public static com.liferay.portal.model.Lock findByC_K_O(
676                    java.lang.String className, java.lang.String key, java.lang.String owner)
677                    throws com.liferay.portal.NoSuchLockException,
678                            com.liferay.portal.kernel.exception.SystemException {
679                    return getPersistence().findByC_K_O(className, key, owner);
680            }
681    
682            /**
683            * 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.
684            *
685            * @param className the class name
686            * @param key the key
687            * @param owner the owner
688            * @return the matching lock, or <code>null</code> if a matching lock could not be found
689            * @throws SystemException if a system exception occurred
690            */
691            public static com.liferay.portal.model.Lock fetchByC_K_O(
692                    java.lang.String className, java.lang.String key, java.lang.String owner)
693                    throws com.liferay.portal.kernel.exception.SystemException {
694                    return getPersistence().fetchByC_K_O(className, key, owner);
695            }
696    
697            /**
698            * 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.
699            *
700            * @param className the class name
701            * @param key the key
702            * @param owner the owner
703            * @param retrieveFromCache whether to use the finder cache
704            * @return the matching lock, or <code>null</code> if a matching lock could not be found
705            * @throws SystemException if a system exception occurred
706            */
707            public static com.liferay.portal.model.Lock fetchByC_K_O(
708                    java.lang.String className, java.lang.String key,
709                    java.lang.String owner, boolean retrieveFromCache)
710                    throws com.liferay.portal.kernel.exception.SystemException {
711                    return getPersistence()
712                                       .fetchByC_K_O(className, key, owner, retrieveFromCache);
713            }
714    
715            /**
716            * Returns all the locks.
717            *
718            * @return the locks
719            * @throws SystemException if a system exception occurred
720            */
721            public static java.util.List<com.liferay.portal.model.Lock> findAll()
722                    throws com.liferay.portal.kernel.exception.SystemException {
723                    return getPersistence().findAll();
724            }
725    
726            /**
727            * Returns a range of all the locks.
728            *
729            * <p>
730            * 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.
731            * </p>
732            *
733            * @param start the lower bound of the range of locks
734            * @param end the upper bound of the range of locks (not inclusive)
735            * @return the range of locks
736            * @throws SystemException if a system exception occurred
737            */
738            public static java.util.List<com.liferay.portal.model.Lock> findAll(
739                    int start, int end)
740                    throws com.liferay.portal.kernel.exception.SystemException {
741                    return getPersistence().findAll(start, end);
742            }
743    
744            /**
745            * Returns an ordered range of all the locks.
746            *
747            * <p>
748            * 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.
749            * </p>
750            *
751            * @param start the lower bound of the range of locks
752            * @param end the upper bound of the range of locks (not inclusive)
753            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
754            * @return the ordered range of locks
755            * @throws SystemException if a system exception occurred
756            */
757            public static java.util.List<com.liferay.portal.model.Lock> findAll(
758                    int start, int end,
759                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
760                    throws com.liferay.portal.kernel.exception.SystemException {
761                    return getPersistence().findAll(start, end, orderByComparator);
762            }
763    
764            /**
765            * Removes all the locks where uuid = &#63; from the database.
766            *
767            * @param uuid the uuid
768            * @throws SystemException if a system exception occurred
769            */
770            public static void removeByUuid(java.lang.String uuid)
771                    throws com.liferay.portal.kernel.exception.SystemException {
772                    getPersistence().removeByUuid(uuid);
773            }
774    
775            /**
776            * Removes all the locks where uuid = &#63; and companyId = &#63; from the database.
777            *
778            * @param uuid the uuid
779            * @param companyId the company ID
780            * @throws SystemException if a system exception occurred
781            */
782            public static void removeByUuid_C(java.lang.String uuid, long companyId)
783                    throws com.liferay.portal.kernel.exception.SystemException {
784                    getPersistence().removeByUuid_C(uuid, companyId);
785            }
786    
787            /**
788            * Removes all the locks where expirationDate &lt; &#63; from the database.
789            *
790            * @param expirationDate the expiration date
791            * @throws SystemException if a system exception occurred
792            */
793            public static void removeByLtExpirationDate(java.util.Date expirationDate)
794                    throws com.liferay.portal.kernel.exception.SystemException {
795                    getPersistence().removeByLtExpirationDate(expirationDate);
796            }
797    
798            /**
799            * Removes the lock where className = &#63; and key = &#63; from the database.
800            *
801            * @param className the class name
802            * @param key the key
803            * @return the lock that was removed
804            * @throws SystemException if a system exception occurred
805            */
806            public static com.liferay.portal.model.Lock removeByC_K(
807                    java.lang.String className, java.lang.String key)
808                    throws com.liferay.portal.NoSuchLockException,
809                            com.liferay.portal.kernel.exception.SystemException {
810                    return getPersistence().removeByC_K(className, key);
811            }
812    
813            /**
814            * Removes the lock where className = &#63; and key = &#63; and owner = &#63; from the database.
815            *
816            * @param className the class name
817            * @param key the key
818            * @param owner the owner
819            * @return the lock that was removed
820            * @throws SystemException if a system exception occurred
821            */
822            public static com.liferay.portal.model.Lock removeByC_K_O(
823                    java.lang.String className, java.lang.String key, java.lang.String owner)
824                    throws com.liferay.portal.NoSuchLockException,
825                            com.liferay.portal.kernel.exception.SystemException {
826                    return getPersistence().removeByC_K_O(className, key, owner);
827            }
828    
829            /**
830            * Removes all the locks from the database.
831            *
832            * @throws SystemException if a system exception occurred
833            */
834            public static void removeAll()
835                    throws com.liferay.portal.kernel.exception.SystemException {
836                    getPersistence().removeAll();
837            }
838    
839            /**
840            * Returns the number of locks where uuid = &#63;.
841            *
842            * @param uuid the uuid
843            * @return the number of matching locks
844            * @throws SystemException if a system exception occurred
845            */
846            public static int countByUuid(java.lang.String uuid)
847                    throws com.liferay.portal.kernel.exception.SystemException {
848                    return getPersistence().countByUuid(uuid);
849            }
850    
851            /**
852            * Returns the number of locks where uuid = &#63; and companyId = &#63;.
853            *
854            * @param uuid the uuid
855            * @param companyId the company ID
856            * @return the number of matching locks
857            * @throws SystemException if a system exception occurred
858            */
859            public static int countByUuid_C(java.lang.String uuid, long companyId)
860                    throws com.liferay.portal.kernel.exception.SystemException {
861                    return getPersistence().countByUuid_C(uuid, companyId);
862            }
863    
864            /**
865            * Returns the number of locks where expirationDate &lt; &#63;.
866            *
867            * @param expirationDate the expiration date
868            * @return the number of matching locks
869            * @throws SystemException if a system exception occurred
870            */
871            public static int countByLtExpirationDate(java.util.Date expirationDate)
872                    throws com.liferay.portal.kernel.exception.SystemException {
873                    return getPersistence().countByLtExpirationDate(expirationDate);
874            }
875    
876            /**
877            * Returns the number of locks where className = &#63; and key = &#63;.
878            *
879            * @param className the class name
880            * @param key the key
881            * @return the number of matching locks
882            * @throws SystemException if a system exception occurred
883            */
884            public static int countByC_K(java.lang.String className,
885                    java.lang.String key)
886                    throws com.liferay.portal.kernel.exception.SystemException {
887                    return getPersistence().countByC_K(className, key);
888            }
889    
890            /**
891            * Returns the number of locks where className = &#63; and key = &#63; and owner = &#63;.
892            *
893            * @param className the class name
894            * @param key the key
895            * @param owner the owner
896            * @return the number of matching locks
897            * @throws SystemException if a system exception occurred
898            */
899            public static int countByC_K_O(java.lang.String className,
900                    java.lang.String key, java.lang.String owner)
901                    throws com.liferay.portal.kernel.exception.SystemException {
902                    return getPersistence().countByC_K_O(className, key, owner);
903            }
904    
905            /**
906            * Returns the number of locks.
907            *
908            * @return the number of locks
909            * @throws SystemException if a system exception occurred
910            */
911            public static int countAll()
912                    throws com.liferay.portal.kernel.exception.SystemException {
913                    return getPersistence().countAll();
914            }
915    
916            public static LockPersistence getPersistence() {
917                    if (_persistence == null) {
918                            _persistence = (LockPersistence)PortalBeanLocatorUtil.locate(LockPersistence.class.getName());
919    
920                            ReferenceRegistry.registerReference(LockUtil.class, "_persistence");
921                    }
922    
923                    return _persistence;
924            }
925    
926            /**
927             * @deprecated
928             */
929            public void setPersistence(LockPersistence persistence) {
930            }
931    
932            private static LockPersistence _persistence;
933    }