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