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