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