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