1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  
26  /**
27   * <a href="LockUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       LockPersistence
36   * @see       LockPersistenceImpl
37   * @generated
38   */
39  public class LockUtil {
40      public static void cacheResult(com.liferay.portal.model.Lock lock) {
41          getPersistence().cacheResult(lock);
42      }
43  
44      public static void cacheResult(
45          java.util.List<com.liferay.portal.model.Lock> locks) {
46          getPersistence().cacheResult(locks);
47      }
48  
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      public static com.liferay.portal.model.Lock create(long lockId) {
54          return getPersistence().create(lockId);
55      }
56  
57      public static com.liferay.portal.model.Lock remove(long lockId)
58          throws com.liferay.portal.NoSuchLockException,
59              com.liferay.portal.SystemException {
60          return getPersistence().remove(lockId);
61      }
62  
63      public static com.liferay.portal.model.Lock remove(
64          com.liferay.portal.model.Lock lock)
65          throws com.liferay.portal.SystemException {
66          return getPersistence().remove(lock);
67      }
68  
69      /**
70       * @deprecated Use {@link #update(Lock, boolean merge)}.
71       */
72      public static com.liferay.portal.model.Lock update(
73          com.liferay.portal.model.Lock lock)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(lock);
76      }
77  
78      /**
79       * Add, update, or merge, the entity. This method also calls the model
80       * listeners to trigger the proper events associated with adding, deleting,
81       * or updating an entity.
82       *
83       * @param  lock the entity to add, update, or merge
84       * @param  merge boolean value for whether to merge the entity. The default
85       *         value is false. Setting merge to true is more expensive and
86       *         should only be true when lock is transient. See
87       *         LEP-5473 for a detailed discussion of this method.
88       * @return the entity that was added, updated, or merged
89       */
90      public static com.liferay.portal.model.Lock update(
91          com.liferay.portal.model.Lock lock, boolean merge)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().update(lock, merge);
94      }
95  
96      public static com.liferay.portal.model.Lock updateImpl(
97          com.liferay.portal.model.Lock lock, boolean merge)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().updateImpl(lock, merge);
100     }
101 
102     public static com.liferay.portal.model.Lock findByPrimaryKey(long lockId)
103         throws com.liferay.portal.NoSuchLockException,
104             com.liferay.portal.SystemException {
105         return getPersistence().findByPrimaryKey(lockId);
106     }
107 
108     public static com.liferay.portal.model.Lock fetchByPrimaryKey(long lockId)
109         throws com.liferay.portal.SystemException {
110         return getPersistence().fetchByPrimaryKey(lockId);
111     }
112 
113     public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
114         java.lang.String uuid) throws com.liferay.portal.SystemException {
115         return getPersistence().findByUuid(uuid);
116     }
117 
118     public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
119         java.lang.String uuid, int start, int end)
120         throws com.liferay.portal.SystemException {
121         return getPersistence().findByUuid(uuid, start, end);
122     }
123 
124     public static java.util.List<com.liferay.portal.model.Lock> findByUuid(
125         java.lang.String uuid, int start, int end,
126         com.liferay.portal.kernel.util.OrderByComparator obc)
127         throws com.liferay.portal.SystemException {
128         return getPersistence().findByUuid(uuid, start, end, obc);
129     }
130 
131     public static com.liferay.portal.model.Lock findByUuid_First(
132         java.lang.String uuid,
133         com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchLockException,
135             com.liferay.portal.SystemException {
136         return getPersistence().findByUuid_First(uuid, obc);
137     }
138 
139     public static com.liferay.portal.model.Lock findByUuid_Last(
140         java.lang.String uuid,
141         com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.NoSuchLockException,
143             com.liferay.portal.SystemException {
144         return getPersistence().findByUuid_Last(uuid, obc);
145     }
146 
147     public static com.liferay.portal.model.Lock[] findByUuid_PrevAndNext(
148         long lockId, java.lang.String uuid,
149         com.liferay.portal.kernel.util.OrderByComparator obc)
150         throws com.liferay.portal.NoSuchLockException,
151             com.liferay.portal.SystemException {
152         return getPersistence().findByUuid_PrevAndNext(lockId, uuid, obc);
153     }
154 
155     public static java.util.List<com.liferay.portal.model.Lock> findByExpirationDate(
156         java.util.Date expirationDate)
157         throws com.liferay.portal.SystemException {
158         return getPersistence().findByExpirationDate(expirationDate);
159     }
160 
161     public static java.util.List<com.liferay.portal.model.Lock> findByExpirationDate(
162         java.util.Date expirationDate, int start, int end)
163         throws com.liferay.portal.SystemException {
164         return getPersistence().findByExpirationDate(expirationDate, start, end);
165     }
166 
167     public static java.util.List<com.liferay.portal.model.Lock> findByExpirationDate(
168         java.util.Date expirationDate, int start, int end,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException {
171         return getPersistence()
172                    .findByExpirationDate(expirationDate, start, end, obc);
173     }
174 
175     public static com.liferay.portal.model.Lock findByExpirationDate_First(
176         java.util.Date expirationDate,
177         com.liferay.portal.kernel.util.OrderByComparator obc)
178         throws com.liferay.portal.NoSuchLockException,
179             com.liferay.portal.SystemException {
180         return getPersistence().findByExpirationDate_First(expirationDate, obc);
181     }
182 
183     public static com.liferay.portal.model.Lock findByExpirationDate_Last(
184         java.util.Date expirationDate,
185         com.liferay.portal.kernel.util.OrderByComparator obc)
186         throws com.liferay.portal.NoSuchLockException,
187             com.liferay.portal.SystemException {
188         return getPersistence().findByExpirationDate_Last(expirationDate, obc);
189     }
190 
191     public static com.liferay.portal.model.Lock[] findByExpirationDate_PrevAndNext(
192         long lockId, java.util.Date expirationDate,
193         com.liferay.portal.kernel.util.OrderByComparator obc)
194         throws com.liferay.portal.NoSuchLockException,
195             com.liferay.portal.SystemException {
196         return getPersistence()
197                    .findByExpirationDate_PrevAndNext(lockId, expirationDate, obc);
198     }
199 
200     public static com.liferay.portal.model.Lock findByC_K(
201         java.lang.String className, java.lang.String key)
202         throws com.liferay.portal.NoSuchLockException,
203             com.liferay.portal.SystemException {
204         return getPersistence().findByC_K(className, key);
205     }
206 
207     public static com.liferay.portal.model.Lock fetchByC_K(
208         java.lang.String className, java.lang.String key)
209         throws com.liferay.portal.SystemException {
210         return getPersistence().fetchByC_K(className, key);
211     }
212 
213     public static com.liferay.portal.model.Lock fetchByC_K(
214         java.lang.String className, java.lang.String key,
215         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
216         return getPersistence().fetchByC_K(className, key, retrieveFromCache);
217     }
218 
219     public static java.util.List<Object> findWithDynamicQuery(
220         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
221         throws com.liferay.portal.SystemException {
222         return getPersistence().findWithDynamicQuery(dynamicQuery);
223     }
224 
225     public static java.util.List<Object> findWithDynamicQuery(
226         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
227         int end) throws com.liferay.portal.SystemException {
228         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
229     }
230 
231     public static java.util.List<com.liferay.portal.model.Lock> findAll()
232         throws com.liferay.portal.SystemException {
233         return getPersistence().findAll();
234     }
235 
236     public static java.util.List<com.liferay.portal.model.Lock> findAll(
237         int start, int end) throws com.liferay.portal.SystemException {
238         return getPersistence().findAll(start, end);
239     }
240 
241     public static java.util.List<com.liferay.portal.model.Lock> findAll(
242         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
243         throws com.liferay.portal.SystemException {
244         return getPersistence().findAll(start, end, obc);
245     }
246 
247     public static void removeByUuid(java.lang.String uuid)
248         throws com.liferay.portal.SystemException {
249         getPersistence().removeByUuid(uuid);
250     }
251 
252     public static void removeByExpirationDate(java.util.Date expirationDate)
253         throws com.liferay.portal.SystemException {
254         getPersistence().removeByExpirationDate(expirationDate);
255     }
256 
257     public static void removeByC_K(java.lang.String className,
258         java.lang.String key)
259         throws com.liferay.portal.NoSuchLockException,
260             com.liferay.portal.SystemException {
261         getPersistence().removeByC_K(className, key);
262     }
263 
264     public static void removeAll() throws com.liferay.portal.SystemException {
265         getPersistence().removeAll();
266     }
267 
268     public static int countByUuid(java.lang.String uuid)
269         throws com.liferay.portal.SystemException {
270         return getPersistence().countByUuid(uuid);
271     }
272 
273     public static int countByExpirationDate(java.util.Date expirationDate)
274         throws com.liferay.portal.SystemException {
275         return getPersistence().countByExpirationDate(expirationDate);
276     }
277 
278     public static int countByC_K(java.lang.String className,
279         java.lang.String key) throws com.liferay.portal.SystemException {
280         return getPersistence().countByC_K(className, key);
281     }
282 
283     public static int countAll() throws com.liferay.portal.SystemException {
284         return getPersistence().countAll();
285     }
286 
287     public static LockPersistence getPersistence() {
288         return _persistence;
289     }
290 
291     public void setPersistence(LockPersistence persistence) {
292         _persistence = persistence;
293     }
294 
295     private static LockPersistence _persistence;
296 }