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