1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   *
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.kernel.util.ReferenceRegistry;
21  import com.liferay.portal.model.Lock;
22  
23  import java.util.List;
24  
25  /**
26   * <a href="LockUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * <p>
29   * ServiceBuilder generated this class. Modifications in this class will be
30   * overwritten the next time is generated.
31   * </p>
32   *
33   * @author    Brian Wing Shun Chan
34   * @see       LockPersistence
35   * @see       LockPersistenceImpl
36   * @generated
37   */
38  public class LockUtil {
39      /**
40       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
41       */
42      public static void clearCache() {
43          getPersistence().clearCache();
44      }
45  
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(Lock)
48       */
49      public static void clearCache(Lock lock) {
50          getPersistence().clearCache(lock);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
55       */
56      public int countWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().countWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
65          throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
71       */
72      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
73          int start, int end) throws SystemException {
74          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
79       */
80      public static Lock remove(Lock lock) throws SystemException {
81          return getPersistence().remove(lock);
82      }
83  
84      /**
85       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
86       */
87      public static Lock update(Lock lock, boolean merge)
88          throws SystemException {
89          return getPersistence().update(lock, merge);
90      }
91  
92      public static void cacheResult(com.liferay.portal.model.Lock lock) {
93          getPersistence().cacheResult(lock);
94      }
95  
96      public static void cacheResult(
97          java.util.List<com.liferay.portal.model.Lock> locks) {
98          getPersistence().cacheResult(locks);
99      }
100 
101     public static com.liferay.portal.model.Lock create(long lockId) {
102         return getPersistence().create(lockId);
103     }
104 
105     public static com.liferay.portal.model.Lock remove(long lockId)
106         throws com.liferay.portal.NoSuchLockException,
107             com.liferay.portal.SystemException {
108         return getPersistence().remove(lockId);
109     }
110 
111     /**
112      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
113      */
114     public static com.liferay.portal.model.Lock update(
115         com.liferay.portal.model.Lock lock)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().update(lock);
118     }
119 
120     public static com.liferay.portal.model.Lock updateImpl(
121         com.liferay.portal.model.Lock lock, boolean merge)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().updateImpl(lock, merge);
124     }
125 
126     public static com.liferay.portal.model.Lock findByPrimaryKey(long lockId)
127         throws com.liferay.portal.NoSuchLockException,
128             com.liferay.portal.SystemException {
129         return getPersistence().findByPrimaryKey(lockId);
130     }
131 
132     public static com.liferay.portal.model.Lock fetchByPrimaryKey(long lockId)
133         throws com.liferay.portal.SystemException {
134         return getPersistence().fetchByPrimaryKey(lockId);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
138         java.lang.String uuid) throws com.liferay.portal.SystemException {
139         return getPersistence().findByUuid(uuid);
140     }
141 
142     public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
143         java.lang.String uuid, int start, int end)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findByUuid(uuid, start, end);
146     }
147 
148     public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
149         java.lang.String uuid, int start, int end,
150         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
151         throws com.liferay.portal.SystemException {
152         return getPersistence().findByUuid(uuid, start, end, orderByComparator);
153     }
154 
155     public static com.liferay.portal.model.Lock findByUuid_First(
156         java.lang.String uuid,
157         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
158         throws com.liferay.portal.NoSuchLockException,
159             com.liferay.portal.SystemException {
160         return getPersistence().findByUuid_First(uuid, orderByComparator);
161     }
162 
163     public static com.liferay.portal.model.Lock findByUuid_Last(
164         java.lang.String uuid,
165         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
166         throws com.liferay.portal.NoSuchLockException,
167             com.liferay.portal.SystemException {
168         return getPersistence().findByUuid_Last(uuid, orderByComparator);
169     }
170 
171     public static com.liferay.portal.model.Lock[] findByUuid_PrevAndNext(
172         long lockId, java.lang.String uuid,
173         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
174         throws com.liferay.portal.NoSuchLockException,
175             com.liferay.portal.SystemException {
176         return getPersistence()
177                    .findByUuid_PrevAndNext(lockId, uuid, orderByComparator);
178     }
179 
180     public static java.util.List<com.liferay.portal.model.Lock> findByExpirationDate(
181         java.util.Date expirationDate)
182         throws com.liferay.portal.SystemException {
183         return getPersistence().findByExpirationDate(expirationDate);
184     }
185 
186     public static java.util.List<com.liferay.portal.model.Lock> findByExpirationDate(
187         java.util.Date expirationDate, int start, int end)
188         throws com.liferay.portal.SystemException {
189         return getPersistence().findByExpirationDate(expirationDate, start, end);
190     }
191 
192     public static java.util.List<com.liferay.portal.model.Lock> findByExpirationDate(
193         java.util.Date expirationDate, int start, int end,
194         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
195         throws com.liferay.portal.SystemException {
196         return getPersistence()
197                    .findByExpirationDate(expirationDate, start, end,
198             orderByComparator);
199     }
200 
201     public static com.liferay.portal.model.Lock findByExpirationDate_First(
202         java.util.Date expirationDate,
203         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204         throws com.liferay.portal.NoSuchLockException,
205             com.liferay.portal.SystemException {
206         return getPersistence()
207                    .findByExpirationDate_First(expirationDate, orderByComparator);
208     }
209 
210     public static com.liferay.portal.model.Lock findByExpirationDate_Last(
211         java.util.Date expirationDate,
212         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
213         throws com.liferay.portal.NoSuchLockException,
214             com.liferay.portal.SystemException {
215         return getPersistence()
216                    .findByExpirationDate_Last(expirationDate, orderByComparator);
217     }
218 
219     public static com.liferay.portal.model.Lock[] findByExpirationDate_PrevAndNext(
220         long lockId, java.util.Date expirationDate,
221         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
222         throws com.liferay.portal.NoSuchLockException,
223             com.liferay.portal.SystemException {
224         return getPersistence()
225                    .findByExpirationDate_PrevAndNext(lockId, expirationDate,
226             orderByComparator);
227     }
228 
229     public static com.liferay.portal.model.Lock findByC_K(
230         java.lang.String className, java.lang.String key)
231         throws com.liferay.portal.NoSuchLockException,
232             com.liferay.portal.SystemException {
233         return getPersistence().findByC_K(className, key);
234     }
235 
236     public static com.liferay.portal.model.Lock fetchByC_K(
237         java.lang.String className, java.lang.String key)
238         throws com.liferay.portal.SystemException {
239         return getPersistence().fetchByC_K(className, key);
240     }
241 
242     public static com.liferay.portal.model.Lock fetchByC_K(
243         java.lang.String className, java.lang.String key,
244         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
245         return getPersistence().fetchByC_K(className, key, retrieveFromCache);
246     }
247 
248     public static java.util.List<com.liferay.portal.model.Lock> findAll()
249         throws com.liferay.portal.SystemException {
250         return getPersistence().findAll();
251     }
252 
253     public static java.util.List<com.liferay.portal.model.Lock> findAll(
254         int start, int end) throws com.liferay.portal.SystemException {
255         return getPersistence().findAll(start, end);
256     }
257 
258     public static java.util.List<com.liferay.portal.model.Lock> findAll(
259         int start, int end,
260         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
261         throws com.liferay.portal.SystemException {
262         return getPersistence().findAll(start, end, orderByComparator);
263     }
264 
265     public static void removeByUuid(java.lang.String uuid)
266         throws com.liferay.portal.SystemException {
267         getPersistence().removeByUuid(uuid);
268     }
269 
270     public static void removeByExpirationDate(java.util.Date expirationDate)
271         throws com.liferay.portal.SystemException {
272         getPersistence().removeByExpirationDate(expirationDate);
273     }
274 
275     public static void removeByC_K(java.lang.String className,
276         java.lang.String key)
277         throws com.liferay.portal.NoSuchLockException,
278             com.liferay.portal.SystemException {
279         getPersistence().removeByC_K(className, key);
280     }
281 
282     public static void removeAll() throws com.liferay.portal.SystemException {
283         getPersistence().removeAll();
284     }
285 
286     public static int countByUuid(java.lang.String uuid)
287         throws com.liferay.portal.SystemException {
288         return getPersistence().countByUuid(uuid);
289     }
290 
291     public static int countByExpirationDate(java.util.Date expirationDate)
292         throws com.liferay.portal.SystemException {
293         return getPersistence().countByExpirationDate(expirationDate);
294     }
295 
296     public static int countByC_K(java.lang.String className,
297         java.lang.String key) throws com.liferay.portal.SystemException {
298         return getPersistence().countByC_K(className, key);
299     }
300 
301     public static int countAll() throws com.liferay.portal.SystemException {
302         return getPersistence().countAll();
303     }
304 
305     public static LockPersistence getPersistence() {
306         if (_persistence == null) {
307             _persistence = (LockPersistence)PortalBeanLocatorUtil.locate(LockPersistence.class.getName());
308 
309             ReferenceRegistry.registerReference(LockUtil.class, "_persistence");
310         }
311 
312         return _persistence;
313     }
314 
315     public void setPersistence(LockPersistence persistence) {
316         _persistence = persistence;
317 
318         ReferenceRegistry.registerReference(LockUtil.class, "_persistence");
319     }
320 
321     private static LockPersistence _persistence;
322 }