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 com.liferay.portal.service.persistence.impl.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 com.liferay.portal.service.persistence.impl.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 List<Contact> findByCompanyId(long companyId) {
116                    return getPersistence().findByCompanyId(companyId);
117            }
118    
119            /**
120            * Returns a range of all the contacts where companyId = &#63;.
121            *
122            * <p>
123            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
124            * </p>
125            *
126            * @param companyId the company ID
127            * @param start the lower bound of the range of contacts
128            * @param end the upper bound of the range of contacts (not inclusive)
129            * @return the range of matching contacts
130            */
131            public static List<Contact> findByCompanyId(long companyId, int start,
132                    int end) {
133                    return getPersistence().findByCompanyId(companyId, start, end);
134            }
135    
136            /**
137            * Returns an ordered range of all the contacts where companyId = &#63;.
138            *
139            * <p>
140            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
141            * </p>
142            *
143            * @param companyId the company ID
144            * @param start the lower bound of the range of contacts
145            * @param end the upper bound of the range of contacts (not inclusive)
146            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
147            * @return the ordered range of matching contacts
148            */
149            public static List<Contact> findByCompanyId(long companyId, int start,
150                    int end, OrderByComparator<Contact> orderByComparator) {
151                    return getPersistence()
152                                       .findByCompanyId(companyId, start, end, orderByComparator);
153            }
154    
155            /**
156            * Returns the first contact in the ordered set where companyId = &#63;.
157            *
158            * @param companyId the company ID
159            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
160            * @return the first matching contact
161            * @throws NoSuchContactException if a matching contact could not be found
162            */
163            public static Contact findByCompanyId_First(long companyId,
164                    OrderByComparator<Contact> orderByComparator)
165                    throws com.liferay.portal.NoSuchContactException {
166                    return getPersistence()
167                                       .findByCompanyId_First(companyId, orderByComparator);
168            }
169    
170            /**
171            * Returns the first contact in the ordered set where companyId = &#63;.
172            *
173            * @param companyId the company ID
174            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
175            * @return the first matching contact, or <code>null</code> if a matching contact could not be found
176            */
177            public static Contact fetchByCompanyId_First(long companyId,
178                    OrderByComparator<Contact> orderByComparator) {
179                    return getPersistence()
180                                       .fetchByCompanyId_First(companyId, orderByComparator);
181            }
182    
183            /**
184            * Returns the last contact in the ordered set where companyId = &#63;.
185            *
186            * @param companyId the company ID
187            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
188            * @return the last matching contact
189            * @throws NoSuchContactException if a matching contact could not be found
190            */
191            public static Contact findByCompanyId_Last(long companyId,
192                    OrderByComparator<Contact> orderByComparator)
193                    throws com.liferay.portal.NoSuchContactException {
194                    return getPersistence()
195                                       .findByCompanyId_Last(companyId, orderByComparator);
196            }
197    
198            /**
199            * Returns the last contact in the ordered set where companyId = &#63;.
200            *
201            * @param companyId the company ID
202            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
203            * @return the last matching contact, or <code>null</code> if a matching contact could not be found
204            */
205            public static Contact fetchByCompanyId_Last(long companyId,
206                    OrderByComparator<Contact> orderByComparator) {
207                    return getPersistence()
208                                       .fetchByCompanyId_Last(companyId, orderByComparator);
209            }
210    
211            /**
212            * Returns the contacts before and after the current contact in the ordered set where companyId = &#63;.
213            *
214            * @param contactId the primary key of the current contact
215            * @param companyId the company ID
216            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
217            * @return the previous, current, and next contact
218            * @throws NoSuchContactException if a contact with the primary key could not be found
219            */
220            public static Contact[] findByCompanyId_PrevAndNext(long contactId,
221                    long companyId, OrderByComparator<Contact> orderByComparator)
222                    throws com.liferay.portal.NoSuchContactException {
223                    return getPersistence()
224                                       .findByCompanyId_PrevAndNext(contactId, companyId,
225                            orderByComparator);
226            }
227    
228            /**
229            * Removes all the contacts where companyId = &#63; from the database.
230            *
231            * @param companyId the company ID
232            */
233            public static void removeByCompanyId(long companyId) {
234                    getPersistence().removeByCompanyId(companyId);
235            }
236    
237            /**
238            * Returns the number of contacts where companyId = &#63;.
239            *
240            * @param companyId the company ID
241            * @return the number of matching contacts
242            */
243            public static int countByCompanyId(long companyId) {
244                    return getPersistence().countByCompanyId(companyId);
245            }
246    
247            /**
248            * Returns all the contacts where accountId = &#63;.
249            *
250            * @param accountId the account ID
251            * @return the matching contacts
252            */
253            public static List<Contact> findByAccountId(long accountId) {
254                    return getPersistence().findByAccountId(accountId);
255            }
256    
257            /**
258            * Returns a range of all the contacts where accountId = &#63;.
259            *
260            * <p>
261            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
262            * </p>
263            *
264            * @param accountId the account ID
265            * @param start the lower bound of the range of contacts
266            * @param end the upper bound of the range of contacts (not inclusive)
267            * @return the range of matching contacts
268            */
269            public static List<Contact> findByAccountId(long accountId, int start,
270                    int end) {
271                    return getPersistence().findByAccountId(accountId, start, end);
272            }
273    
274            /**
275            * Returns an ordered range of all the contacts where accountId = &#63;.
276            *
277            * <p>
278            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
279            * </p>
280            *
281            * @param accountId the account ID
282            * @param start the lower bound of the range of contacts
283            * @param end the upper bound of the range of contacts (not inclusive)
284            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
285            * @return the ordered range of matching contacts
286            */
287            public static List<Contact> findByAccountId(long accountId, int start,
288                    int end, OrderByComparator<Contact> orderByComparator) {
289                    return getPersistence()
290                                       .findByAccountId(accountId, start, end, orderByComparator);
291            }
292    
293            /**
294            * Returns the first contact in the ordered set where accountId = &#63;.
295            *
296            * @param accountId the account ID
297            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
298            * @return the first matching contact
299            * @throws NoSuchContactException if a matching contact could not be found
300            */
301            public static Contact findByAccountId_First(long accountId,
302                    OrderByComparator<Contact> orderByComparator)
303                    throws com.liferay.portal.NoSuchContactException {
304                    return getPersistence()
305                                       .findByAccountId_First(accountId, orderByComparator);
306            }
307    
308            /**
309            * Returns the first contact in the ordered set where accountId = &#63;.
310            *
311            * @param accountId the account ID
312            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
313            * @return the first matching contact, or <code>null</code> if a matching contact could not be found
314            */
315            public static Contact fetchByAccountId_First(long accountId,
316                    OrderByComparator<Contact> orderByComparator) {
317                    return getPersistence()
318                                       .fetchByAccountId_First(accountId, orderByComparator);
319            }
320    
321            /**
322            * Returns the last contact in the ordered set where accountId = &#63;.
323            *
324            * @param accountId the account ID
325            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
326            * @return the last matching contact
327            * @throws NoSuchContactException if a matching contact could not be found
328            */
329            public static Contact findByAccountId_Last(long accountId,
330                    OrderByComparator<Contact> orderByComparator)
331                    throws com.liferay.portal.NoSuchContactException {
332                    return getPersistence()
333                                       .findByAccountId_Last(accountId, orderByComparator);
334            }
335    
336            /**
337            * Returns the last contact in the ordered set where accountId = &#63;.
338            *
339            * @param accountId the account ID
340            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
341            * @return the last matching contact, or <code>null</code> if a matching contact could not be found
342            */
343            public static Contact fetchByAccountId_Last(long accountId,
344                    OrderByComparator<Contact> orderByComparator) {
345                    return getPersistence()
346                                       .fetchByAccountId_Last(accountId, orderByComparator);
347            }
348    
349            /**
350            * Returns the contacts before and after the current contact in the ordered set where accountId = &#63;.
351            *
352            * @param contactId the primary key of the current contact
353            * @param accountId the account ID
354            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
355            * @return the previous, current, and next contact
356            * @throws NoSuchContactException if a contact with the primary key could not be found
357            */
358            public static Contact[] findByAccountId_PrevAndNext(long contactId,
359                    long accountId, OrderByComparator<Contact> orderByComparator)
360                    throws com.liferay.portal.NoSuchContactException {
361                    return getPersistence()
362                                       .findByAccountId_PrevAndNext(contactId, accountId,
363                            orderByComparator);
364            }
365    
366            /**
367            * Removes all the contacts where accountId = &#63; from the database.
368            *
369            * @param accountId the account ID
370            */
371            public static void removeByAccountId(long accountId) {
372                    getPersistence().removeByAccountId(accountId);
373            }
374    
375            /**
376            * Returns the number of contacts where accountId = &#63;.
377            *
378            * @param accountId the account ID
379            * @return the number of matching contacts
380            */
381            public static int countByAccountId(long accountId) {
382                    return getPersistence().countByAccountId(accountId);
383            }
384    
385            /**
386            * Returns all the contacts where classNameId = &#63; and classPK = &#63;.
387            *
388            * @param classNameId the class name ID
389            * @param classPK the class p k
390            * @return the matching contacts
391            */
392            public static List<Contact> findByC_C(long classNameId, long classPK) {
393                    return getPersistence().findByC_C(classNameId, classPK);
394            }
395    
396            /**
397            * Returns a range of all the contacts where classNameId = &#63; and classPK = &#63;.
398            *
399            * <p>
400            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
401            * </p>
402            *
403            * @param classNameId the class name ID
404            * @param classPK the class p k
405            * @param start the lower bound of the range of contacts
406            * @param end the upper bound of the range of contacts (not inclusive)
407            * @return the range of matching contacts
408            */
409            public static List<Contact> findByC_C(long classNameId, long classPK,
410                    int start, int end) {
411                    return getPersistence().findByC_C(classNameId, classPK, start, end);
412            }
413    
414            /**
415            * Returns an ordered range of all the contacts where classNameId = &#63; and classPK = &#63;.
416            *
417            * <p>
418            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
419            * </p>
420            *
421            * @param classNameId the class name ID
422            * @param classPK the class p k
423            * @param start the lower bound of the range of contacts
424            * @param end the upper bound of the range of contacts (not inclusive)
425            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
426            * @return the ordered range of matching contacts
427            */
428            public static List<Contact> findByC_C(long classNameId, long classPK,
429                    int start, int end, OrderByComparator<Contact> orderByComparator) {
430                    return getPersistence()
431                                       .findByC_C(classNameId, classPK, start, end,
432                            orderByComparator);
433            }
434    
435            /**
436            * Returns the first contact in the ordered set where classNameId = &#63; and classPK = &#63;.
437            *
438            * @param classNameId the class name ID
439            * @param classPK the class p k
440            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
441            * @return the first matching contact
442            * @throws NoSuchContactException if a matching contact could not be found
443            */
444            public static Contact findByC_C_First(long classNameId, long classPK,
445                    OrderByComparator<Contact> orderByComparator)
446                    throws com.liferay.portal.NoSuchContactException {
447                    return getPersistence()
448                                       .findByC_C_First(classNameId, classPK, 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, or <code>null</code> if a matching contact could not be found
458            */
459            public static Contact fetchByC_C_First(long classNameId, long classPK,
460                    OrderByComparator<Contact> orderByComparator) {
461                    return getPersistence()
462                                       .fetchByC_C_First(classNameId, classPK, orderByComparator);
463            }
464    
465            /**
466            * Returns the last contact in the ordered set where classNameId = &#63; and classPK = &#63;.
467            *
468            * @param classNameId the class name ID
469            * @param classPK the class p k
470            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
471            * @return the last matching contact
472            * @throws NoSuchContactException if a matching contact could not be found
473            */
474            public static Contact findByC_C_Last(long classNameId, long classPK,
475                    OrderByComparator<Contact> orderByComparator)
476                    throws com.liferay.portal.NoSuchContactException {
477                    return getPersistence()
478                                       .findByC_C_Last(classNameId, classPK, orderByComparator);
479            }
480    
481            /**
482            * Returns the last contact in the ordered set where classNameId = &#63; and classPK = &#63;.
483            *
484            * @param classNameId the class name ID
485            * @param classPK the class p k
486            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
487            * @return the last matching contact, or <code>null</code> if a matching contact could not be found
488            */
489            public static Contact fetchByC_C_Last(long classNameId, long classPK,
490                    OrderByComparator<Contact> orderByComparator) {
491                    return getPersistence()
492                                       .fetchByC_C_Last(classNameId, classPK, orderByComparator);
493            }
494    
495            /**
496            * Returns the contacts before and after the current contact in the ordered set where classNameId = &#63; and classPK = &#63;.
497            *
498            * @param contactId the primary key of the current contact
499            * @param classNameId the class name ID
500            * @param classPK the class p k
501            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
502            * @return the previous, current, and next contact
503            * @throws NoSuchContactException if a contact with the primary key could not be found
504            */
505            public static Contact[] findByC_C_PrevAndNext(long contactId,
506                    long classNameId, long classPK,
507                    OrderByComparator<Contact> orderByComparator)
508                    throws com.liferay.portal.NoSuchContactException {
509                    return getPersistence()
510                                       .findByC_C_PrevAndNext(contactId, classNameId, classPK,
511                            orderByComparator);
512            }
513    
514            /**
515            * Removes all the contacts where classNameId = &#63; and classPK = &#63; from the database.
516            *
517            * @param classNameId the class name ID
518            * @param classPK the class p k
519            */
520            public static void removeByC_C(long classNameId, long classPK) {
521                    getPersistence().removeByC_C(classNameId, classPK);
522            }
523    
524            /**
525            * Returns the number of contacts where classNameId = &#63; and classPK = &#63;.
526            *
527            * @param classNameId the class name ID
528            * @param classPK the class p k
529            * @return the number of matching contacts
530            */
531            public static int countByC_C(long classNameId, long classPK) {
532                    return getPersistence().countByC_C(classNameId, classPK);
533            }
534    
535            /**
536            * Caches the contact in the entity cache if it is enabled.
537            *
538            * @param contact the contact
539            */
540            public static void cacheResult(Contact contact) {
541                    getPersistence().cacheResult(contact);
542            }
543    
544            /**
545            * Caches the contacts in the entity cache if it is enabled.
546            *
547            * @param contacts the contacts
548            */
549            public static void cacheResult(List<Contact> contacts) {
550                    getPersistence().cacheResult(contacts);
551            }
552    
553            /**
554            * Creates a new contact with the primary key. Does not add the contact to the database.
555            *
556            * @param contactId the primary key for the new contact
557            * @return the new contact
558            */
559            public static Contact create(long contactId) {
560                    return getPersistence().create(contactId);
561            }
562    
563            /**
564            * Removes the contact with the primary key from the database. Also notifies the appropriate model listeners.
565            *
566            * @param contactId the primary key of the contact
567            * @return the contact that was removed
568            * @throws NoSuchContactException if a contact with the primary key could not be found
569            */
570            public static Contact remove(long contactId)
571                    throws com.liferay.portal.NoSuchContactException {
572                    return getPersistence().remove(contactId);
573            }
574    
575            public static Contact updateImpl(Contact contact) {
576                    return getPersistence().updateImpl(contact);
577            }
578    
579            /**
580            * Returns the contact with the primary key or throws a {@link NoSuchContactException} if it could not be found.
581            *
582            * @param contactId the primary key of the contact
583            * @return the contact
584            * @throws NoSuchContactException if a contact with the primary key could not be found
585            */
586            public static Contact findByPrimaryKey(long contactId)
587                    throws com.liferay.portal.NoSuchContactException {
588                    return getPersistence().findByPrimaryKey(contactId);
589            }
590    
591            /**
592            * Returns the contact with the primary key or returns <code>null</code> if it could not be found.
593            *
594            * @param contactId the primary key of the contact
595            * @return the contact, or <code>null</code> if a contact with the primary key could not be found
596            */
597            public static Contact fetchByPrimaryKey(long contactId) {
598                    return getPersistence().fetchByPrimaryKey(contactId);
599            }
600    
601            public static java.util.Map<java.io.Serializable, Contact> fetchByPrimaryKeys(
602                    java.util.Set<java.io.Serializable> primaryKeys) {
603                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
604            }
605    
606            /**
607            * Returns all the contacts.
608            *
609            * @return the contacts
610            */
611            public static List<Contact> findAll() {
612                    return getPersistence().findAll();
613            }
614    
615            /**
616            * Returns a range of all the contacts.
617            *
618            * <p>
619            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
620            * </p>
621            *
622            * @param start the lower bound of the range of contacts
623            * @param end the upper bound of the range of contacts (not inclusive)
624            * @return the range of contacts
625            */
626            public static List<Contact> findAll(int start, int end) {
627                    return getPersistence().findAll(start, end);
628            }
629    
630            /**
631            * Returns an ordered range of all the contacts.
632            *
633            * <p>
634            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link ContactModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
635            * </p>
636            *
637            * @param start the lower bound of the range of contacts
638            * @param end the upper bound of the range of contacts (not inclusive)
639            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
640            * @return the ordered range of contacts
641            */
642            public static List<Contact> findAll(int start, int end,
643                    OrderByComparator<Contact> orderByComparator) {
644                    return getPersistence().findAll(start, end, orderByComparator);
645            }
646    
647            /**
648            * Removes all the contacts from the database.
649            */
650            public static void removeAll() {
651                    getPersistence().removeAll();
652            }
653    
654            /**
655            * Returns the number of contacts.
656            *
657            * @return the number of contacts
658            */
659            public static int countAll() {
660                    return getPersistence().countAll();
661            }
662    
663            public static ContactPersistence getPersistence() {
664                    if (_persistence == null) {
665                            _persistence = (ContactPersistence)PortalBeanLocatorUtil.locate(ContactPersistence.class.getName());
666    
667                            ReferenceRegistry.registerReference(ContactUtil.class,
668                                    "_persistence");
669                    }
670    
671                    return _persistence;
672            }
673    
674            /**
675             * @deprecated As of 6.2.0
676             */
677            @Deprecated
678            public void setPersistence(ContactPersistence persistence) {
679            }
680    
681            private static ContactPersistence _persistence;
682    }