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