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="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.NoSuchAddressException,
38              com.liferay.portal.SystemException {
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.NoSuchAddressException,
85              com.liferay.portal.SystemException {
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 start, int end)
101         throws com.liferay.portal.SystemException {
102         return getPersistence().findByCompanyId(companyId, start, end);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.Address> findByCompanyId(
106         long companyId, int start, int end,
107         com.liferay.portal.kernel.util.OrderByComparator obc)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findByCompanyId(companyId, start, 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.NoSuchAddressException,
115             com.liferay.portal.SystemException {
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.NoSuchAddressException,
122             com.liferay.portal.SystemException {
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.NoSuchAddressException,
130             com.liferay.portal.SystemException {
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 start, int end)
142         throws com.liferay.portal.SystemException {
143         return getPersistence().findByUserId(userId, start, end);
144     }
145 
146     public static java.util.List<com.liferay.portal.model.Address> findByUserId(
147         long userId, int start, int end,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.SystemException {
150         return getPersistence().findByUserId(userId, start, 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.NoSuchAddressException,
156             com.liferay.portal.SystemException {
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.NoSuchAddressException,
163             com.liferay.portal.SystemException {
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.NoSuchAddressException,
171             com.liferay.portal.SystemException {
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 start, int end)
183         throws com.liferay.portal.SystemException {
184         return getPersistence().findByC_C(companyId, classNameId, start, end);
185     }
186 
187     public static java.util.List<com.liferay.portal.model.Address> findByC_C(
188         long companyId, long classNameId, int start, int end,
189         com.liferay.portal.kernel.util.OrderByComparator obc)
190         throws com.liferay.portal.SystemException {
191         return getPersistence()
192                    .findByC_C(companyId, classNameId, start, 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.NoSuchAddressException,
199             com.liferay.portal.SystemException {
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.NoSuchAddressException,
207             com.liferay.portal.SystemException {
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.NoSuchAddressException,
215             com.liferay.portal.SystemException {
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 start, int end)
228         throws com.liferay.portal.SystemException {
229         return getPersistence()
230                    .findByC_C_C(companyId, classNameId, classPK, start, 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 start, 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, start, 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.NoSuchAddressException,
245             com.liferay.portal.SystemException {
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.NoSuchAddressException,
254             com.liferay.portal.SystemException {
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.NoSuchAddressException,
263             com.liferay.portal.SystemException {
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 start, int end) throws com.liferay.portal.SystemException {
279         return getPersistence()
280                    .findByC_C_C_M(companyId, classNameId, classPK, mailing,
281             start, 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 start, 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             start, 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.NoSuchAddressException,
297             com.liferay.portal.SystemException {
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.NoSuchAddressException,
307             com.liferay.portal.SystemException {
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.NoSuchAddressException,
317             com.liferay.portal.SystemException {
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 start, int end) throws com.liferay.portal.SystemException {
333         return getPersistence()
334                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
335             start, 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 start, 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             start, 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.NoSuchAddressException,
351             com.liferay.portal.SystemException {
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.NoSuchAddressException,
361             com.liferay.portal.SystemException {
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.NoSuchAddressException,
371             com.liferay.portal.SystemException {
372         return getPersistence()
373                    .findByC_C_C_P_PrevAndNext(addressId, companyId,
374             classNameId, classPK, primary, obc);
375     }
376 
377     public static java.util.List<Object> findWithDynamicQuery(
378         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
379         throws com.liferay.portal.SystemException {
380         return getPersistence().findWithDynamicQuery(dynamicQuery);
381     }
382 
383     public static java.util.List<Object> findWithDynamicQuery(
384         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
385         int end) throws com.liferay.portal.SystemException {
386         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
387     }
388 
389     public static java.util.List<com.liferay.portal.model.Address> findAll()
390         throws com.liferay.portal.SystemException {
391         return getPersistence().findAll();
392     }
393 
394     public static java.util.List<com.liferay.portal.model.Address> findAll(
395         int start, int end) throws com.liferay.portal.SystemException {
396         return getPersistence().findAll(start, end);
397     }
398 
399     public static java.util.List<com.liferay.portal.model.Address> findAll(
400         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
401         throws com.liferay.portal.SystemException {
402         return getPersistence().findAll(start, end, obc);
403     }
404 
405     public static void removeByCompanyId(long companyId)
406         throws com.liferay.portal.SystemException {
407         getPersistence().removeByCompanyId(companyId);
408     }
409 
410     public static void removeByUserId(long userId)
411         throws com.liferay.portal.SystemException {
412         getPersistence().removeByUserId(userId);
413     }
414 
415     public static void removeByC_C(long companyId, long classNameId)
416         throws com.liferay.portal.SystemException {
417         getPersistence().removeByC_C(companyId, classNameId);
418     }
419 
420     public static void removeByC_C_C(long companyId, long classNameId,
421         long classPK) throws com.liferay.portal.SystemException {
422         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
423     }
424 
425     public static void removeByC_C_C_M(long companyId, long classNameId,
426         long classPK, boolean mailing)
427         throws com.liferay.portal.SystemException {
428         getPersistence()
429             .removeByC_C_C_M(companyId, classNameId, classPK, mailing);
430     }
431 
432     public static void removeByC_C_C_P(long companyId, long classNameId,
433         long classPK, boolean primary)
434         throws com.liferay.portal.SystemException {
435         getPersistence()
436             .removeByC_C_C_P(companyId, classNameId, classPK, primary);
437     }
438 
439     public static void removeAll() throws com.liferay.portal.SystemException {
440         getPersistence().removeAll();
441     }
442 
443     public static int countByCompanyId(long companyId)
444         throws com.liferay.portal.SystemException {
445         return getPersistence().countByCompanyId(companyId);
446     }
447 
448     public static int countByUserId(long userId)
449         throws com.liferay.portal.SystemException {
450         return getPersistence().countByUserId(userId);
451     }
452 
453     public static int countByC_C(long companyId, long classNameId)
454         throws com.liferay.portal.SystemException {
455         return getPersistence().countByC_C(companyId, classNameId);
456     }
457 
458     public static int countByC_C_C(long companyId, long classNameId,
459         long classPK) throws com.liferay.portal.SystemException {
460         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
461     }
462 
463     public static int countByC_C_C_M(long companyId, long classNameId,
464         long classPK, boolean mailing)
465         throws com.liferay.portal.SystemException {
466         return getPersistence()
467                    .countByC_C_C_M(companyId, classNameId, classPK, mailing);
468     }
469 
470     public static int countByC_C_C_P(long companyId, long classNameId,
471         long classPK, boolean primary)
472         throws com.liferay.portal.SystemException {
473         return getPersistence()
474                    .countByC_C_C_P(companyId, classNameId, classPK, primary);
475     }
476 
477     public static int countAll() throws com.liferay.portal.SystemException {
478         return getPersistence().countAll();
479     }
480 
481     public static AddressPersistence getPersistence() {
482         return _persistence;
483     }
484 
485     public void setPersistence(AddressPersistence persistence) {
486         _persistence = persistence;
487     }
488 
489     private static AddressPersistence _persistence;
490 }