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   * <a href="PhoneUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class PhoneUtil {
32      public static void cacheResult(com.liferay.portal.model.Phone phone) {
33          getPersistence().cacheResult(phone);
34      }
35  
36      public static void cacheResult(
37          java.util.List<com.liferay.portal.model.Phone> phones) {
38          getPersistence().cacheResult(phones);
39      }
40  
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      public static com.liferay.portal.model.Phone create(long phoneId) {
46          return getPersistence().create(phoneId);
47      }
48  
49      public static com.liferay.portal.model.Phone remove(long phoneId)
50          throws com.liferay.portal.NoSuchPhoneException,
51              com.liferay.portal.SystemException {
52          return getPersistence().remove(phoneId);
53      }
54  
55      public static com.liferay.portal.model.Phone remove(
56          com.liferay.portal.model.Phone phone)
57          throws com.liferay.portal.SystemException {
58          return getPersistence().remove(phone);
59      }
60  
61      /**
62       * @deprecated Use <code>update(Phone phone, boolean merge)</code>.
63       */
64      public static com.liferay.portal.model.Phone update(
65          com.liferay.portal.model.Phone phone)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().update(phone);
68      }
69  
70      /**
71       * Add, update, or merge, the entity. This method also calls the model
72       * listeners to trigger the proper events associated with adding, deleting,
73       * or updating an entity.
74       *
75       * @param        phone the entity to add, update, or merge
76       * @param        merge boolean value for whether to merge the entity. The
77       *                default value is false. Setting merge to true is more
78       *                expensive and should only be true when phone is
79       *                transient. See LEP-5473 for a detailed discussion of this
80       *                method.
81       * @return        true if the portlet can be displayed via Ajax
82       */
83      public static com.liferay.portal.model.Phone update(
84          com.liferay.portal.model.Phone phone, boolean merge)
85          throws com.liferay.portal.SystemException {
86          return getPersistence().update(phone, merge);
87      }
88  
89      public static com.liferay.portal.model.Phone updateImpl(
90          com.liferay.portal.model.Phone phone, boolean merge)
91          throws com.liferay.portal.SystemException {
92          return getPersistence().updateImpl(phone, merge);
93      }
94  
95      public static com.liferay.portal.model.Phone findByPrimaryKey(long phoneId)
96          throws com.liferay.portal.NoSuchPhoneException,
97              com.liferay.portal.SystemException {
98          return getPersistence().findByPrimaryKey(phoneId);
99      }
100 
101     public static com.liferay.portal.model.Phone fetchByPrimaryKey(long phoneId)
102         throws com.liferay.portal.SystemException {
103         return getPersistence().fetchByPrimaryKey(phoneId);
104     }
105 
106     public static java.util.List<com.liferay.portal.model.Phone> findByCompanyId(
107         long companyId) throws com.liferay.portal.SystemException {
108         return getPersistence().findByCompanyId(companyId);
109     }
110 
111     public static java.util.List<com.liferay.portal.model.Phone> findByCompanyId(
112         long companyId, int start, int end)
113         throws com.liferay.portal.SystemException {
114         return getPersistence().findByCompanyId(companyId, start, end);
115     }
116 
117     public static java.util.List<com.liferay.portal.model.Phone> findByCompanyId(
118         long companyId, int start, int end,
119         com.liferay.portal.kernel.util.OrderByComparator obc)
120         throws com.liferay.portal.SystemException {
121         return getPersistence().findByCompanyId(companyId, start, end, obc);
122     }
123 
124     public static com.liferay.portal.model.Phone findByCompanyId_First(
125         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
126         throws com.liferay.portal.NoSuchPhoneException,
127             com.liferay.portal.SystemException {
128         return getPersistence().findByCompanyId_First(companyId, obc);
129     }
130 
131     public static com.liferay.portal.model.Phone findByCompanyId_Last(
132         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
133         throws com.liferay.portal.NoSuchPhoneException,
134             com.liferay.portal.SystemException {
135         return getPersistence().findByCompanyId_Last(companyId, obc);
136     }
137 
138     public static com.liferay.portal.model.Phone[] findByCompanyId_PrevAndNext(
139         long phoneId, long companyId,
140         com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.NoSuchPhoneException,
142             com.liferay.portal.SystemException {
143         return getPersistence()
144                    .findByCompanyId_PrevAndNext(phoneId, companyId, obc);
145     }
146 
147     public static java.util.List<com.liferay.portal.model.Phone> findByUserId(
148         long userId) throws com.liferay.portal.SystemException {
149         return getPersistence().findByUserId(userId);
150     }
151 
152     public static java.util.List<com.liferay.portal.model.Phone> findByUserId(
153         long userId, int start, int end)
154         throws com.liferay.portal.SystemException {
155         return getPersistence().findByUserId(userId, start, end);
156     }
157 
158     public static java.util.List<com.liferay.portal.model.Phone> findByUserId(
159         long userId, int start, int end,
160         com.liferay.portal.kernel.util.OrderByComparator obc)
161         throws com.liferay.portal.SystemException {
162         return getPersistence().findByUserId(userId, start, end, obc);
163     }
164 
165     public static com.liferay.portal.model.Phone findByUserId_First(
166         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
167         throws com.liferay.portal.NoSuchPhoneException,
168             com.liferay.portal.SystemException {
169         return getPersistence().findByUserId_First(userId, obc);
170     }
171 
172     public static com.liferay.portal.model.Phone findByUserId_Last(
173         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
174         throws com.liferay.portal.NoSuchPhoneException,
175             com.liferay.portal.SystemException {
176         return getPersistence().findByUserId_Last(userId, obc);
177     }
178 
179     public static com.liferay.portal.model.Phone[] findByUserId_PrevAndNext(
180         long phoneId, long userId,
181         com.liferay.portal.kernel.util.OrderByComparator obc)
182         throws com.liferay.portal.NoSuchPhoneException,
183             com.liferay.portal.SystemException {
184         return getPersistence().findByUserId_PrevAndNext(phoneId, userId, obc);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Phone> findByC_C(
188         long companyId, long classNameId)
189         throws com.liferay.portal.SystemException {
190         return getPersistence().findByC_C(companyId, classNameId);
191     }
192 
193     public static java.util.List<com.liferay.portal.model.Phone> findByC_C(
194         long companyId, long classNameId, int start, int end)
195         throws com.liferay.portal.SystemException {
196         return getPersistence().findByC_C(companyId, classNameId, start, end);
197     }
198 
199     public static java.util.List<com.liferay.portal.model.Phone> findByC_C(
200         long companyId, long classNameId, int start, int end,
201         com.liferay.portal.kernel.util.OrderByComparator obc)
202         throws com.liferay.portal.SystemException {
203         return getPersistence()
204                    .findByC_C(companyId, classNameId, start, end, obc);
205     }
206 
207     public static com.liferay.portal.model.Phone findByC_C_First(
208         long companyId, long classNameId,
209         com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.NoSuchPhoneException,
211             com.liferay.portal.SystemException {
212         return getPersistence().findByC_C_First(companyId, classNameId, obc);
213     }
214 
215     public static com.liferay.portal.model.Phone findByC_C_Last(
216         long companyId, long classNameId,
217         com.liferay.portal.kernel.util.OrderByComparator obc)
218         throws com.liferay.portal.NoSuchPhoneException,
219             com.liferay.portal.SystemException {
220         return getPersistence().findByC_C_Last(companyId, classNameId, obc);
221     }
222 
223     public static com.liferay.portal.model.Phone[] findByC_C_PrevAndNext(
224         long phoneId, long companyId, long classNameId,
225         com.liferay.portal.kernel.util.OrderByComparator obc)
226         throws com.liferay.portal.NoSuchPhoneException,
227             com.liferay.portal.SystemException {
228         return getPersistence()
229                    .findByC_C_PrevAndNext(phoneId, companyId, classNameId, obc);
230     }
231 
232     public static java.util.List<com.liferay.portal.model.Phone> findByC_C_C(
233         long companyId, long classNameId, long classPK)
234         throws com.liferay.portal.SystemException {
235         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
236     }
237 
238     public static java.util.List<com.liferay.portal.model.Phone> findByC_C_C(
239         long companyId, long classNameId, long classPK, int start, int end)
240         throws com.liferay.portal.SystemException {
241         return getPersistence()
242                    .findByC_C_C(companyId, classNameId, classPK, start, end);
243     }
244 
245     public static java.util.List<com.liferay.portal.model.Phone> findByC_C_C(
246         long companyId, long classNameId, long classPK, int start, int end,
247         com.liferay.portal.kernel.util.OrderByComparator obc)
248         throws com.liferay.portal.SystemException {
249         return getPersistence()
250                    .findByC_C_C(companyId, classNameId, classPK, start, end, obc);
251     }
252 
253     public static com.liferay.portal.model.Phone findByC_C_C_First(
254         long companyId, long classNameId, long classPK,
255         com.liferay.portal.kernel.util.OrderByComparator obc)
256         throws com.liferay.portal.NoSuchPhoneException,
257             com.liferay.portal.SystemException {
258         return getPersistence()
259                    .findByC_C_C_First(companyId, classNameId, classPK, obc);
260     }
261 
262     public static com.liferay.portal.model.Phone findByC_C_C_Last(
263         long companyId, long classNameId, long classPK,
264         com.liferay.portal.kernel.util.OrderByComparator obc)
265         throws com.liferay.portal.NoSuchPhoneException,
266             com.liferay.portal.SystemException {
267         return getPersistence()
268                    .findByC_C_C_Last(companyId, classNameId, classPK, obc);
269     }
270 
271     public static com.liferay.portal.model.Phone[] findByC_C_C_PrevAndNext(
272         long phoneId, long companyId, long classNameId, long classPK,
273         com.liferay.portal.kernel.util.OrderByComparator obc)
274         throws com.liferay.portal.NoSuchPhoneException,
275             com.liferay.portal.SystemException {
276         return getPersistence()
277                    .findByC_C_C_PrevAndNext(phoneId, companyId, classNameId,
278             classPK, obc);
279     }
280 
281     public static java.util.List<com.liferay.portal.model.Phone> findByC_C_C_P(
282         long companyId, long classNameId, long classPK, boolean primary)
283         throws com.liferay.portal.SystemException {
284         return getPersistence()
285                    .findByC_C_C_P(companyId, classNameId, classPK, primary);
286     }
287 
288     public static java.util.List<com.liferay.portal.model.Phone> findByC_C_C_P(
289         long companyId, long classNameId, long classPK, boolean primary,
290         int start, int end) throws com.liferay.portal.SystemException {
291         return getPersistence()
292                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
293             start, end);
294     }
295 
296     public static java.util.List<com.liferay.portal.model.Phone> findByC_C_C_P(
297         long companyId, long classNameId, long classPK, boolean primary,
298         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
299         throws com.liferay.portal.SystemException {
300         return getPersistence()
301                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
302             start, end, obc);
303     }
304 
305     public static com.liferay.portal.model.Phone findByC_C_C_P_First(
306         long companyId, long classNameId, long classPK, boolean primary,
307         com.liferay.portal.kernel.util.OrderByComparator obc)
308         throws com.liferay.portal.NoSuchPhoneException,
309             com.liferay.portal.SystemException {
310         return getPersistence()
311                    .findByC_C_C_P_First(companyId, classNameId, classPK,
312             primary, obc);
313     }
314 
315     public static com.liferay.portal.model.Phone findByC_C_C_P_Last(
316         long companyId, long classNameId, long classPK, boolean primary,
317         com.liferay.portal.kernel.util.OrderByComparator obc)
318         throws com.liferay.portal.NoSuchPhoneException,
319             com.liferay.portal.SystemException {
320         return getPersistence()
321                    .findByC_C_C_P_Last(companyId, classNameId, classPK,
322             primary, obc);
323     }
324 
325     public static com.liferay.portal.model.Phone[] findByC_C_C_P_PrevAndNext(
326         long phoneId, long companyId, long classNameId, long classPK,
327         boolean primary, com.liferay.portal.kernel.util.OrderByComparator obc)
328         throws com.liferay.portal.NoSuchPhoneException,
329             com.liferay.portal.SystemException {
330         return getPersistence()
331                    .findByC_C_C_P_PrevAndNext(phoneId, companyId, classNameId,
332             classPK, primary, obc);
333     }
334 
335     public static java.util.List<Object> findWithDynamicQuery(
336         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
337         throws com.liferay.portal.SystemException {
338         return getPersistence().findWithDynamicQuery(dynamicQuery);
339     }
340 
341     public static java.util.List<Object> findWithDynamicQuery(
342         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
343         int end) throws com.liferay.portal.SystemException {
344         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
345     }
346 
347     public static java.util.List<com.liferay.portal.model.Phone> findAll()
348         throws com.liferay.portal.SystemException {
349         return getPersistence().findAll();
350     }
351 
352     public static java.util.List<com.liferay.portal.model.Phone> findAll(
353         int start, int end) throws com.liferay.portal.SystemException {
354         return getPersistence().findAll(start, end);
355     }
356 
357     public static java.util.List<com.liferay.portal.model.Phone> findAll(
358         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
359         throws com.liferay.portal.SystemException {
360         return getPersistence().findAll(start, end, obc);
361     }
362 
363     public static void removeByCompanyId(long companyId)
364         throws com.liferay.portal.SystemException {
365         getPersistence().removeByCompanyId(companyId);
366     }
367 
368     public static void removeByUserId(long userId)
369         throws com.liferay.portal.SystemException {
370         getPersistence().removeByUserId(userId);
371     }
372 
373     public static void removeByC_C(long companyId, long classNameId)
374         throws com.liferay.portal.SystemException {
375         getPersistence().removeByC_C(companyId, classNameId);
376     }
377 
378     public static void removeByC_C_C(long companyId, long classNameId,
379         long classPK) throws com.liferay.portal.SystemException {
380         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
381     }
382 
383     public static void removeByC_C_C_P(long companyId, long classNameId,
384         long classPK, boolean primary)
385         throws com.liferay.portal.SystemException {
386         getPersistence()
387             .removeByC_C_C_P(companyId, classNameId, classPK, primary);
388     }
389 
390     public static void removeAll() throws com.liferay.portal.SystemException {
391         getPersistence().removeAll();
392     }
393 
394     public static int countByCompanyId(long companyId)
395         throws com.liferay.portal.SystemException {
396         return getPersistence().countByCompanyId(companyId);
397     }
398 
399     public static int countByUserId(long userId)
400         throws com.liferay.portal.SystemException {
401         return getPersistence().countByUserId(userId);
402     }
403 
404     public static int countByC_C(long companyId, long classNameId)
405         throws com.liferay.portal.SystemException {
406         return getPersistence().countByC_C(companyId, classNameId);
407     }
408 
409     public static int countByC_C_C(long companyId, long classNameId,
410         long classPK) throws com.liferay.portal.SystemException {
411         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
412     }
413 
414     public static int countByC_C_C_P(long companyId, long classNameId,
415         long classPK, boolean primary)
416         throws com.liferay.portal.SystemException {
417         return getPersistence()
418                    .countByC_C_C_P(companyId, classNameId, classPK, primary);
419     }
420 
421     public static int countAll() throws com.liferay.portal.SystemException {
422         return getPersistence().countAll();
423     }
424 
425     public static PhonePersistence getPersistence() {
426         return _persistence;
427     }
428 
429     public void setPersistence(PhonePersistence persistence) {
430         _persistence = persistence;
431     }
432 
433     private static PhonePersistence _persistence;
434 }