001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.exception.NoSuchContactException;
020    import com.liferay.portal.model.Contact;
021    
022    /**
023     * The persistence interface for the contact service.
024     *
025     * <p>
026     * Caching information and settings can be found in <code>portal.properties</code>
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see com.liferay.portal.service.persistence.impl.ContactPersistenceImpl
031     * @see ContactUtil
032     * @generated
033     */
034    @ProviderType
035    public interface ContactPersistence extends BasePersistence<Contact> {
036            /*
037             * NOTE FOR DEVELOPERS:
038             *
039             * Never modify or reference this interface directly. Always use {@link ContactUtil} to access the contact persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
040             */
041    
042            /**
043            * Returns all the contacts where companyId = &#63;.
044            *
045            * @param companyId the company ID
046            * @return the matching contacts
047            */
048            public java.util.List<Contact> findByCompanyId(long companyId);
049    
050            /**
051            * Returns a range of all the contacts where companyId = &#63;.
052            *
053            * <p>
054            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
055            * </p>
056            *
057            * @param companyId the company ID
058            * @param start the lower bound of the range of contacts
059            * @param end the upper bound of the range of contacts (not inclusive)
060            * @return the range of matching contacts
061            */
062            public java.util.List<Contact> findByCompanyId(long companyId, int start,
063                    int end);
064    
065            /**
066            * Returns an ordered range of all the contacts where companyId = &#63;.
067            *
068            * <p>
069            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
070            * </p>
071            *
072            * @param companyId the company ID
073            * @param start the lower bound of the range of contacts
074            * @param end the upper bound of the range of contacts (not inclusive)
075            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
076            * @return the ordered range of matching contacts
077            */
078            public java.util.List<Contact> findByCompanyId(long companyId, int start,
079                    int end,
080                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
081    
082            /**
083            * Returns an ordered range of all the contacts where companyId = &#63;.
084            *
085            * <p>
086            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
087            * </p>
088            *
089            * @param companyId the company ID
090            * @param start the lower bound of the range of contacts
091            * @param end the upper bound of the range of contacts (not inclusive)
092            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
093            * @param retrieveFromCache whether to retrieve from the finder cache
094            * @return the ordered range of matching contacts
095            */
096            public java.util.List<Contact> findByCompanyId(long companyId, int start,
097                    int end,
098                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator,
099                    boolean retrieveFromCache);
100    
101            /**
102            * Returns the first contact in the ordered set where companyId = &#63;.
103            *
104            * @param companyId the company ID
105            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
106            * @return the first matching contact
107            * @throws NoSuchContactException if a matching contact could not be found
108            */
109            public Contact findByCompanyId_First(long companyId,
110                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
111                    throws NoSuchContactException;
112    
113            /**
114            * Returns the first contact in the ordered set where companyId = &#63;.
115            *
116            * @param companyId the company ID
117            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
118            * @return the first matching contact, or <code>null</code> if a matching contact could not be found
119            */
120            public Contact fetchByCompanyId_First(long companyId,
121                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
122    
123            /**
124            * Returns the last contact in the ordered set where companyId = &#63;.
125            *
126            * @param companyId the company ID
127            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
128            * @return the last matching contact
129            * @throws NoSuchContactException if a matching contact could not be found
130            */
131            public Contact findByCompanyId_Last(long companyId,
132                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
133                    throws NoSuchContactException;
134    
135            /**
136            * Returns the last contact in the ordered set where companyId = &#63;.
137            *
138            * @param companyId the company ID
139            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
140            * @return the last matching contact, or <code>null</code> if a matching contact could not be found
141            */
142            public Contact fetchByCompanyId_Last(long companyId,
143                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
144    
145            /**
146            * Returns the contacts before and after the current contact in the ordered set where companyId = &#63;.
147            *
148            * @param contactId the primary key of the current contact
149            * @param companyId the company ID
150            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
151            * @return the previous, current, and next contact
152            * @throws NoSuchContactException if a contact with the primary key could not be found
153            */
154            public Contact[] findByCompanyId_PrevAndNext(long contactId,
155                    long companyId,
156                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
157                    throws NoSuchContactException;
158    
159            /**
160            * Removes all the contacts where companyId = &#63; from the database.
161            *
162            * @param companyId the company ID
163            */
164            public void removeByCompanyId(long companyId);
165    
166            /**
167            * Returns the number of contacts where companyId = &#63;.
168            *
169            * @param companyId the company ID
170            * @return the number of matching contacts
171            */
172            public int countByCompanyId(long companyId);
173    
174            /**
175            * Returns all the contacts where accountId = &#63;.
176            *
177            * @param accountId the account ID
178            * @return the matching contacts
179            */
180            public java.util.List<Contact> findByAccountId(long accountId);
181    
182            /**
183            * Returns a range of all the contacts where accountId = &#63;.
184            *
185            * <p>
186            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
187            * </p>
188            *
189            * @param accountId the account ID
190            * @param start the lower bound of the range of contacts
191            * @param end the upper bound of the range of contacts (not inclusive)
192            * @return the range of matching contacts
193            */
194            public java.util.List<Contact> findByAccountId(long accountId, int start,
195                    int end);
196    
197            /**
198            * Returns an ordered range of all the contacts where accountId = &#63;.
199            *
200            * <p>
201            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
202            * </p>
203            *
204            * @param accountId the account ID
205            * @param start the lower bound of the range of contacts
206            * @param end the upper bound of the range of contacts (not inclusive)
207            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
208            * @return the ordered range of matching contacts
209            */
210            public java.util.List<Contact> findByAccountId(long accountId, int start,
211                    int end,
212                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
213    
214            /**
215            * Returns an ordered range of all the contacts where accountId = &#63;.
216            *
217            * <p>
218            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
219            * </p>
220            *
221            * @param accountId the account ID
222            * @param start the lower bound of the range of contacts
223            * @param end the upper bound of the range of contacts (not inclusive)
224            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
225            * @param retrieveFromCache whether to retrieve from the finder cache
226            * @return the ordered range of matching contacts
227            */
228            public java.util.List<Contact> findByAccountId(long accountId, int start,
229                    int end,
230                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator,
231                    boolean retrieveFromCache);
232    
233            /**
234            * Returns the first contact in the ordered set where accountId = &#63;.
235            *
236            * @param accountId the account ID
237            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
238            * @return the first matching contact
239            * @throws NoSuchContactException if a matching contact could not be found
240            */
241            public Contact findByAccountId_First(long accountId,
242                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
243                    throws NoSuchContactException;
244    
245            /**
246            * Returns the first contact in the ordered set where accountId = &#63;.
247            *
248            * @param accountId the account ID
249            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
250            * @return the first matching contact, or <code>null</code> if a matching contact could not be found
251            */
252            public Contact fetchByAccountId_First(long accountId,
253                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
254    
255            /**
256            * Returns the last contact in the ordered set where accountId = &#63;.
257            *
258            * @param accountId the account ID
259            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
260            * @return the last matching contact
261            * @throws NoSuchContactException if a matching contact could not be found
262            */
263            public Contact findByAccountId_Last(long accountId,
264                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
265                    throws NoSuchContactException;
266    
267            /**
268            * Returns the last contact in the ordered set where accountId = &#63;.
269            *
270            * @param accountId the account ID
271            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
272            * @return the last matching contact, or <code>null</code> if a matching contact could not be found
273            */
274            public Contact fetchByAccountId_Last(long accountId,
275                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
276    
277            /**
278            * Returns the contacts before and after the current contact in the ordered set where accountId = &#63;.
279            *
280            * @param contactId the primary key of the current contact
281            * @param accountId the account ID
282            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
283            * @return the previous, current, and next contact
284            * @throws NoSuchContactException if a contact with the primary key could not be found
285            */
286            public Contact[] findByAccountId_PrevAndNext(long contactId,
287                    long accountId,
288                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
289                    throws NoSuchContactException;
290    
291            /**
292            * Removes all the contacts where accountId = &#63; from the database.
293            *
294            * @param accountId the account ID
295            */
296            public void removeByAccountId(long accountId);
297    
298            /**
299            * Returns the number of contacts where accountId = &#63;.
300            *
301            * @param accountId the account ID
302            * @return the number of matching contacts
303            */
304            public int countByAccountId(long accountId);
305    
306            /**
307            * Returns all the contacts where classNameId = &#63; and classPK = &#63;.
308            *
309            * @param classNameId the class name ID
310            * @param classPK the class p k
311            * @return the matching contacts
312            */
313            public java.util.List<Contact> findByC_C(long classNameId, long classPK);
314    
315            /**
316            * Returns a range of all the contacts where classNameId = &#63; and classPK = &#63;.
317            *
318            * <p>
319            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
320            * </p>
321            *
322            * @param classNameId the class name ID
323            * @param classPK the class p k
324            * @param start the lower bound of the range of contacts
325            * @param end the upper bound of the range of contacts (not inclusive)
326            * @return the range of matching contacts
327            */
328            public java.util.List<Contact> findByC_C(long classNameId, long classPK,
329                    int start, int end);
330    
331            /**
332            * Returns an ordered range of all the contacts where classNameId = &#63; and classPK = &#63;.
333            *
334            * <p>
335            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
336            * </p>
337            *
338            * @param classNameId the class name ID
339            * @param classPK the class p k
340            * @param start the lower bound of the range of contacts
341            * @param end the upper bound of the range of contacts (not inclusive)
342            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
343            * @return the ordered range of matching contacts
344            */
345            public java.util.List<Contact> findByC_C(long classNameId, long classPK,
346                    int start, int end,
347                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
348    
349            /**
350            * Returns an ordered range of all the contacts where classNameId = &#63; and classPK = &#63;.
351            *
352            * <p>
353            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
354            * </p>
355            *
356            * @param classNameId the class name ID
357            * @param classPK the class p k
358            * @param start the lower bound of the range of contacts
359            * @param end the upper bound of the range of contacts (not inclusive)
360            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
361            * @param retrieveFromCache whether to retrieve from the finder cache
362            * @return the ordered range of matching contacts
363            */
364            public java.util.List<Contact> findByC_C(long classNameId, long classPK,
365                    int start, int end,
366                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator,
367                    boolean retrieveFromCache);
368    
369            /**
370            * Returns the first contact in the ordered set where classNameId = &#63; and classPK = &#63;.
371            *
372            * @param classNameId the class name ID
373            * @param classPK the class p k
374            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
375            * @return the first matching contact
376            * @throws NoSuchContactException if a matching contact could not be found
377            */
378            public Contact findByC_C_First(long classNameId, long classPK,
379                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
380                    throws NoSuchContactException;
381    
382            /**
383            * Returns the first contact in the ordered set where classNameId = &#63; and classPK = &#63;.
384            *
385            * @param classNameId the class name ID
386            * @param classPK the class p k
387            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
388            * @return the first matching contact, or <code>null</code> if a matching contact could not be found
389            */
390            public Contact fetchByC_C_First(long classNameId, long classPK,
391                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
392    
393            /**
394            * Returns the last contact in the ordered set where classNameId = &#63; and classPK = &#63;.
395            *
396            * @param classNameId the class name ID
397            * @param classPK the class p k
398            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
399            * @return the last matching contact
400            * @throws NoSuchContactException if a matching contact could not be found
401            */
402            public Contact findByC_C_Last(long classNameId, long classPK,
403                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
404                    throws NoSuchContactException;
405    
406            /**
407            * Returns the last contact in the ordered set where classNameId = &#63; and classPK = &#63;.
408            *
409            * @param classNameId the class name ID
410            * @param classPK the class p k
411            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
412            * @return the last matching contact, or <code>null</code> if a matching contact could not be found
413            */
414            public Contact fetchByC_C_Last(long classNameId, long classPK,
415                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
416    
417            /**
418            * Returns the contacts before and after the current contact in the ordered set where classNameId = &#63; and classPK = &#63;.
419            *
420            * @param contactId the primary key of the current contact
421            * @param classNameId the class name ID
422            * @param classPK the class p k
423            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
424            * @return the previous, current, and next contact
425            * @throws NoSuchContactException if a contact with the primary key could not be found
426            */
427            public Contact[] findByC_C_PrevAndNext(long contactId, long classNameId,
428                    long classPK,
429                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator)
430                    throws NoSuchContactException;
431    
432            /**
433            * Removes all the contacts where classNameId = &#63; and classPK = &#63; from the database.
434            *
435            * @param classNameId the class name ID
436            * @param classPK the class p k
437            */
438            public void removeByC_C(long classNameId, long classPK);
439    
440            /**
441            * Returns the number of contacts where classNameId = &#63; and classPK = &#63;.
442            *
443            * @param classNameId the class name ID
444            * @param classPK the class p k
445            * @return the number of matching contacts
446            */
447            public int countByC_C(long classNameId, long classPK);
448    
449            /**
450            * Caches the contact in the entity cache if it is enabled.
451            *
452            * @param contact the contact
453            */
454            public void cacheResult(Contact contact);
455    
456            /**
457            * Caches the contacts in the entity cache if it is enabled.
458            *
459            * @param contacts the contacts
460            */
461            public void cacheResult(java.util.List<Contact> contacts);
462    
463            /**
464            * Creates a new contact with the primary key. Does not add the contact to the database.
465            *
466            * @param contactId the primary key for the new contact
467            * @return the new contact
468            */
469            public Contact create(long contactId);
470    
471            /**
472            * Removes the contact with the primary key from the database. Also notifies the appropriate model listeners.
473            *
474            * @param contactId the primary key of the contact
475            * @return the contact that was removed
476            * @throws NoSuchContactException if a contact with the primary key could not be found
477            */
478            public Contact remove(long contactId) throws NoSuchContactException;
479    
480            public Contact updateImpl(Contact contact);
481    
482            /**
483            * Returns the contact with the primary key or throws a {@link NoSuchContactException} if it could not be found.
484            *
485            * @param contactId the primary key of the contact
486            * @return the contact
487            * @throws NoSuchContactException if a contact with the primary key could not be found
488            */
489            public Contact findByPrimaryKey(long contactId)
490                    throws NoSuchContactException;
491    
492            /**
493            * Returns the contact with the primary key or returns <code>null</code> if it could not be found.
494            *
495            * @param contactId the primary key of the contact
496            * @return the contact, or <code>null</code> if a contact with the primary key could not be found
497            */
498            public Contact fetchByPrimaryKey(long contactId);
499    
500            @Override
501            public java.util.Map<java.io.Serializable, Contact> fetchByPrimaryKeys(
502                    java.util.Set<java.io.Serializable> primaryKeys);
503    
504            /**
505            * Returns all the contacts.
506            *
507            * @return the contacts
508            */
509            public java.util.List<Contact> findAll();
510    
511            /**
512            * Returns a range of all the contacts.
513            *
514            * <p>
515            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
516            * </p>
517            *
518            * @param start the lower bound of the range of contacts
519            * @param end the upper bound of the range of contacts (not inclusive)
520            * @return the range of contacts
521            */
522            public java.util.List<Contact> findAll(int start, int end);
523    
524            /**
525            * Returns an ordered range of all the contacts.
526            *
527            * <p>
528            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
529            * </p>
530            *
531            * @param start the lower bound of the range of contacts
532            * @param end the upper bound of the range of contacts (not inclusive)
533            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
534            * @return the ordered range of contacts
535            */
536            public java.util.List<Contact> findAll(int start, int end,
537                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator);
538    
539            /**
540            * Returns an ordered range of all the contacts.
541            *
542            * <p>
543            * 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 QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
544            * </p>
545            *
546            * @param start the lower bound of the range of contacts
547            * @param end the upper bound of the range of contacts (not inclusive)
548            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
549            * @param retrieveFromCache whether to retrieve from the finder cache
550            * @return the ordered range of contacts
551            */
552            public java.util.List<Contact> findAll(int start, int end,
553                    com.liferay.portal.kernel.util.OrderByComparator<Contact> orderByComparator,
554                    boolean retrieveFromCache);
555    
556            /**
557            * Removes all the contacts from the database.
558            */
559            public void removeAll();
560    
561            /**
562            * Returns the number of contacts.
563            *
564            * @return the number of contacts
565            */
566            public int countAll();
567    }