1   /**
2    * Copyright (c) 2000-2008 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="AddressUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class AddressUtil {
32      public static com.liferay.portal.model.Address create(long addressId) {
33          return getPersistence().create(addressId);
34      }
35  
36      public static com.liferay.portal.model.Address remove(long addressId)
37          throws com.liferay.portal.SystemException,
38              com.liferay.portal.NoSuchAddressException {
39          return getPersistence().remove(addressId);
40      }
41  
42      public static com.liferay.portal.model.Address remove(
43          com.liferay.portal.model.Address address)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(address);
46      }
47  
48      /**
49       * @deprecated Use <code>update(Address address, boolean merge)</code>.
50       */
51      public static com.liferay.portal.model.Address update(
52          com.liferay.portal.model.Address address)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(address);
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        address 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 address 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.Address update(
71          com.liferay.portal.model.Address address, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(address, merge);
74      }
75  
76      public static com.liferay.portal.model.Address updateImpl(
77          com.liferay.portal.model.Address address, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(address, merge);
80      }
81  
82      public static com.liferay.portal.model.Address findByPrimaryKey(
83          long addressId)
84          throws com.liferay.portal.SystemException,
85              com.liferay.portal.NoSuchAddressException {
86          return getPersistence().findByPrimaryKey(addressId);
87      }
88  
89      public static com.liferay.portal.model.Address fetchByPrimaryKey(
90          long addressId) throws com.liferay.portal.SystemException {
91          return getPersistence().fetchByPrimaryKey(addressId);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.Address> findByCompanyId(
95          long companyId) throws com.liferay.portal.SystemException {
96          return getPersistence().findByCompanyId(companyId);
97      }
98  
99      public static java.util.List<com.liferay.portal.model.Address> findByCompanyId(
100         long companyId, int begin, int end)
101         throws com.liferay.portal.SystemException {
102         return getPersistence().findByCompanyId(companyId, begin, end);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.Address> findByCompanyId(
106         long companyId, int begin, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findByCompanyId(companyId, begin, end, obc);
110     }
111 
112     public static com.liferay.portal.model.Address findByCompanyId_First(
113         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
114         throws com.liferay.portal.SystemException,
115             com.liferay.portal.NoSuchAddressException {
116         return getPersistence().findByCompanyId_First(companyId, obc);
117     }
118 
119     public static com.liferay.portal.model.Address findByCompanyId_Last(
120         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
121         throws com.liferay.portal.SystemException,
122             com.liferay.portal.NoSuchAddressException {
123         return getPersistence().findByCompanyId_Last(companyId, obc);
124     }
125 
126     public static com.liferay.portal.model.Address[] findByCompanyId_PrevAndNext(
127         long addressId, long companyId,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException,
130             com.liferay.portal.NoSuchAddressException {
131         return getPersistence()
132                    .findByCompanyId_PrevAndNext(addressId, companyId, obc);
133     }
134 
135     public static java.util.List<com.liferay.portal.model.Address> findByUserId(
136         long userId) throws com.liferay.portal.SystemException {
137         return getPersistence().findByUserId(userId);
138     }
139 
140     public static java.util.List<com.liferay.portal.model.Address> findByUserId(
141         long userId, int begin, int end)
142         throws com.liferay.portal.SystemException {
143         return getPersistence().findByUserId(userId, begin, end);
144     }
145 
146     public static java.util.List<com.liferay.portal.model.Address> findByUserId(
147         long userId, int begin, int end,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.SystemException {
150         return getPersistence().findByUserId(userId, begin, end, obc);
151     }
152 
153     public static com.liferay.portal.model.Address findByUserId_First(
154         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
155         throws com.liferay.portal.SystemException,
156             com.liferay.portal.NoSuchAddressException {
157         return getPersistence().findByUserId_First(userId, obc);
158     }
159 
160     public static com.liferay.portal.model.Address findByUserId_Last(
161         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
162         throws com.liferay.portal.SystemException,
163             com.liferay.portal.NoSuchAddressException {
164         return getPersistence().findByUserId_Last(userId, obc);
165     }
166 
167     public static com.liferay.portal.model.Address[] findByUserId_PrevAndNext(
168         long addressId, long userId,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException,
171             com.liferay.portal.NoSuchAddressException {
172         return getPersistence().findByUserId_PrevAndNext(addressId, userId, obc);
173     }
174 
175     public static java.util.List<com.liferay.portal.model.Address> findByC_C(
176         long companyId, long classNameId)
177         throws com.liferay.portal.SystemException {
178         return getPersistence().findByC_C(companyId, classNameId);
179     }
180 
181     public static java.util.List<com.liferay.portal.model.Address> findByC_C(
182         long companyId, long classNameId, int begin, int end)
183         throws com.liferay.portal.SystemException {
184         return getPersistence().findByC_C(companyId, classNameId, begin, end);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Address> findByC_C(
188         long companyId, long classNameId, int begin, int end,
189         com.liferay.portal.kernel.util.OrderByComparator obc)
190         throws com.liferay.portal.SystemException {
191         return getPersistence()
192                    .findByC_C(companyId, classNameId, begin, end, obc);
193     }
194 
195     public static com.liferay.portal.model.Address findByC_C_First(
196         long companyId, long classNameId,
197         com.liferay.portal.kernel.util.OrderByComparator obc)
198         throws com.liferay.portal.SystemException,
199             com.liferay.portal.NoSuchAddressException {
200         return getPersistence().findByC_C_First(companyId, classNameId, obc);
201     }
202 
203     public static com.liferay.portal.model.Address findByC_C_Last(
204         long companyId, long classNameId,
205         com.liferay.portal.kernel.util.OrderByComparator obc)
206         throws com.liferay.portal.SystemException,
207             com.liferay.portal.NoSuchAddressException {
208         return getPersistence().findByC_C_Last(companyId, classNameId, obc);
209     }
210 
211     public static com.liferay.portal.model.Address[] findByC_C_PrevAndNext(
212         long addressId, long companyId, long classNameId,
213         com.liferay.portal.kernel.util.OrderByComparator obc)
214         throws com.liferay.portal.SystemException,
215             com.liferay.portal.NoSuchAddressException {
216         return getPersistence()
217                    .findByC_C_PrevAndNext(addressId, companyId, classNameId, obc);
218     }
219 
220     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
221         long companyId, long classNameId, long classPK)
222         throws com.liferay.portal.SystemException {
223         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
224     }
225 
226     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
227         long companyId, long classNameId, long classPK, int begin, int end)
228         throws com.liferay.portal.SystemException {
229         return getPersistence()
230                    .findByC_C_C(companyId, classNameId, classPK, begin, end);
231     }
232 
233     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
234         long companyId, long classNameId, long classPK, int begin, int end,
235         com.liferay.portal.kernel.util.OrderByComparator obc)
236         throws com.liferay.portal.SystemException {
237         return getPersistence()
238                    .findByC_C_C(companyId, classNameId, classPK, begin, end, obc);
239     }
240 
241     public static com.liferay.portal.model.Address findByC_C_C_First(
242         long companyId, long classNameId, long classPK,
243         com.liferay.portal.kernel.util.OrderByComparator obc)
244         throws com.liferay.portal.SystemException,
245             com.liferay.portal.NoSuchAddressException {
246         return getPersistence()
247                    .findByC_C_C_First(companyId, classNameId, classPK, obc);
248     }
249 
250     public static com.liferay.portal.model.Address findByC_C_C_Last(
251         long companyId, long classNameId, long classPK,
252         com.liferay.portal.kernel.util.OrderByComparator obc)
253         throws com.liferay.portal.SystemException,
254             com.liferay.portal.NoSuchAddressException {
255         return getPersistence()
256                    .findByC_C_C_Last(companyId, classNameId, classPK, obc);
257     }
258 
259     public static com.liferay.portal.model.Address[] findByC_C_C_PrevAndNext(
260         long addressId, long companyId, long classNameId, long classPK,
261         com.liferay.portal.kernel.util.OrderByComparator obc)
262         throws com.liferay.portal.SystemException,
263             com.liferay.portal.NoSuchAddressException {
264         return getPersistence()
265                    .findByC_C_C_PrevAndNext(addressId, companyId, classNameId,
266             classPK, obc);
267     }
268 
269     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
270         long companyId, long classNameId, long classPK, boolean mailing)
271         throws com.liferay.portal.SystemException {
272         return getPersistence()
273                    .findByC_C_C_M(companyId, classNameId, classPK, mailing);
274     }
275 
276     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
277         long companyId, long classNameId, long classPK, boolean mailing,
278         int begin, int end) throws com.liferay.portal.SystemException {
279         return getPersistence()
280                    .findByC_C_C_M(companyId, classNameId, classPK, mailing,
281             begin, end);
282     }
283 
284     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
285         long companyId, long classNameId, long classPK, boolean mailing,
286         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
287         throws com.liferay.portal.SystemException {
288         return getPersistence()
289                    .findByC_C_C_M(companyId, classNameId, classPK, mailing,
290             begin, end, obc);
291     }
292 
293     public static com.liferay.portal.model.Address findByC_C_C_M_First(
294         long companyId, long classNameId, long classPK, boolean mailing,
295         com.liferay.portal.kernel.util.OrderByComparator obc)
296         throws com.liferay.portal.SystemException,
297             com.liferay.portal.NoSuchAddressException {
298         return getPersistence()
299                    .findByC_C_C_M_First(companyId, classNameId, classPK,
300             mailing, obc);
301     }
302 
303     public static com.liferay.portal.model.Address findByC_C_C_M_Last(
304         long companyId, long classNameId, long classPK, boolean mailing,
305         com.liferay.portal.kernel.util.OrderByComparator obc)
306         throws com.liferay.portal.SystemException,
307             com.liferay.portal.NoSuchAddressException {
308         return getPersistence()
309                    .findByC_C_C_M_Last(companyId, classNameId, classPK,
310             mailing, obc);
311     }
312 
313     public static com.liferay.portal.model.Address[] findByC_C_C_M_PrevAndNext(
314         long addressId, long companyId, long classNameId, long classPK,
315         boolean mailing, com.liferay.portal.kernel.util.OrderByComparator obc)
316         throws com.liferay.portal.SystemException,
317             com.liferay.portal.NoSuchAddressException {
318         return getPersistence()
319                    .findByC_C_C_M_PrevAndNext(addressId, companyId,
320             classNameId, classPK, mailing, obc);
321     }
322 
323     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
324         long companyId, long classNameId, long classPK, boolean primary)
325         throws com.liferay.portal.SystemException {
326         return getPersistence()
327                    .findByC_C_C_P(companyId, classNameId, classPK, primary);
328     }
329 
330     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
331         long companyId, long classNameId, long classPK, boolean primary,
332         int begin, int end) throws com.liferay.portal.SystemException {
333         return getPersistence()
334                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
335             begin, end);
336     }
337 
338     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
339         long companyId, long classNameId, long classPK, boolean primary,
340         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
341         throws com.liferay.portal.SystemException {
342         return getPersistence()
343                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
344             begin, end, obc);
345     }
346 
347     public static com.liferay.portal.model.Address findByC_C_C_P_First(
348         long companyId, long classNameId, long classPK, boolean primary,
349         com.liferay.portal.kernel.util.OrderByComparator obc)
350         throws com.liferay.portal.SystemException,
351             com.liferay.portal.NoSuchAddressException {
352         return getPersistence()
353                    .findByC_C_C_P_First(companyId, classNameId, classPK,
354             primary, obc);
355     }
356 
357     public static com.liferay.portal.model.Address findByC_C_C_P_Last(
358         long companyId, long classNameId, long classPK, boolean primary,
359         com.liferay.portal.kernel.util.OrderByComparator obc)
360         throws com.liferay.portal.SystemException,
361             com.liferay.portal.NoSuchAddressException {
362         return getPersistence()
363                    .findByC_C_C_P_Last(companyId, classNameId, classPK,
364             primary, obc);
365     }
366 
367     public static com.liferay.portal.model.Address[] findByC_C_C_P_PrevAndNext(
368         long addressId, long companyId, long classNameId, long classPK,
369         boolean primary, com.liferay.portal.kernel.util.OrderByComparator obc)
370         throws com.liferay.portal.SystemException,
371             com.liferay.portal.NoSuchAddressException {
372         return getPersistence()
373                    .findByC_C_C_P_PrevAndNext(addressId, companyId,
374             classNameId, classPK, primary, obc);
375     }
376 
377     public static java.util.List<com.liferay.portal.model.Address> findWithDynamicQuery(
378         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
379         throws com.liferay.portal.SystemException {
380         return getPersistence().findWithDynamicQuery(queryInitializer);
381     }
382 
383     public static java.util.List<com.liferay.portal.model.Address> findWithDynamicQuery(
384         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
385         int begin, int end) throws com.liferay.portal.SystemException {
386         return getPersistence()
387                    .findWithDynamicQuery(queryInitializer, begin, end);
388     }
389 
390     public static java.util.List<com.liferay.portal.model.Address> findAll()
391         throws com.liferay.portal.SystemException {
392         return getPersistence().findAll();
393     }
394 
395     public static java.util.List<com.liferay.portal.model.Address> findAll(
396         int begin, int end) throws com.liferay.portal.SystemException {
397         return getPersistence().findAll(begin, end);
398     }
399 
400     public static java.util.List<com.liferay.portal.model.Address> findAll(
401         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
402         throws com.liferay.portal.SystemException {
403         return getPersistence().findAll(begin, end, obc);
404     }
405 
406     public static void removeByCompanyId(long companyId)
407         throws com.liferay.portal.SystemException {
408         getPersistence().removeByCompanyId(companyId);
409     }
410 
411     public static void removeByUserId(long userId)
412         throws com.liferay.portal.SystemException {
413         getPersistence().removeByUserId(userId);
414     }
415 
416     public static void removeByC_C(long companyId, long classNameId)
417         throws com.liferay.portal.SystemException {
418         getPersistence().removeByC_C(companyId, classNameId);
419     }
420 
421     public static void removeByC_C_C(long companyId, long classNameId,
422         long classPK) throws com.liferay.portal.SystemException {
423         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
424     }
425 
426     public static void removeByC_C_C_M(long companyId, long classNameId,
427         long classPK, boolean mailing)
428         throws com.liferay.portal.SystemException {
429         getPersistence()
430             .removeByC_C_C_M(companyId, classNameId, classPK, mailing);
431     }
432 
433     public static void removeByC_C_C_P(long companyId, long classNameId,
434         long classPK, boolean primary)
435         throws com.liferay.portal.SystemException {
436         getPersistence()
437             .removeByC_C_C_P(companyId, classNameId, classPK, primary);
438     }
439 
440     public static void removeAll() throws com.liferay.portal.SystemException {
441         getPersistence().removeAll();
442     }
443 
444     public static int countByCompanyId(long companyId)
445         throws com.liferay.portal.SystemException {
446         return getPersistence().countByCompanyId(companyId);
447     }
448 
449     public static int countByUserId(long userId)
450         throws com.liferay.portal.SystemException {
451         return getPersistence().countByUserId(userId);
452     }
453 
454     public static int countByC_C(long companyId, long classNameId)
455         throws com.liferay.portal.SystemException {
456         return getPersistence().countByC_C(companyId, classNameId);
457     }
458 
459     public static int countByC_C_C(long companyId, long classNameId,
460         long classPK) throws com.liferay.portal.SystemException {
461         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
462     }
463 
464     public static int countByC_C_C_M(long companyId, long classNameId,
465         long classPK, boolean mailing)
466         throws com.liferay.portal.SystemException {
467         return getPersistence()
468                    .countByC_C_C_M(companyId, classNameId, classPK, mailing);
469     }
470 
471     public static int countByC_C_C_P(long companyId, long classNameId,
472         long classPK, boolean primary)
473         throws com.liferay.portal.SystemException {
474         return getPersistence()
475                    .countByC_C_C_P(companyId, classNameId, classPK, primary);
476     }
477 
478     public static int countAll() throws com.liferay.portal.SystemException {
479         return getPersistence().countAll();
480     }
481 
482     public static AddressPersistence getPersistence() {
483         return _getUtil()._persistence;
484     }
485 
486     public void setPersistence(AddressPersistence persistence) {
487         _persistence = persistence;
488     }
489 
490     private static AddressUtil _getUtil() {
491         if (_util == null) {
492             _util = (AddressUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
493         }
494 
495         return _util;
496     }
497 
498     private static final String _UTIL = AddressUtil.class.getName();
499     private static AddressUtil _util;
500     private AddressPersistence _persistence;
501 }