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