1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="AddressUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class AddressUtil {
29      public static void cacheResult(com.liferay.portal.model.Address address) {
30          getPersistence().cacheResult(address);
31      }
32  
33      public static void cacheResult(
34          java.util.List<com.liferay.portal.model.Address> addresses) {
35          getPersistence().cacheResult(addresses);
36      }
37  
38      public static void clearCache() {
39          getPersistence().clearCache();
40      }
41  
42      public static com.liferay.portal.model.Address create(long addressId) {
43          return getPersistence().create(addressId);
44      }
45  
46      public static com.liferay.portal.model.Address remove(long addressId)
47          throws com.liferay.portal.NoSuchAddressException,
48              com.liferay.portal.SystemException {
49          return getPersistence().remove(addressId);
50      }
51  
52      public static com.liferay.portal.model.Address remove(
53          com.liferay.portal.model.Address address)
54          throws com.liferay.portal.SystemException {
55          return getPersistence().remove(address);
56      }
57  
58      /**
59       * @deprecated Use <code>update(Address address, boolean merge)</code>.
60       */
61      public static com.liferay.portal.model.Address update(
62          com.liferay.portal.model.Address address)
63          throws com.liferay.portal.SystemException {
64          return getPersistence().update(address);
65      }
66  
67      /**
68       * Add, update, or merge, the entity. This method also calls the model
69       * listeners to trigger the proper events associated with adding, deleting,
70       * or updating an entity.
71       *
72       * @param        address the entity to add, update, or merge
73       * @param        merge boolean value for whether to merge the entity. The
74       *                default value is false. Setting merge to true is more
75       *                expensive and should only be true when address is
76       *                transient. See LEP-5473 for a detailed discussion of this
77       *                method.
78       * @return        true if the portlet can be displayed via Ajax
79       */
80      public static com.liferay.portal.model.Address update(
81          com.liferay.portal.model.Address address, boolean merge)
82          throws com.liferay.portal.SystemException {
83          return getPersistence().update(address, merge);
84      }
85  
86      public static com.liferay.portal.model.Address updateImpl(
87          com.liferay.portal.model.Address address, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().updateImpl(address, merge);
90      }
91  
92      public static com.liferay.portal.model.Address findByPrimaryKey(
93          long addressId)
94          throws com.liferay.portal.NoSuchAddressException,
95              com.liferay.portal.SystemException {
96          return getPersistence().findByPrimaryKey(addressId);
97      }
98  
99      public static com.liferay.portal.model.Address fetchByPrimaryKey(
100         long addressId) throws com.liferay.portal.SystemException {
101         return getPersistence().fetchByPrimaryKey(addressId);
102     }
103 
104     public static java.util.List<com.liferay.portal.model.Address> findByCompanyId(
105         long companyId) throws com.liferay.portal.SystemException {
106         return getPersistence().findByCompanyId(companyId);
107     }
108 
109     public static java.util.List<com.liferay.portal.model.Address> findByCompanyId(
110         long companyId, int start, int end)
111         throws com.liferay.portal.SystemException {
112         return getPersistence().findByCompanyId(companyId, start, end);
113     }
114 
115     public static java.util.List<com.liferay.portal.model.Address> findByCompanyId(
116         long companyId, int start, int end,
117         com.liferay.portal.kernel.util.OrderByComparator obc)
118         throws com.liferay.portal.SystemException {
119         return getPersistence().findByCompanyId(companyId, start, end, obc);
120     }
121 
122     public static com.liferay.portal.model.Address findByCompanyId_First(
123         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
124         throws com.liferay.portal.NoSuchAddressException,
125             com.liferay.portal.SystemException {
126         return getPersistence().findByCompanyId_First(companyId, obc);
127     }
128 
129     public static com.liferay.portal.model.Address findByCompanyId_Last(
130         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
131         throws com.liferay.portal.NoSuchAddressException,
132             com.liferay.portal.SystemException {
133         return getPersistence().findByCompanyId_Last(companyId, obc);
134     }
135 
136     public static com.liferay.portal.model.Address[] findByCompanyId_PrevAndNext(
137         long addressId, long companyId,
138         com.liferay.portal.kernel.util.OrderByComparator obc)
139         throws com.liferay.portal.NoSuchAddressException,
140             com.liferay.portal.SystemException {
141         return getPersistence()
142                    .findByCompanyId_PrevAndNext(addressId, companyId, obc);
143     }
144 
145     public static java.util.List<com.liferay.portal.model.Address> findByUserId(
146         long userId) throws com.liferay.portal.SystemException {
147         return getPersistence().findByUserId(userId);
148     }
149 
150     public static java.util.List<com.liferay.portal.model.Address> findByUserId(
151         long userId, int start, int end)
152         throws com.liferay.portal.SystemException {
153         return getPersistence().findByUserId(userId, start, end);
154     }
155 
156     public static java.util.List<com.liferay.portal.model.Address> findByUserId(
157         long userId, int start, int end,
158         com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.SystemException {
160         return getPersistence().findByUserId(userId, start, end, obc);
161     }
162 
163     public static com.liferay.portal.model.Address findByUserId_First(
164         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.NoSuchAddressException,
166             com.liferay.portal.SystemException {
167         return getPersistence().findByUserId_First(userId, obc);
168     }
169 
170     public static com.liferay.portal.model.Address findByUserId_Last(
171         long userId, com.liferay.portal.kernel.util.OrderByComparator obc)
172         throws com.liferay.portal.NoSuchAddressException,
173             com.liferay.portal.SystemException {
174         return getPersistence().findByUserId_Last(userId, obc);
175     }
176 
177     public static com.liferay.portal.model.Address[] findByUserId_PrevAndNext(
178         long addressId, long userId,
179         com.liferay.portal.kernel.util.OrderByComparator obc)
180         throws com.liferay.portal.NoSuchAddressException,
181             com.liferay.portal.SystemException {
182         return getPersistence().findByUserId_PrevAndNext(addressId, userId, obc);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.Address> findByC_C(
186         long companyId, long classNameId)
187         throws com.liferay.portal.SystemException {
188         return getPersistence().findByC_C(companyId, classNameId);
189     }
190 
191     public static java.util.List<com.liferay.portal.model.Address> findByC_C(
192         long companyId, long classNameId, int start, int end)
193         throws com.liferay.portal.SystemException {
194         return getPersistence().findByC_C(companyId, classNameId, start, end);
195     }
196 
197     public static java.util.List<com.liferay.portal.model.Address> findByC_C(
198         long companyId, long classNameId, int start, int end,
199         com.liferay.portal.kernel.util.OrderByComparator obc)
200         throws com.liferay.portal.SystemException {
201         return getPersistence()
202                    .findByC_C(companyId, classNameId, start, end, obc);
203     }
204 
205     public static com.liferay.portal.model.Address findByC_C_First(
206         long companyId, long classNameId,
207         com.liferay.portal.kernel.util.OrderByComparator obc)
208         throws com.liferay.portal.NoSuchAddressException,
209             com.liferay.portal.SystemException {
210         return getPersistence().findByC_C_First(companyId, classNameId, obc);
211     }
212 
213     public static com.liferay.portal.model.Address findByC_C_Last(
214         long companyId, long classNameId,
215         com.liferay.portal.kernel.util.OrderByComparator obc)
216         throws com.liferay.portal.NoSuchAddressException,
217             com.liferay.portal.SystemException {
218         return getPersistence().findByC_C_Last(companyId, classNameId, obc);
219     }
220 
221     public static com.liferay.portal.model.Address[] findByC_C_PrevAndNext(
222         long addressId, long companyId, long classNameId,
223         com.liferay.portal.kernel.util.OrderByComparator obc)
224         throws com.liferay.portal.NoSuchAddressException,
225             com.liferay.portal.SystemException {
226         return getPersistence()
227                    .findByC_C_PrevAndNext(addressId, companyId, classNameId, obc);
228     }
229 
230     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
231         long companyId, long classNameId, long classPK)
232         throws com.liferay.portal.SystemException {
233         return getPersistence().findByC_C_C(companyId, classNameId, classPK);
234     }
235 
236     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
237         long companyId, long classNameId, long classPK, int start, int end)
238         throws com.liferay.portal.SystemException {
239         return getPersistence()
240                    .findByC_C_C(companyId, classNameId, classPK, start, end);
241     }
242 
243     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
244         long companyId, long classNameId, long classPK, int start, int end,
245         com.liferay.portal.kernel.util.OrderByComparator obc)
246         throws com.liferay.portal.SystemException {
247         return getPersistence()
248                    .findByC_C_C(companyId, classNameId, classPK, start, end, obc);
249     }
250 
251     public static com.liferay.portal.model.Address findByC_C_C_First(
252         long companyId, long classNameId, long classPK,
253         com.liferay.portal.kernel.util.OrderByComparator obc)
254         throws com.liferay.portal.NoSuchAddressException,
255             com.liferay.portal.SystemException {
256         return getPersistence()
257                    .findByC_C_C_First(companyId, classNameId, classPK, obc);
258     }
259 
260     public static com.liferay.portal.model.Address findByC_C_C_Last(
261         long companyId, long classNameId, long classPK,
262         com.liferay.portal.kernel.util.OrderByComparator obc)
263         throws com.liferay.portal.NoSuchAddressException,
264             com.liferay.portal.SystemException {
265         return getPersistence()
266                    .findByC_C_C_Last(companyId, classNameId, classPK, obc);
267     }
268 
269     public static com.liferay.portal.model.Address[] findByC_C_C_PrevAndNext(
270         long addressId, long companyId, long classNameId, long classPK,
271         com.liferay.portal.kernel.util.OrderByComparator obc)
272         throws com.liferay.portal.NoSuchAddressException,
273             com.liferay.portal.SystemException {
274         return getPersistence()
275                    .findByC_C_C_PrevAndNext(addressId, companyId, classNameId,
276             classPK, obc);
277     }
278 
279     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
280         long companyId, long classNameId, long classPK, boolean mailing)
281         throws com.liferay.portal.SystemException {
282         return getPersistence()
283                    .findByC_C_C_M(companyId, classNameId, classPK, mailing);
284     }
285 
286     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
287         long companyId, long classNameId, long classPK, boolean mailing,
288         int start, int end) throws com.liferay.portal.SystemException {
289         return getPersistence()
290                    .findByC_C_C_M(companyId, classNameId, classPK, mailing,
291             start, end);
292     }
293 
294     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
295         long companyId, long classNameId, long classPK, boolean mailing,
296         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
297         throws com.liferay.portal.SystemException {
298         return getPersistence()
299                    .findByC_C_C_M(companyId, classNameId, classPK, mailing,
300             start, end, obc);
301     }
302 
303     public static com.liferay.portal.model.Address findByC_C_C_M_First(
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_First(companyId, classNameId, classPK,
310             mailing, obc);
311     }
312 
313     public static com.liferay.portal.model.Address findByC_C_C_M_Last(
314         long companyId, long classNameId, long classPK, boolean mailing,
315         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_Last(companyId, classNameId, classPK,
320             mailing, obc);
321     }
322 
323     public static com.liferay.portal.model.Address[] findByC_C_C_M_PrevAndNext(
324         long addressId, long companyId, long classNameId, long classPK,
325         boolean mailing, com.liferay.portal.kernel.util.OrderByComparator obc)
326         throws com.liferay.portal.NoSuchAddressException,
327             com.liferay.portal.SystemException {
328         return getPersistence()
329                    .findByC_C_C_M_PrevAndNext(addressId, companyId,
330             classNameId, classPK, mailing, obc);
331     }
332 
333     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
334         long companyId, long classNameId, long classPK, boolean primary)
335         throws com.liferay.portal.SystemException {
336         return getPersistence()
337                    .findByC_C_C_P(companyId, classNameId, classPK, primary);
338     }
339 
340     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
341         long companyId, long classNameId, long classPK, boolean primary,
342         int start, int end) throws com.liferay.portal.SystemException {
343         return getPersistence()
344                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
345             start, end);
346     }
347 
348     public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
349         long companyId, long classNameId, long classPK, boolean primary,
350         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
351         throws com.liferay.portal.SystemException {
352         return getPersistence()
353                    .findByC_C_C_P(companyId, classNameId, classPK, primary,
354             start, end, obc);
355     }
356 
357     public static com.liferay.portal.model.Address findByC_C_C_P_First(
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_First(companyId, classNameId, classPK,
364             primary, obc);
365     }
366 
367     public static com.liferay.portal.model.Address findByC_C_C_P_Last(
368         long companyId, long classNameId, long classPK, boolean primary,
369         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_Last(companyId, classNameId, classPK,
374             primary, obc);
375     }
376 
377     public static com.liferay.portal.model.Address[] findByC_C_C_P_PrevAndNext(
378         long addressId, long companyId, long classNameId, long classPK,
379         boolean primary, com.liferay.portal.kernel.util.OrderByComparator obc)
380         throws com.liferay.portal.NoSuchAddressException,
381             com.liferay.portal.SystemException {
382         return getPersistence()
383                    .findByC_C_C_P_PrevAndNext(addressId, companyId,
384             classNameId, classPK, primary, obc);
385     }
386 
387     public static java.util.List<Object> findWithDynamicQuery(
388         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
389         throws com.liferay.portal.SystemException {
390         return getPersistence().findWithDynamicQuery(dynamicQuery);
391     }
392 
393     public static java.util.List<Object> findWithDynamicQuery(
394         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
395         int end) throws com.liferay.portal.SystemException {
396         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
397     }
398 
399     public static java.util.List<com.liferay.portal.model.Address> findAll()
400         throws com.liferay.portal.SystemException {
401         return getPersistence().findAll();
402     }
403 
404     public static java.util.List<com.liferay.portal.model.Address> findAll(
405         int start, int end) throws com.liferay.portal.SystemException {
406         return getPersistence().findAll(start, end);
407     }
408 
409     public static java.util.List<com.liferay.portal.model.Address> findAll(
410         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
411         throws com.liferay.portal.SystemException {
412         return getPersistence().findAll(start, end, obc);
413     }
414 
415     public static void removeByCompanyId(long companyId)
416         throws com.liferay.portal.SystemException {
417         getPersistence().removeByCompanyId(companyId);
418     }
419 
420     public static void removeByUserId(long userId)
421         throws com.liferay.portal.SystemException {
422         getPersistence().removeByUserId(userId);
423     }
424 
425     public static void removeByC_C(long companyId, long classNameId)
426         throws com.liferay.portal.SystemException {
427         getPersistence().removeByC_C(companyId, classNameId);
428     }
429 
430     public static void removeByC_C_C(long companyId, long classNameId,
431         long classPK) throws com.liferay.portal.SystemException {
432         getPersistence().removeByC_C_C(companyId, classNameId, classPK);
433     }
434 
435     public static void removeByC_C_C_M(long companyId, long classNameId,
436         long classPK, boolean mailing)
437         throws com.liferay.portal.SystemException {
438         getPersistence()
439             .removeByC_C_C_M(companyId, classNameId, classPK, mailing);
440     }
441 
442     public static void removeByC_C_C_P(long companyId, long classNameId,
443         long classPK, boolean primary)
444         throws com.liferay.portal.SystemException {
445         getPersistence()
446             .removeByC_C_C_P(companyId, classNameId, classPK, primary);
447     }
448 
449     public static void removeAll() throws com.liferay.portal.SystemException {
450         getPersistence().removeAll();
451     }
452 
453     public static int countByCompanyId(long companyId)
454         throws com.liferay.portal.SystemException {
455         return getPersistence().countByCompanyId(companyId);
456     }
457 
458     public static int countByUserId(long userId)
459         throws com.liferay.portal.SystemException {
460         return getPersistence().countByUserId(userId);
461     }
462 
463     public static int countByC_C(long companyId, long classNameId)
464         throws com.liferay.portal.SystemException {
465         return getPersistence().countByC_C(companyId, classNameId);
466     }
467 
468     public static int countByC_C_C(long companyId, long classNameId,
469         long classPK) throws com.liferay.portal.SystemException {
470         return getPersistence().countByC_C_C(companyId, classNameId, classPK);
471     }
472 
473     public static int countByC_C_C_M(long companyId, long classNameId,
474         long classPK, boolean mailing)
475         throws com.liferay.portal.SystemException {
476         return getPersistence()
477                    .countByC_C_C_M(companyId, classNameId, classPK, mailing);
478     }
479 
480     public static int countByC_C_C_P(long companyId, long classNameId,
481         long classPK, boolean primary)
482         throws com.liferay.portal.SystemException {
483         return getPersistence()
484                    .countByC_C_C_P(companyId, classNameId, classPK, primary);
485     }
486 
487     public static int countAll() throws com.liferay.portal.SystemException {
488         return getPersistence().countAll();
489     }
490 
491     public static AddressPersistence getPersistence() {
492         return _persistence;
493     }
494 
495     public void setPersistence(AddressPersistence persistence) {
496         _persistence = persistence;
497     }
498 
499     private static AddressPersistence _persistence;
500 }