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.exception.SystemException;
018    import com.liferay.portal.model.EmailAddress;
019    
020    /**
021     * The persistence interface for the email address service.
022     *
023     * <p>
024     * Caching information and settings can be found in <code>portal.properties</code>
025     * </p>
026     *
027     * @author Brian Wing Shun Chan
028     * @see EmailAddressPersistenceImpl
029     * @see EmailAddressUtil
030     * @generated
031     */
032    public interface EmailAddressPersistence extends BasePersistence<EmailAddress> {
033            /*
034             * NOTE FOR DEVELOPERS:
035             *
036             * Never modify or reference this interface directly. Always use {@link EmailAddressUtil} to access the email address persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
037             */
038    
039            /**
040            * Caches the email address in the entity cache if it is enabled.
041            *
042            * @param emailAddress the email address
043            */
044            public void cacheResult(com.liferay.portal.model.EmailAddress emailAddress);
045    
046            /**
047            * Caches the email addresses in the entity cache if it is enabled.
048            *
049            * @param emailAddresses the email addresses
050            */
051            public void cacheResult(
052                    java.util.List<com.liferay.portal.model.EmailAddress> emailAddresses);
053    
054            /**
055            * Creates a new email address with the primary key. Does not add the email address to the database.
056            *
057            * @param emailAddressId the primary key for the new email address
058            * @return the new email address
059            */
060            public com.liferay.portal.model.EmailAddress create(long emailAddressId);
061    
062            /**
063            * Removes the email address with the primary key from the database. Also notifies the appropriate model listeners.
064            *
065            * @param emailAddressId the primary key of the email address
066            * @return the email address that was removed
067            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
068            * @throws SystemException if a system exception occurred
069            */
070            public com.liferay.portal.model.EmailAddress remove(long emailAddressId)
071                    throws com.liferay.portal.NoSuchEmailAddressException,
072                            com.liferay.portal.kernel.exception.SystemException;
073    
074            public com.liferay.portal.model.EmailAddress updateImpl(
075                    com.liferay.portal.model.EmailAddress emailAddress, boolean merge)
076                    throws com.liferay.portal.kernel.exception.SystemException;
077    
078            /**
079            * Returns the email address with the primary key or throws a {@link com.liferay.portal.NoSuchEmailAddressException} if it could not be found.
080            *
081            * @param emailAddressId the primary key of the email address
082            * @return the email address
083            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
084            * @throws SystemException if a system exception occurred
085            */
086            public com.liferay.portal.model.EmailAddress findByPrimaryKey(
087                    long emailAddressId)
088                    throws com.liferay.portal.NoSuchEmailAddressException,
089                            com.liferay.portal.kernel.exception.SystemException;
090    
091            /**
092            * Returns the email address with the primary key or returns <code>null</code> if it could not be found.
093            *
094            * @param emailAddressId the primary key of the email address
095            * @return the email address, or <code>null</code> if a email address with the primary key could not be found
096            * @throws SystemException if a system exception occurred
097            */
098            public com.liferay.portal.model.EmailAddress fetchByPrimaryKey(
099                    long emailAddressId)
100                    throws com.liferay.portal.kernel.exception.SystemException;
101    
102            /**
103            * Returns all the email addresses where companyId = &#63;.
104            *
105            * @param companyId the company ID
106            * @return the matching email addresses
107            * @throws SystemException if a system exception occurred
108            */
109            public java.util.List<com.liferay.portal.model.EmailAddress> findByCompanyId(
110                    long companyId)
111                    throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Returns a range of all the email addresses where companyId = &#63;.
115            *
116            * <p>
117            * 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.
118            * </p>
119            *
120            * @param companyId the company ID
121            * @param start the lower bound of the range of email addresses
122            * @param end the upper bound of the range of email addresses (not inclusive)
123            * @return the range of matching email addresses
124            * @throws SystemException if a system exception occurred
125            */
126            public java.util.List<com.liferay.portal.model.EmailAddress> findByCompanyId(
127                    long companyId, int start, int end)
128                    throws com.liferay.portal.kernel.exception.SystemException;
129    
130            /**
131            * Returns an ordered range of all the email addresses where companyId = &#63;.
132            *
133            * <p>
134            * 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.
135            * </p>
136            *
137            * @param companyId the company ID
138            * @param start the lower bound of the range of email addresses
139            * @param end the upper bound of the range of email addresses (not inclusive)
140            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
141            * @return the ordered range of matching email addresses
142            * @throws SystemException if a system exception occurred
143            */
144            public java.util.List<com.liferay.portal.model.EmailAddress> findByCompanyId(
145                    long companyId, int start, int end,
146                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
147                    throws com.liferay.portal.kernel.exception.SystemException;
148    
149            /**
150            * Returns the first email address in the ordered set where companyId = &#63;.
151            *
152            * <p>
153            * 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.
154            * </p>
155            *
156            * @param companyId the company ID
157            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
158            * @return the first matching email address
159            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
160            * @throws SystemException if a system exception occurred
161            */
162            public com.liferay.portal.model.EmailAddress findByCompanyId_First(
163                    long companyId,
164                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
165                    throws com.liferay.portal.NoSuchEmailAddressException,
166                            com.liferay.portal.kernel.exception.SystemException;
167    
168            /**
169            * Returns the last email address in the ordered set where companyId = &#63;.
170            *
171            * <p>
172            * 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.
173            * </p>
174            *
175            * @param companyId the company ID
176            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
177            * @return the last matching email address
178            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
179            * @throws SystemException if a system exception occurred
180            */
181            public com.liferay.portal.model.EmailAddress findByCompanyId_Last(
182                    long companyId,
183                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
184                    throws com.liferay.portal.NoSuchEmailAddressException,
185                            com.liferay.portal.kernel.exception.SystemException;
186    
187            /**
188            * Returns the email addresses before and after the current email address in the ordered set where companyId = &#63;.
189            *
190            * <p>
191            * 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.
192            * </p>
193            *
194            * @param emailAddressId the primary key of the current email address
195            * @param companyId the company ID
196            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
197            * @return the previous, current, and next email address
198            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
199            * @throws SystemException if a system exception occurred
200            */
201            public com.liferay.portal.model.EmailAddress[] findByCompanyId_PrevAndNext(
202                    long emailAddressId, long companyId,
203                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
204                    throws com.liferay.portal.NoSuchEmailAddressException,
205                            com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Returns all the email addresses where userId = &#63;.
209            *
210            * @param userId the user ID
211            * @return the matching email addresses
212            * @throws SystemException if a system exception occurred
213            */
214            public java.util.List<com.liferay.portal.model.EmailAddress> findByUserId(
215                    long userId) throws com.liferay.portal.kernel.exception.SystemException;
216    
217            /**
218            * Returns a range of all the email addresses where userId = &#63;.
219            *
220            * <p>
221            * 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.
222            * </p>
223            *
224            * @param userId the user ID
225            * @param start the lower bound of the range of email addresses
226            * @param end the upper bound of the range of email addresses (not inclusive)
227            * @return the range of matching email addresses
228            * @throws SystemException if a system exception occurred
229            */
230            public java.util.List<com.liferay.portal.model.EmailAddress> findByUserId(
231                    long userId, int start, int end)
232                    throws com.liferay.portal.kernel.exception.SystemException;
233    
234            /**
235            * Returns an ordered range of all the email addresses where userId = &#63;.
236            *
237            * <p>
238            * 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.
239            * </p>
240            *
241            * @param userId the user ID
242            * @param start the lower bound of the range of email addresses
243            * @param end the upper bound of the range of email addresses (not inclusive)
244            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
245            * @return the ordered range of matching email addresses
246            * @throws SystemException if a system exception occurred
247            */
248            public java.util.List<com.liferay.portal.model.EmailAddress> findByUserId(
249                    long userId, int start, int end,
250                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
251                    throws com.liferay.portal.kernel.exception.SystemException;
252    
253            /**
254            * Returns the first email address in the ordered set where userId = &#63;.
255            *
256            * <p>
257            * 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.
258            * </p>
259            *
260            * @param userId the user ID
261            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
262            * @return the first matching email address
263            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
264            * @throws SystemException if a system exception occurred
265            */
266            public com.liferay.portal.model.EmailAddress findByUserId_First(
267                    long userId,
268                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
269                    throws com.liferay.portal.NoSuchEmailAddressException,
270                            com.liferay.portal.kernel.exception.SystemException;
271    
272            /**
273            * Returns the last email address in the ordered set where userId = &#63;.
274            *
275            * <p>
276            * 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.
277            * </p>
278            *
279            * @param userId the user ID
280            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
281            * @return the last matching email address
282            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
283            * @throws SystemException if a system exception occurred
284            */
285            public com.liferay.portal.model.EmailAddress findByUserId_Last(
286                    long userId,
287                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
288                    throws com.liferay.portal.NoSuchEmailAddressException,
289                            com.liferay.portal.kernel.exception.SystemException;
290    
291            /**
292            * Returns the email addresses before and after the current email address in the ordered set where userId = &#63;.
293            *
294            * <p>
295            * 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.
296            * </p>
297            *
298            * @param emailAddressId the primary key of the current email address
299            * @param userId the user ID
300            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
301            * @return the previous, current, and next email address
302            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
303            * @throws SystemException if a system exception occurred
304            */
305            public com.liferay.portal.model.EmailAddress[] findByUserId_PrevAndNext(
306                    long emailAddressId, long userId,
307                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
308                    throws com.liferay.portal.NoSuchEmailAddressException,
309                            com.liferay.portal.kernel.exception.SystemException;
310    
311            /**
312            * Returns all the email addresses where companyId = &#63; and classNameId = &#63;.
313            *
314            * @param companyId the company ID
315            * @param classNameId the class name ID
316            * @return the matching email addresses
317            * @throws SystemException if a system exception occurred
318            */
319            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C(
320                    long companyId, long classNameId)
321                    throws com.liferay.portal.kernel.exception.SystemException;
322    
323            /**
324            * Returns a range of all the email addresses where companyId = &#63; and classNameId = &#63;.
325            *
326            * <p>
327            * 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.
328            * </p>
329            *
330            * @param companyId the company ID
331            * @param classNameId the class name ID
332            * @param start the lower bound of the range of email addresses
333            * @param end the upper bound of the range of email addresses (not inclusive)
334            * @return the range of matching email addresses
335            * @throws SystemException if a system exception occurred
336            */
337            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C(
338                    long companyId, long classNameId, int start, int end)
339                    throws com.liferay.portal.kernel.exception.SystemException;
340    
341            /**
342            * Returns an ordered range of all the email addresses where companyId = &#63; and classNameId = &#63;.
343            *
344            * <p>
345            * 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.
346            * </p>
347            *
348            * @param companyId the company ID
349            * @param classNameId the class name ID
350            * @param start the lower bound of the range of email addresses
351            * @param end the upper bound of the range of email addresses (not inclusive)
352            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
353            * @return the ordered range of matching email addresses
354            * @throws SystemException if a system exception occurred
355            */
356            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C(
357                    long companyId, long classNameId, int start, int end,
358                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
359                    throws com.liferay.portal.kernel.exception.SystemException;
360    
361            /**
362            * Returns the first email address in the ordered set where companyId = &#63; and classNameId = &#63;.
363            *
364            * <p>
365            * 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.
366            * </p>
367            *
368            * @param companyId the company ID
369            * @param classNameId the class name ID
370            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
371            * @return the first matching email address
372            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
373            * @throws SystemException if a system exception occurred
374            */
375            public com.liferay.portal.model.EmailAddress findByC_C_First(
376                    long companyId, long classNameId,
377                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
378                    throws com.liferay.portal.NoSuchEmailAddressException,
379                            com.liferay.portal.kernel.exception.SystemException;
380    
381            /**
382            * Returns the last email address in the ordered set where companyId = &#63; and classNameId = &#63;.
383            *
384            * <p>
385            * 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.
386            * </p>
387            *
388            * @param companyId the company ID
389            * @param classNameId the class name ID
390            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
391            * @return the last matching email address
392            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
393            * @throws SystemException if a system exception occurred
394            */
395            public com.liferay.portal.model.EmailAddress findByC_C_Last(
396                    long companyId, long classNameId,
397                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
398                    throws com.liferay.portal.NoSuchEmailAddressException,
399                            com.liferay.portal.kernel.exception.SystemException;
400    
401            /**
402            * Returns the email addresses before and after the current email address in the ordered set where companyId = &#63; and classNameId = &#63;.
403            *
404            * <p>
405            * 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.
406            * </p>
407            *
408            * @param emailAddressId the primary key of the current email address
409            * @param companyId the company ID
410            * @param classNameId the class name ID
411            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
412            * @return the previous, current, and next email address
413            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
414            * @throws SystemException if a system exception occurred
415            */
416            public com.liferay.portal.model.EmailAddress[] findByC_C_PrevAndNext(
417                    long emailAddressId, long companyId, long classNameId,
418                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
419                    throws com.liferay.portal.NoSuchEmailAddressException,
420                            com.liferay.portal.kernel.exception.SystemException;
421    
422            /**
423            * Returns all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
424            *
425            * @param companyId the company ID
426            * @param classNameId the class name ID
427            * @param classPK the class p k
428            * @return the matching email addresses
429            * @throws SystemException if a system exception occurred
430            */
431            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C(
432                    long companyId, long classNameId, long classPK)
433                    throws com.liferay.portal.kernel.exception.SystemException;
434    
435            /**
436            * Returns a range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
437            *
438            * <p>
439            * 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.
440            * </p>
441            *
442            * @param companyId the company ID
443            * @param classNameId the class name ID
444            * @param classPK the class p k
445            * @param start the lower bound of the range of email addresses
446            * @param end the upper bound of the range of email addresses (not inclusive)
447            * @return the range of matching email addresses
448            * @throws SystemException if a system exception occurred
449            */
450            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C(
451                    long companyId, long classNameId, long classPK, int start, int end)
452                    throws com.liferay.portal.kernel.exception.SystemException;
453    
454            /**
455            * Returns an ordered range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
456            *
457            * <p>
458            * 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.
459            * </p>
460            *
461            * @param companyId the company ID
462            * @param classNameId the class name ID
463            * @param classPK the class p k
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            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
467            * @return the ordered range of matching email addresses
468            * @throws SystemException if a system exception occurred
469            */
470            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C(
471                    long companyId, long classNameId, long classPK, int start, int end,
472                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
473                    throws com.liferay.portal.kernel.exception.SystemException;
474    
475            /**
476            * Returns the first email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#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 classPK the class p k
485            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
486            * @return the first matching email address
487            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
488            * @throws SystemException if a system exception occurred
489            */
490            public com.liferay.portal.model.EmailAddress findByC_C_C_First(
491                    long companyId, long classNameId, long classPK,
492                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
493                    throws com.liferay.portal.NoSuchEmailAddressException,
494                            com.liferay.portal.kernel.exception.SystemException;
495    
496            /**
497            * Returns the last email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
498            *
499            * <p>
500            * 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.
501            * </p>
502            *
503            * @param companyId the company ID
504            * @param classNameId the class name ID
505            * @param classPK the class p k
506            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
507            * @return the last matching email address
508            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
509            * @throws SystemException if a system exception occurred
510            */
511            public com.liferay.portal.model.EmailAddress findByC_C_C_Last(
512                    long companyId, long classNameId, long classPK,
513                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
514                    throws com.liferay.portal.NoSuchEmailAddressException,
515                            com.liferay.portal.kernel.exception.SystemException;
516    
517            /**
518            * Returns the email addresses before and after the current email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
519            *
520            * <p>
521            * 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.
522            * </p>
523            *
524            * @param emailAddressId the primary key of the current email address
525            * @param companyId the company ID
526            * @param classNameId the class name ID
527            * @param classPK the class p k
528            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
529            * @return the previous, current, and next email address
530            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
531            * @throws SystemException if a system exception occurred
532            */
533            public com.liferay.portal.model.EmailAddress[] findByC_C_C_PrevAndNext(
534                    long emailAddressId, long companyId, long classNameId, long classPK,
535                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
536                    throws com.liferay.portal.NoSuchEmailAddressException,
537                            com.liferay.portal.kernel.exception.SystemException;
538    
539            /**
540            * Returns all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
541            *
542            * @param companyId the company ID
543            * @param classNameId the class name ID
544            * @param classPK the class p k
545            * @param primary the primary
546            * @return the matching email addresses
547            * @throws SystemException if a system exception occurred
548            */
549            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C_P(
550                    long companyId, long classNameId, long classPK, boolean primary)
551                    throws com.liferay.portal.kernel.exception.SystemException;
552    
553            /**
554            * Returns a range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
555            *
556            * <p>
557            * 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.
558            * </p>
559            *
560            * @param companyId the company ID
561            * @param classNameId the class name ID
562            * @param classPK the class p k
563            * @param primary the primary
564            * @param start the lower bound of the range of email addresses
565            * @param end the upper bound of the range of email addresses (not inclusive)
566            * @return the range of matching email addresses
567            * @throws SystemException if a system exception occurred
568            */
569            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C_P(
570                    long companyId, long classNameId, long classPK, boolean primary,
571                    int start, int end)
572                    throws com.liferay.portal.kernel.exception.SystemException;
573    
574            /**
575            * Returns an ordered range of all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
576            *
577            * <p>
578            * 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.
579            * </p>
580            *
581            * @param companyId the company ID
582            * @param classNameId the class name ID
583            * @param classPK the class p k
584            * @param primary the primary
585            * @param start the lower bound of the range of email addresses
586            * @param end the upper bound of the range of email addresses (not inclusive)
587            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
588            * @return the ordered range of matching email addresses
589            * @throws SystemException if a system exception occurred
590            */
591            public java.util.List<com.liferay.portal.model.EmailAddress> findByC_C_C_P(
592                    long companyId, long classNameId, long classPK, boolean primary,
593                    int start, int end,
594                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
595                    throws com.liferay.portal.kernel.exception.SystemException;
596    
597            /**
598            * Returns the first email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
599            *
600            * <p>
601            * 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.
602            * </p>
603            *
604            * @param companyId the company ID
605            * @param classNameId the class name ID
606            * @param classPK the class p k
607            * @param primary the primary
608            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
609            * @return the first matching email address
610            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
611            * @throws SystemException if a system exception occurred
612            */
613            public com.liferay.portal.model.EmailAddress findByC_C_C_P_First(
614                    long companyId, long classNameId, long classPK, boolean primary,
615                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
616                    throws com.liferay.portal.NoSuchEmailAddressException,
617                            com.liferay.portal.kernel.exception.SystemException;
618    
619            /**
620            * Returns the last email address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
621            *
622            * <p>
623            * 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.
624            * </p>
625            *
626            * @param companyId the company ID
627            * @param classNameId the class name ID
628            * @param classPK the class p k
629            * @param primary the primary
630            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
631            * @return the last matching email address
632            * @throws com.liferay.portal.NoSuchEmailAddressException if a matching email address could not be found
633            * @throws SystemException if a system exception occurred
634            */
635            public com.liferay.portal.model.EmailAddress findByC_C_C_P_Last(
636                    long companyId, long classNameId, long classPK, boolean primary,
637                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
638                    throws com.liferay.portal.NoSuchEmailAddressException,
639                            com.liferay.portal.kernel.exception.SystemException;
640    
641            /**
642            * 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;.
643            *
644            * <p>
645            * 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.
646            * </p>
647            *
648            * @param emailAddressId the primary key of the current email address
649            * @param companyId the company ID
650            * @param classNameId the class name ID
651            * @param classPK the class p k
652            * @param primary the primary
653            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
654            * @return the previous, current, and next email address
655            * @throws com.liferay.portal.NoSuchEmailAddressException if a email address with the primary key could not be found
656            * @throws SystemException if a system exception occurred
657            */
658            public com.liferay.portal.model.EmailAddress[] findByC_C_C_P_PrevAndNext(
659                    long emailAddressId, long companyId, long classNameId, long classPK,
660                    boolean primary,
661                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
662                    throws com.liferay.portal.NoSuchEmailAddressException,
663                            com.liferay.portal.kernel.exception.SystemException;
664    
665            /**
666            * Returns all the email addresses.
667            *
668            * @return the email addresses
669            * @throws SystemException if a system exception occurred
670            */
671            public java.util.List<com.liferay.portal.model.EmailAddress> findAll()
672                    throws com.liferay.portal.kernel.exception.SystemException;
673    
674            /**
675            * Returns a range of all the email addresses.
676            *
677            * <p>
678            * 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.
679            * </p>
680            *
681            * @param start the lower bound of the range of email addresses
682            * @param end the upper bound of the range of email addresses (not inclusive)
683            * @return the range of email addresses
684            * @throws SystemException if a system exception occurred
685            */
686            public java.util.List<com.liferay.portal.model.EmailAddress> findAll(
687                    int start, int end)
688                    throws com.liferay.portal.kernel.exception.SystemException;
689    
690            /**
691            * Returns an ordered range of all the email addresses.
692            *
693            * <p>
694            * 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.
695            * </p>
696            *
697            * @param start the lower bound of the range of email addresses
698            * @param end the upper bound of the range of email addresses (not inclusive)
699            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
700            * @return the ordered range of email addresses
701            * @throws SystemException if a system exception occurred
702            */
703            public java.util.List<com.liferay.portal.model.EmailAddress> findAll(
704                    int start, int end,
705                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
706                    throws com.liferay.portal.kernel.exception.SystemException;
707    
708            /**
709            * Removes all the email addresses where companyId = &#63; from the database.
710            *
711            * @param companyId the company ID
712            * @throws SystemException if a system exception occurred
713            */
714            public void removeByCompanyId(long companyId)
715                    throws com.liferay.portal.kernel.exception.SystemException;
716    
717            /**
718            * Removes all the email addresses where userId = &#63; from the database.
719            *
720            * @param userId the user ID
721            * @throws SystemException if a system exception occurred
722            */
723            public void removeByUserId(long userId)
724                    throws com.liferay.portal.kernel.exception.SystemException;
725    
726            /**
727            * Removes all the email addresses where companyId = &#63; and classNameId = &#63; from the database.
728            *
729            * @param companyId the company ID
730            * @param classNameId the class name ID
731            * @throws SystemException if a system exception occurred
732            */
733            public void removeByC_C(long companyId, long classNameId)
734                    throws com.liferay.portal.kernel.exception.SystemException;
735    
736            /**
737            * Removes all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
738            *
739            * @param companyId the company ID
740            * @param classNameId the class name ID
741            * @param classPK the class p k
742            * @throws SystemException if a system exception occurred
743            */
744            public void removeByC_C_C(long companyId, long classNameId, long classPK)
745                    throws com.liferay.portal.kernel.exception.SystemException;
746    
747            /**
748            * Removes all the email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63; from the database.
749            *
750            * @param companyId the company ID
751            * @param classNameId the class name ID
752            * @param classPK the class p k
753            * @param primary the primary
754            * @throws SystemException if a system exception occurred
755            */
756            public void removeByC_C_C_P(long companyId, long classNameId, long classPK,
757                    boolean primary)
758                    throws com.liferay.portal.kernel.exception.SystemException;
759    
760            /**
761            * Removes all the email addresses from the database.
762            *
763            * @throws SystemException if a system exception occurred
764            */
765            public void removeAll()
766                    throws com.liferay.portal.kernel.exception.SystemException;
767    
768            /**
769            * Returns the number of email addresses where companyId = &#63;.
770            *
771            * @param companyId the company ID
772            * @return the number of matching email addresses
773            * @throws SystemException if a system exception occurred
774            */
775            public int countByCompanyId(long companyId)
776                    throws com.liferay.portal.kernel.exception.SystemException;
777    
778            /**
779            * Returns the number of email addresses where userId = &#63;.
780            *
781            * @param userId the user ID
782            * @return the number of matching email addresses
783            * @throws SystemException if a system exception occurred
784            */
785            public int countByUserId(long userId)
786                    throws com.liferay.portal.kernel.exception.SystemException;
787    
788            /**
789            * Returns the number of email addresses where companyId = &#63; and classNameId = &#63;.
790            *
791            * @param companyId the company ID
792            * @param classNameId the class name ID
793            * @return the number of matching email addresses
794            * @throws SystemException if a system exception occurred
795            */
796            public int countByC_C(long companyId, long classNameId)
797                    throws com.liferay.portal.kernel.exception.SystemException;
798    
799            /**
800            * Returns the number of email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
801            *
802            * @param companyId the company ID
803            * @param classNameId the class name ID
804            * @param classPK the class p k
805            * @return the number of matching email addresses
806            * @throws SystemException if a system exception occurred
807            */
808            public int countByC_C_C(long companyId, long classNameId, long classPK)
809                    throws com.liferay.portal.kernel.exception.SystemException;
810    
811            /**
812            * Returns the number of email addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
813            *
814            * @param companyId the company ID
815            * @param classNameId the class name ID
816            * @param classPK the class p k
817            * @param primary the primary
818            * @return the number of matching email addresses
819            * @throws SystemException if a system exception occurred
820            */
821            public int countByC_C_C_P(long companyId, long classNameId, long classPK,
822                    boolean primary)
823                    throws com.liferay.portal.kernel.exception.SystemException;
824    
825            /**
826            * Returns the number of email addresses.
827            *
828            * @return the number of email addresses
829            * @throws SystemException if a system exception occurred
830            */
831            public int countAll()
832                    throws com.liferay.portal.kernel.exception.SystemException;
833    
834            public EmailAddress remove(EmailAddress emailAddress)
835                    throws SystemException;
836    }