001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.EmailAddress;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the email address service. This utility wraps {@link EmailAddressPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see EmailAddressPersistence
036     * @see EmailAddressPersistenceImpl
037     * @generated
038     */
039    public class EmailAddressUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(EmailAddress emailAddress) {
057                    getPersistence().clearCache(emailAddress);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<EmailAddress> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<EmailAddress> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<EmailAddress> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
098             */
099            public static EmailAddress remove(EmailAddress emailAddress)
100                    throws SystemException {
101                    return getPersistence().remove(emailAddress);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
106             */
107            public static EmailAddress update(EmailAddress emailAddress, boolean merge)
108                    throws SystemException {
109                    return getPersistence().update(emailAddress, merge);
110            }
111    
112            /**
113             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
114             */
115            public static EmailAddress update(EmailAddress emailAddress, boolean merge,
116                    ServiceContext serviceContext) throws SystemException {
117                    return getPersistence().update(emailAddress, merge, serviceContext);
118            }
119    
120            /**
121            * Caches the email address in the entity cache if it is enabled.
122            *
123            * @param emailAddress the email address
124            */
125            public static void cacheResult(
126                    com.liferay.portal.model.EmailAddress emailAddress) {
127                    getPersistence().cacheResult(emailAddress);
128            }
129    
130            /**
131            * Caches the email addresses in the entity cache if it is enabled.
132            *
133            * @param emailAddresses the email addresses
134            */
135            public static void cacheResult(
136                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses) {
137                    getPersistence().cacheResult(emailAddresses);
138            }
139    
140            /**
141            * Creates a new email address with the primary key. Does not add the email address to the database.
142            *
143            * @param emailAddressId the primary key for the new email address
144            * @return the new email address
145            */
146            public static com.liferay.portal.model.EmailAddress create(
147                    long emailAddressId) {
148                    return getPersistence().create(emailAddressId);
149            }
150    
151            /**
152            * Removes the email address with the primary key from the database. Also notifies the appropriate model listeners.
153            *
154            * @param emailAddressId the primary key of the email address
155            * @return the email address that was removed
156            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
157            * @throws SystemException if a system exception occurred
158            */
159            public static com.liferay.portal.model.EmailAddress remove(
160                    long emailAddressId)
161                    throws com.liferay.portal.NoSuchEmailAddressException,
162                            com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence().remove(emailAddressId);
164            }
165    
166            public static com.liferay.portal.model.EmailAddress updateImpl(
167                    com.liferay.portal.model.EmailAddress emailAddress, boolean merge)
168                    throws com.liferay.portal.kernel.exception.SystemException {
169                    return getPersistence().updateImpl(emailAddress, merge);
170            }
171    
172            /**
173            * Returns the email address with the primary key or throws a {@link com.liferay.portal.NoSuchEmailAddressException} if it could not be found.
174            *
175            * @param emailAddressId the primary key of the email address
176            * @return the email address
177            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
178            * @throws SystemException if a system exception occurred
179            */
180            public static com.liferay.portal.model.EmailAddress findByPrimaryKey(
181                    long emailAddressId)
182                    throws com.liferay.portal.NoSuchEmailAddressException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getPersistence().findByPrimaryKey(emailAddressId);
185            }
186    
187            /**
188            * Returns the email address with the primary key or returns <code>null</code> if it could not be found.
189            *
190            * @param emailAddressId the primary key of the email address
191            * @return the email address, or <code>null</code> if a email address with the primary key could not be found
192            * @throws SystemException if a system exception occurred
193            */
194            public static com.liferay.portal.model.EmailAddress fetchByPrimaryKey(
195                    long emailAddressId)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getPersistence().fetchByPrimaryKey(emailAddressId);
198            }
199    
200            /**
201            * Returns all the email addresses where companyId = &#63;.
202            *
203            * @param companyId the company ID
204            * @return the matching email addresses
205            * @throws SystemException if a system exception occurred
206            */
207            public static java.util.List<com.liferay.portal.model.EmailAddress> findByCompanyId(
208                    long companyId)
209                    throws com.liferay.portal.kernel.exception.SystemException {
210                    return getPersistence().findByCompanyId(companyId);
211            }
212    
213            /**
214            * Returns a range of all the email addresses where companyId = &#63;.
215            *
216            * <p>
217            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
218            * </p>
219            *
220            * @param companyId the company ID
221            * @param start the lower bound of the range of email addresses
222            * @param end the upper bound of the range of email addresses (not inclusive)
223            * @return the range of matching email addresses
224            * @throws SystemException if a system exception occurred
225            */
226            public static java.util.List<com.liferay.portal.model.EmailAddress> findByCompanyId(
227                    long companyId, int start, int end)
228                    throws com.liferay.portal.kernel.exception.SystemException {
229                    return getPersistence().findByCompanyId(companyId, start, end);
230            }
231    
232            /**
233            * Returns an ordered range of all the email addresses where companyId = &#63;.
234            *
235            * <p>
236            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
237            * </p>
238            *
239            * @param companyId the company ID
240            * @param start the lower bound of the range of email addresses
241            * @param end the upper bound of the range of email addresses (not inclusive)
242            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
243            * @return the ordered range of matching email addresses
244            * @throws SystemException if a system exception occurred
245            */
246            public static java.util.List<com.liferay.portal.model.EmailAddress> findByCompanyId(
247                    long companyId, int start, int end,
248                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
249                    throws com.liferay.portal.kernel.exception.SystemException {
250                    return getPersistence()
251                                       .findByCompanyId(companyId, start, end, orderByComparator);
252            }
253    
254            /**
255            * Returns the first email address in the ordered set where companyId = &#63;.
256            *
257            * <p>
258            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
259            * </p>
260            *
261            * @param companyId the company ID
262            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
263            * @return the first matching email address
264            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
265            * @throws SystemException if a system exception occurred
266            */
267            public static com.liferay.portal.model.EmailAddress findByCompanyId_First(
268                    long companyId,
269                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
270                    throws com.liferay.portal.NoSuchEmailAddressException,
271                            com.liferay.portal.kernel.exception.SystemException {
272                    return getPersistence()
273                                       .findByCompanyId_First(companyId, orderByComparator);
274            }
275    
276            /**
277            * Returns the last email address in the ordered set where companyId = &#63;.
278            *
279            * <p>
280            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
281            * </p>
282            *
283            * @param companyId the company ID
284            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
285            * @return the last matching email address
286            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
287            * @throws SystemException if a system exception occurred
288            */
289            public static com.liferay.portal.model.EmailAddress findByCompanyId_Last(
290                    long companyId,
291                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
292                    throws com.liferay.portal.NoSuchEmailAddressException,
293                            com.liferay.portal.kernel.exception.SystemException {
294                    return getPersistence()
295                                       .findByCompanyId_Last(companyId, orderByComparator);
296            }
297    
298            /**
299            * Returns the email addresses before and after the current email address in the ordered set where companyId = &#63;.
300            *
301            * <p>
302            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
303            * </p>
304            *
305            * @param emailAddressId the primary key of the current email address
306            * @param companyId the company ID
307            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
308            * @return the previous, current, and next email address
309            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
310            * @throws SystemException if a system exception occurred
311            */
312            public static com.liferay.portal.model.EmailAddress[] findByCompanyId_PrevAndNext(
313                    long emailAddressId, long companyId,
314                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
315                    throws com.liferay.portal.NoSuchEmailAddressException,
316                            com.liferay.portal.kernel.exception.SystemException {
317                    return getPersistence()
318                                       .findByCompanyId_PrevAndNext(emailAddressId, companyId,
319                            orderByComparator);
320            }
321    
322            /**
323            * Returns all the email addresses where userId = &#63;.
324            *
325            * @param userId the user ID
326            * @return the matching email addresses
327            * @throws SystemException if a system exception occurred
328            */
329            public static java.util.List<com.liferay.portal.model.EmailAddress> findByUserId(
330                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
331                    return getPersistence().findByUserId(userId);
332            }
333    
334            /**
335            * Returns a range of all the email addresses where userId = &#63;.
336            *
337            * <p>
338            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
339            * </p>
340            *
341            * @param userId the user ID
342            * @param start the lower bound of the range of email addresses
343            * @param end the upper bound of the range of email addresses (not inclusive)
344            * @return the range of matching email addresses
345            * @throws SystemException if a system exception occurred
346            */
347            public static java.util.List<com.liferay.portal.model.EmailAddress> findByUserId(
348                    long userId, int start, int end)
349                    throws com.liferay.portal.kernel.exception.SystemException {
350                    return getPersistence().findByUserId(userId, start, end);
351            }
352    
353            /**
354            * Returns an ordered range of all the email addresses where userId = &#63;.
355            *
356            * <p>
357            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
358            * </p>
359            *
360            * @param userId the user ID
361            * @param start the lower bound of the range of email addresses
362            * @param end the upper bound of the range of email addresses (not inclusive)
363            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
364            * @return the ordered range of matching email addresses
365            * @throws SystemException if a system exception occurred
366            */
367            public static java.util.List<com.liferay.portal.model.EmailAddress> findByUserId(
368                    long userId, int start, int end,
369                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
370                    throws com.liferay.portal.kernel.exception.SystemException {
371                    return getPersistence()
372                                       .findByUserId(userId, start, end, orderByComparator);
373            }
374    
375            /**
376            * Returns the first email address in the ordered set where userId = &#63;.
377            *
378            * <p>
379            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
380            * </p>
381            *
382            * @param userId the user ID
383            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
384            * @return the first matching email address
385            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
386            * @throws SystemException if a system exception occurred
387            */
388            public static com.liferay.portal.model.EmailAddress findByUserId_First(
389                    long userId,
390                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
391                    throws com.liferay.portal.NoSuchEmailAddressException,
392                            com.liferay.portal.kernel.exception.SystemException {
393                    return getPersistence().findByUserId_First(userId, orderByComparator);
394            }
395    
396            /**
397            * Returns the last email address in the ordered set where userId = &#63;.
398            *
399            * <p>
400            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
401            * </p>
402            *
403            * @param userId the user ID
404            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
405            * @return the last matching email address
406            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
407            * @throws SystemException if a system exception occurred
408            */
409            public static com.liferay.portal.model.EmailAddress findByUserId_Last(
410                    long userId,
411                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
412                    throws com.liferay.portal.NoSuchEmailAddressException,
413                            com.liferay.portal.kernel.exception.SystemException {
414                    return getPersistence().findByUserId_Last(userId, orderByComparator);
415            }
416    
417            /**
418            * Returns the email addresses before and after the current email address in the ordered set where userId = &#63;.
419            *
420            * <p>
421            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
422            * </p>
423            *
424            * @param emailAddressId the primary key of the current email address
425            * @param userId the user ID
426            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
427            * @return the previous, current, and next email address
428            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
429            * @throws SystemException if a system exception occurred
430            */
431            public static com.liferay.portal.model.EmailAddress[] findByUserId_PrevAndNext(
432                    long emailAddressId, long userId,
433                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
434                    throws com.liferay.portal.NoSuchEmailAddressException,
435                            com.liferay.portal.kernel.exception.SystemException {
436                    return getPersistence()
437                                       .findByUserId_PrevAndNext(emailAddressId, userId,
438                            orderByComparator);
439            }
440    
441            /**
442            * Returns all the email addresses where companyId = &#63; and classNameId = &#63;.
443            *
444            * @param companyId the company ID
445            * @param classNameId the class name ID
446            * @return the matching email addresses
447            * @throws SystemException if a system exception occurred
448            */
449            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C(
450                    long companyId, long classNameId)
451                    throws com.liferay.portal.kernel.exception.SystemException {
452                    return getPersistence().findByC_C(companyId, classNameId);
453            }
454    
455            /**
456            * Returns a range of all the email addresses where companyId = &#63; and classNameId = &#63;.
457            *
458            * <p>
459            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
460            * </p>
461            *
462            * @param companyId the company ID
463            * @param classNameId the class name ID
464            * @param start the lower bound of the range of email addresses
465            * @param end the upper bound of the range of email addresses (not inclusive)
466            * @return the range of matching email addresses
467            * @throws SystemException if a system exception occurred
468            */
469            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C(
470                    long companyId, long classNameId, int start, int end)
471                    throws com.liferay.portal.kernel.exception.SystemException {
472                    return getPersistence().findByC_C(companyId, classNameId, start, end);
473            }
474    
475            /**
476            * Returns an ordered range of all the email addresses where companyId = &#63; and classNameId = &#63;.
477            *
478            * <p>
479            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
480            * </p>
481            *
482            * @param companyId the company ID
483            * @param classNameId the class name ID
484            * @param start the lower bound of the range of email addresses
485            * @param end the upper bound of the range of email addresses (not inclusive)
486            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
487            * @return the ordered range of matching email addresses
488            * @throws SystemException if a system exception occurred
489            */
490            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C(
491                    long companyId, long classNameId, int start, int end,
492                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
493                    throws com.liferay.portal.kernel.exception.SystemException {
494                    return getPersistence()
495                                       .findByC_C(companyId, classNameId, start, end,
496                            orderByComparator);
497            }
498    
499            /**
500            * Returns the first email address in the ordered set where companyId = &#63; and classNameId = &#63;.
501            *
502            * <p>
503            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
504            * </p>
505            *
506            * @param companyId the company ID
507            * @param classNameId the class name ID
508            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
509            * @return the first matching email address
510            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
511            * @throws SystemException if a system exception occurred
512            */
513            public static com.liferay.portal.model.EmailAddress findByC_C_First(
514                    long companyId, long classNameId,
515                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
516                    throws com.liferay.portal.NoSuchEmailAddressException,
517                            com.liferay.portal.kernel.exception.SystemException {
518                    return getPersistence()
519                                       .findByC_C_First(companyId, classNameId, orderByComparator);
520            }
521    
522            /**
523            * Returns the last email address in the ordered set where companyId = &#63; and classNameId = &#63;.
524            *
525            * <p>
526            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
527            * </p>
528            *
529            * @param companyId the company ID
530            * @param classNameId the class name ID
531            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
532            * @return the last matching email address
533            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
534            * @throws SystemException if a system exception occurred
535            */
536            public static com.liferay.portal.model.EmailAddress findByC_C_Last(
537                    long companyId, long classNameId,
538                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
539                    throws com.liferay.portal.NoSuchEmailAddressException,
540                            com.liferay.portal.kernel.exception.SystemException {
541                    return getPersistence()
542                                       .findByC_C_Last(companyId, classNameId, orderByComparator);
543            }
544    
545            /**
546            * Returns the email addresses before and after the current email address in the ordered set where companyId = &#63; and classNameId = &#63;.
547            *
548            * <p>
549            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
550            * </p>
551            *
552            * @param emailAddressId the primary key of the current email address
553            * @param companyId the company ID
554            * @param classNameId the class name ID
555            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
556            * @return the previous, current, and next email address
557            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
558            * @throws SystemException if a system exception occurred
559            */
560            public static com.liferay.portal.model.EmailAddress[] findByC_C_PrevAndNext(
561                    long emailAddressId, long companyId, long classNameId,
562                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
563                    throws com.liferay.portal.NoSuchEmailAddressException,
564                            com.liferay.portal.kernel.exception.SystemException {
565                    return getPersistence()
566                                       .findByC_C_PrevAndNext(emailAddressId, companyId,
567                            classNameId, orderByComparator);
568            }
569    
570            /**
571            * Returns all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
572            *
573            * @param companyId the company ID
574            * @param classNameId the class name ID
575            * @param classPK the class p k
576            * @return the matching email addresses
577            * @throws SystemException if a system exception occurred
578            */
579            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C(
580                    long companyId, long classNameId, long classPK)
581                    throws com.liferay.portal.kernel.exception.SystemException {
582                    return getPersistence().findByC_C_C(companyId, classNameId, classPK);
583            }
584    
585            /**
586            * Returns a range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
587            *
588            * <p>
589            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
590            * </p>
591            *
592            * @param companyId the company ID
593            * @param classNameId the class name ID
594            * @param classPK the class p k
595            * @param start the lower bound of the range of email addresses
596            * @param end the upper bound of the range of email addresses (not inclusive)
597            * @return the range of matching email addresses
598            * @throws SystemException if a system exception occurred
599            */
600            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C(
601                    long companyId, long classNameId, long classPK, int start, int end)
602                    throws com.liferay.portal.kernel.exception.SystemException {
603                    return getPersistence()
604                                       .findByC_C_C(companyId, classNameId, classPK, start, end);
605            }
606    
607            /**
608            * Returns an ordered range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
609            *
610            * <p>
611            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
612            * </p>
613            *
614            * @param companyId the company ID
615            * @param classNameId the class name ID
616            * @param classPK the class p k
617            * @param start the lower bound of the range of email addresses
618            * @param end the upper bound of the range of email addresses (not inclusive)
619            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
620            * @return the ordered range of matching email addresses
621            * @throws SystemException if a system exception occurred
622            */
623            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C(
624                    long companyId, long classNameId, long classPK, int start, int end,
625                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
626                    throws com.liferay.portal.kernel.exception.SystemException {
627                    return getPersistence()
628                                       .findByC_C_C(companyId, classNameId, classPK, start, end,
629                            orderByComparator);
630            }
631    
632            /**
633            * Returns the first email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
634            *
635            * <p>
636            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
637            * </p>
638            *
639            * @param companyId the company ID
640            * @param classNameId the class name ID
641            * @param classPK the class p k
642            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
643            * @return the first matching email address
644            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
645            * @throws SystemException if a system exception occurred
646            */
647            public static com.liferay.portal.model.EmailAddress findByC_C_C_First(
648                    long companyId, long classNameId, long classPK,
649                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
650                    throws com.liferay.portal.NoSuchEmailAddressException,
651                            com.liferay.portal.kernel.exception.SystemException {
652                    return getPersistence()
653                                       .findByC_C_C_First(companyId, classNameId, classPK,
654                            orderByComparator);
655            }
656    
657            /**
658            * Returns the last email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
659            *
660            * <p>
661            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
662            * </p>
663            *
664            * @param companyId the company ID
665            * @param classNameId the class name ID
666            * @param classPK the class p k
667            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
668            * @return the last matching email address
669            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
670            * @throws SystemException if a system exception occurred
671            */
672            public static com.liferay.portal.model.EmailAddress findByC_C_C_Last(
673                    long companyId, long classNameId, long classPK,
674                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
675                    throws com.liferay.portal.NoSuchEmailAddressException,
676                            com.liferay.portal.kernel.exception.SystemException {
677                    return getPersistence()
678                                       .findByC_C_C_Last(companyId, classNameId, classPK,
679                            orderByComparator);
680            }
681    
682            /**
683            * Returns the email addresses before and after the current email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
684            *
685            * <p>
686            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
687            * </p>
688            *
689            * @param emailAddressId the primary key of the current email address
690            * @param companyId the company ID
691            * @param classNameId the class name ID
692            * @param classPK the class p k
693            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
694            * @return the previous, current, and next email address
695            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
696            * @throws SystemException if a system exception occurred
697            */
698            public static com.liferay.portal.model.EmailAddress[] findByC_C_C_PrevAndNext(
699                    long emailAddressId, long companyId, long classNameId, long classPK,
700                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
701                    throws com.liferay.portal.NoSuchEmailAddressException,
702                            com.liferay.portal.kernel.exception.SystemException {
703                    return getPersistence()
704                                       .findByC_C_C_PrevAndNext(emailAddressId, companyId,
705                            classNameId, classPK, orderByComparator);
706            }
707    
708            /**
709            * Returns all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
710            *
711            * @param companyId the company ID
712            * @param classNameId the class name ID
713            * @param classPK the class p k
714            * @param primary the primary
715            * @return the matching email addresses
716            * @throws SystemException if a system exception occurred
717            */
718            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C_P(
719                    long companyId, long classNameId, long classPK, boolean primary)
720                    throws com.liferay.portal.kernel.exception.SystemException {
721                    return getPersistence()
722                                       .findByC_C_C_P(companyId, classNameId, classPK, primary);
723            }
724    
725            /**
726            * Returns a range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
727            *
728            * <p>
729            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
730            * </p>
731            *
732            * @param companyId the company ID
733            * @param classNameId the class name ID
734            * @param classPK the class p k
735            * @param primary the primary
736            * @param start the lower bound of the range of email addresses
737            * @param end the upper bound of the range of email addresses (not inclusive)
738            * @return the range of matching email addresses
739            * @throws SystemException if a system exception occurred
740            */
741            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C_P(
742                    long companyId, long classNameId, long classPK, boolean primary,
743                    int start, int end)
744                    throws com.liferay.portal.kernel.exception.SystemException {
745                    return getPersistence()
746                                       .findByC_C_C_P(companyId, classNameId, classPK, primary,
747                            start, end);
748            }
749    
750            /**
751            * Returns an ordered range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
752            *
753            * <p>
754            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
755            * </p>
756            *
757            * @param companyId the company ID
758            * @param classNameId the class name ID
759            * @param classPK the class p k
760            * @param primary the primary
761            * @param start the lower bound of the range of email addresses
762            * @param end the upper bound of the range of email addresses (not inclusive)
763            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
764            * @return the ordered range of matching email addresses
765            * @throws SystemException if a system exception occurred
766            */
767            public static java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C_P(
768                    long companyId, long classNameId, long classPK, boolean primary,
769                    int start, int end,
770                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
771                    throws com.liferay.portal.kernel.exception.SystemException {
772                    return getPersistence()
773                                       .findByC_C_C_P(companyId, classNameId, classPK, primary,
774                            start, end, orderByComparator);
775            }
776    
777            /**
778            * Returns the first email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
779            *
780            * <p>
781            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
782            * </p>
783            *
784            * @param companyId the company ID
785            * @param classNameId the class name ID
786            * @param classPK the class p k
787            * @param primary the primary
788            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
789            * @return the first matching email address
790            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
791            * @throws SystemException if a system exception occurred
792            */
793            public static com.liferay.portal.model.EmailAddress findByC_C_C_P_First(
794                    long companyId, long classNameId, long classPK, boolean primary,
795                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
796                    throws com.liferay.portal.NoSuchEmailAddressException,
797                            com.liferay.portal.kernel.exception.SystemException {
798                    return getPersistence()
799                                       .findByC_C_C_P_First(companyId, classNameId, classPK,
800                            primary, orderByComparator);
801            }
802    
803            /**
804            * Returns the last email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
805            *
806            * <p>
807            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
808            * </p>
809            *
810            * @param companyId the company ID
811            * @param classNameId the class name ID
812            * @param classPK the class p k
813            * @param primary the primary
814            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
815            * @return the last matching email address
816            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
817            * @throws SystemException if a system exception occurred
818            */
819            public static com.liferay.portal.model.EmailAddress findByC_C_C_P_Last(
820                    long companyId, long classNameId, long classPK, boolean primary,
821                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
822                    throws com.liferay.portal.NoSuchEmailAddressException,
823                            com.liferay.portal.kernel.exception.SystemException {
824                    return getPersistence()
825                                       .findByC_C_C_P_Last(companyId, classNameId, classPK,
826                            primary, orderByComparator);
827            }
828    
829            /**
830            * Returns the email addresses before and after the current email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
831            *
832            * <p>
833            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
834            * </p>
835            *
836            * @param emailAddressId the primary key of the current email address
837            * @param companyId the company ID
838            * @param classNameId the class name ID
839            * @param classPK the class p k
840            * @param primary the primary
841            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
842            * @return the previous, current, and next email address
843            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
844            * @throws SystemException if a system exception occurred
845            */
846            public static com.liferay.portal.model.EmailAddress[] findByC_C_C_P_PrevAndNext(
847                    long emailAddressId, long companyId, long classNameId, long classPK,
848                    boolean primary,
849                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
850                    throws com.liferay.portal.NoSuchEmailAddressException,
851                            com.liferay.portal.kernel.exception.SystemException {
852                    return getPersistence()
853                                       .findByC_C_C_P_PrevAndNext(emailAddressId, companyId,
854                            classNameId, classPK, primary, orderByComparator);
855            }
856    
857            /**
858            * Returns all the email addresses.
859            *
860            * @return the email addresses
861            * @throws SystemException if a system exception occurred
862            */
863            public static java.util.List<com.liferay.portal.model.EmailAddress> findAll()
864                    throws com.liferay.portal.kernel.exception.SystemException {
865                    return getPersistence().findAll();
866            }
867    
868            /**
869            * Returns a range of all the email addresses.
870            *
871            * <p>
872            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
873            * </p>
874            *
875            * @param start the lower bound of the range of email addresses
876            * @param end the upper bound of the range of email addresses (not inclusive)
877            * @return the range of email addresses
878            * @throws SystemException if a system exception occurred
879            */
880            public static java.util.List<com.liferay.portal.model.EmailAddress> findAll(
881                    int start, int end)
882                    throws com.liferay.portal.kernel.exception.SystemException {
883                    return getPersistence().findAll(start, end);
884            }
885    
886            /**
887            * Returns an ordered range of all the email addresses.
888            *
889            * <p>
890            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
891            * </p>
892            *
893            * @param start the lower bound of the range of email addresses
894            * @param end the upper bound of the range of email addresses (not inclusive)
895            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
896            * @return the ordered range of email addresses
897            * @throws SystemException if a system exception occurred
898            */
899            public static java.util.List<com.liferay.portal.model.EmailAddress> findAll(
900                    int start, int end,
901                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
902                    throws com.liferay.portal.kernel.exception.SystemException {
903                    return getPersistence().findAll(start, end, orderByComparator);
904            }
905    
906            /**
907            * Removes all the email addresses where companyId = &#63; from the database.
908            *
909            * @param companyId the company ID
910            * @throws SystemException if a system exception occurred
911            */
912            public static void removeByCompanyId(long companyId)
913                    throws com.liferay.portal.kernel.exception.SystemException {
914                    getPersistence().removeByCompanyId(companyId);
915            }
916    
917            /**
918            * Removes all the email addresses where userId = &#63; from the database.
919            *
920            * @param userId the user ID
921            * @throws SystemException if a system exception occurred
922            */
923            public static void removeByUserId(long userId)
924                    throws com.liferay.portal.kernel.exception.SystemException {
925                    getPersistence().removeByUserId(userId);
926            }
927    
928            /**
929            * Removes all the email addresses where companyId = &#63; and classNameId = &#63; from the database.
930            *
931            * @param companyId the company ID
932            * @param classNameId the class name ID
933            * @throws SystemException if a system exception occurred
934            */
935            public static void removeByC_C(long companyId, long classNameId)
936                    throws com.liferay.portal.kernel.exception.SystemException {
937                    getPersistence().removeByC_C(companyId, classNameId);
938            }
939    
940            /**
941            * Removes all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
942            *
943            * @param companyId the company ID
944            * @param classNameId the class name ID
945            * @param classPK the class p k
946            * @throws SystemException if a system exception occurred
947            */
948            public static void removeByC_C_C(long companyId, long classNameId,
949                    long classPK)
950                    throws com.liferay.portal.kernel.exception.SystemException {
951                    getPersistence().removeByC_C_C(companyId, classNameId, classPK);
952            }
953    
954            /**
955            * Removes all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63; from the database.
956            *
957            * @param companyId the company ID
958            * @param classNameId the class name ID
959            * @param classPK the class p k
960            * @param primary the primary
961            * @throws SystemException if a system exception occurred
962            */
963            public static void removeByC_C_C_P(long companyId, long classNameId,
964                    long classPK, boolean primary)
965                    throws com.liferay.portal.kernel.exception.SystemException {
966                    getPersistence()
967                            .removeByC_C_C_P(companyId, classNameId, classPK, primary);
968            }
969    
970            /**
971            * Removes all the email addresses from the database.
972            *
973            * @throws SystemException if a system exception occurred
974            */
975            public static void removeAll()
976                    throws com.liferay.portal.kernel.exception.SystemException {
977                    getPersistence().removeAll();
978            }
979    
980            /**
981            * Returns the number of email addresses where companyId = &#63;.
982            *
983            * @param companyId the company ID
984            * @return the number of matching email addresses
985            * @throws SystemException if a system exception occurred
986            */
987            public static int countByCompanyId(long companyId)
988                    throws com.liferay.portal.kernel.exception.SystemException {
989                    return getPersistence().countByCompanyId(companyId);
990            }
991    
992            /**
993            * Returns the number of email addresses where userId = &#63;.
994            *
995            * @param userId the user ID
996            * @return the number of matching email addresses
997            * @throws SystemException if a system exception occurred
998            */
999            public static int countByUserId(long userId)
1000                    throws com.liferay.portal.kernel.exception.SystemException {
1001                    return getPersistence().countByUserId(userId);
1002            }
1003    
1004            /**
1005            * Returns the number of email addresses where companyId = &#63; and classNameId = &#63;.
1006            *
1007            * @param companyId the company ID
1008            * @param classNameId the class name ID
1009            * @return the number of matching email addresses
1010            * @throws SystemException if a system exception occurred
1011            */
1012            public static int countByC_C(long companyId, long classNameId)
1013                    throws com.liferay.portal.kernel.exception.SystemException {
1014                    return getPersistence().countByC_C(companyId, classNameId);
1015            }
1016    
1017            /**
1018            * Returns the number of email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
1019            *
1020            * @param companyId the company ID
1021            * @param classNameId the class name ID
1022            * @param classPK the class p k
1023            * @return the number of matching email addresses
1024            * @throws SystemException if a system exception occurred
1025            */
1026            public static int countByC_C_C(long companyId, long classNameId,
1027                    long classPK)
1028                    throws com.liferay.portal.kernel.exception.SystemException {
1029                    return getPersistence().countByC_C_C(companyId, classNameId, classPK);
1030            }
1031    
1032            /**
1033            * Returns the number of email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1034            *
1035            * @param companyId the company ID
1036            * @param classNameId the class name ID
1037            * @param classPK the class p k
1038            * @param primary the primary
1039            * @return the number of matching email addresses
1040            * @throws SystemException if a system exception occurred
1041            */
1042            public static int countByC_C_C_P(long companyId, long classNameId,
1043                    long classPK, boolean primary)
1044                    throws com.liferay.portal.kernel.exception.SystemException {
1045                    return getPersistence()
1046                                       .countByC_C_C_P(companyId, classNameId, classPK, primary);
1047            }
1048    
1049            /**
1050            * Returns the number of email addresses.
1051            *
1052            * @return the number of email addresses
1053            * @throws SystemException if a system exception occurred
1054            */
1055            public static int countAll()
1056                    throws com.liferay.portal.kernel.exception.SystemException {
1057                    return getPersistence().countAll();
1058            }
1059    
1060            public static EmailAddressPersistence getPersistence() {
1061                    if (_persistence == null) {
1062                            _persistence = (EmailAddressPersistence)PortalBeanLocatorUtil.locate(EmailAddressPersistence.class.getName());
1063    
1064                            ReferenceRegistry.registerReference(EmailAddressUtil.class,
1065                                    "_persistence");
1066                    }
1067    
1068                    return _persistence;
1069            }
1070    
1071            public void setPersistence(EmailAddressPersistence persistence) {
1072                    _persistence = persistence;
1073    
1074                    ReferenceRegistry.registerReference(EmailAddressUtil.class,
1075                            "_persistence");
1076            }
1077    
1078            private static EmailAddressPersistence _persistence;
1079    }