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