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.Address;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the address service. This utility wraps {@link AddressPersistenceImpl} 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 AddressPersistence
036     * @see AddressPersistenceImpl
037     * @generated
038     */
039    public class AddressUtil {
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(Address address) {
057                    getPersistence().clearCache(address);
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<Address> 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<Address> 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<Address> 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 Address update(Address address) throws SystemException {
100                    return getPersistence().update(address);
101            }
102    
103            /**
104             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
105             */
106            public static Address update(Address address, ServiceContext serviceContext)
107                    throws SystemException {
108                    return getPersistence().update(address, serviceContext);
109            }
110    
111            /**
112            * Caches the address in the entity cache if it is enabled.
113            *
114            * @param address the address
115            */
116            public static void cacheResult(com.liferay.portal.model.Address address) {
117                    getPersistence().cacheResult(address);
118            }
119    
120            /**
121            * Caches the addresses in the entity cache if it is enabled.
122            *
123            * @param addresses the addresses
124            */
125            public static void cacheResult(
126                    java.util.List<com.liferay.portal.model.Address> addresses) {
127                    getPersistence().cacheResult(addresses);
128            }
129    
130            /**
131            * Creates a new address with the primary key. Does not add the address to the database.
132            *
133            * @param addressId the primary key for the new address
134            * @return the new address
135            */
136            public static com.liferay.portal.model.Address create(long addressId) {
137                    return getPersistence().create(addressId);
138            }
139    
140            /**
141            * Removes the address with the primary key from the database. Also notifies the appropriate model listeners.
142            *
143            * @param addressId the primary key of the address
144            * @return the address that was removed
145            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
146            * @throws SystemException if a system exception occurred
147            */
148            public static com.liferay.portal.model.Address remove(long addressId)
149                    throws com.liferay.portal.NoSuchAddressException,
150                            com.liferay.portal.kernel.exception.SystemException {
151                    return getPersistence().remove(addressId);
152            }
153    
154            public static com.liferay.portal.model.Address updateImpl(
155                    com.liferay.portal.model.Address address)
156                    throws com.liferay.portal.kernel.exception.SystemException {
157                    return getPersistence().updateImpl(address);
158            }
159    
160            /**
161            * Returns the address with the primary key or throws a {@link com.liferay.portal.NoSuchAddressException} if it could not be found.
162            *
163            * @param addressId the primary key of the address
164            * @return the address
165            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
166            * @throws SystemException if a system exception occurred
167            */
168            public static com.liferay.portal.model.Address findByPrimaryKey(
169                    long addressId)
170                    throws com.liferay.portal.NoSuchAddressException,
171                            com.liferay.portal.kernel.exception.SystemException {
172                    return getPersistence().findByPrimaryKey(addressId);
173            }
174    
175            /**
176            * Returns the address with the primary key or returns <code>null</code> if it could not be found.
177            *
178            * @param addressId the primary key of the address
179            * @return the address, or <code>null</code> if a address with the primary key could not be found
180            * @throws SystemException if a system exception occurred
181            */
182            public static com.liferay.portal.model.Address fetchByPrimaryKey(
183                    long addressId)
184                    throws com.liferay.portal.kernel.exception.SystemException {
185                    return getPersistence().fetchByPrimaryKey(addressId);
186            }
187    
188            /**
189            * Returns all the addresses where companyId = &#63;.
190            *
191            * @param companyId the company ID
192            * @return the matching addresses
193            * @throws SystemException if a system exception occurred
194            */
195            public static java.util.List<com.liferay.portal.model.Address> 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 addresses 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 addresses
210            * @param end the upper bound of the range of addresses (not inclusive)
211            * @return the range of matching addresses
212            * @throws SystemException if a system exception occurred
213            */
214            public static java.util.List<com.liferay.portal.model.Address> 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 addresses 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 addresses
229            * @param end the upper bound of the range of addresses (not inclusive)
230            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
231            * @return the ordered range of matching addresses
232            * @throws SystemException if a system exception occurred
233            */
234            public static java.util.List<com.liferay.portal.model.Address> 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 address 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 address
248            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
249            * @throws SystemException if a system exception occurred
250            */
251            public static com.liferay.portal.model.Address findByCompanyId_First(
252                    long companyId,
253                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
254                    throws com.liferay.portal.NoSuchAddressException,
255                            com.liferay.portal.kernel.exception.SystemException {
256                    return getPersistence()
257                                       .findByCompanyId_First(companyId, orderByComparator);
258            }
259    
260            /**
261            * Returns the first address 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 address, or <code>null</code> if a matching address could not be found
266            * @throws SystemException if a system exception occurred
267            */
268            public static com.liferay.portal.model.Address 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 address 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 address
282            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
283            * @throws SystemException if a system exception occurred
284            */
285            public static com.liferay.portal.model.Address findByCompanyId_Last(
286                    long companyId,
287                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
288                    throws com.liferay.portal.NoSuchAddressException,
289                            com.liferay.portal.kernel.exception.SystemException {
290                    return getPersistence()
291                                       .findByCompanyId_Last(companyId, orderByComparator);
292            }
293    
294            /**
295            * Returns the last address 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 address, or <code>null</code> if a matching address could not be found
300            * @throws SystemException if a system exception occurred
301            */
302            public static com.liferay.portal.model.Address 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 addresses before and after the current address in the ordered set where companyId = &#63;.
312            *
313            * @param addressId the primary key of the current address
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 address
317            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
318            * @throws SystemException if a system exception occurred
319            */
320            public static com.liferay.portal.model.Address[] findByCompanyId_PrevAndNext(
321                    long addressId, long companyId,
322                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
323                    throws com.liferay.portal.NoSuchAddressException,
324                            com.liferay.portal.kernel.exception.SystemException {
325                    return getPersistence()
326                                       .findByCompanyId_PrevAndNext(addressId, companyId,
327                            orderByComparator);
328            }
329    
330            /**
331            * Returns all the addresses where userId = &#63;.
332            *
333            * @param userId the user ID
334            * @return the matching addresses
335            * @throws SystemException if a system exception occurred
336            */
337            public static java.util.List<com.liferay.portal.model.Address> findByUserId(
338                    long userId) throws com.liferay.portal.kernel.exception.SystemException {
339                    return getPersistence().findByUserId(userId);
340            }
341    
342            /**
343            * Returns a range of all the addresses where userId = &#63;.
344            *
345            * <p>
346            * 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.
347            * </p>
348            *
349            * @param userId the user ID
350            * @param start the lower bound of the range of addresses
351            * @param end the upper bound of the range of addresses (not inclusive)
352            * @return the range of matching addresses
353            * @throws SystemException if a system exception occurred
354            */
355            public static java.util.List<com.liferay.portal.model.Address> findByUserId(
356                    long userId, int start, int end)
357                    throws com.liferay.portal.kernel.exception.SystemException {
358                    return getPersistence().findByUserId(userId, start, end);
359            }
360    
361            /**
362            * Returns an ordered range of all the addresses where userId = &#63;.
363            *
364            * <p>
365            * 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.
366            * </p>
367            *
368            * @param userId the user ID
369            * @param start the lower bound of the range of addresses
370            * @param end the upper bound of the range of addresses (not inclusive)
371            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
372            * @return the ordered range of matching addresses
373            * @throws SystemException if a system exception occurred
374            */
375            public static java.util.List<com.liferay.portal.model.Address> findByUserId(
376                    long userId, int start, int end,
377                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
378                    throws com.liferay.portal.kernel.exception.SystemException {
379                    return getPersistence()
380                                       .findByUserId(userId, start, end, orderByComparator);
381            }
382    
383            /**
384            * Returns the first address in the ordered set where userId = &#63;.
385            *
386            * @param userId the user ID
387            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
388            * @return the first matching address
389            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
390            * @throws SystemException if a system exception occurred
391            */
392            public static com.liferay.portal.model.Address findByUserId_First(
393                    long userId,
394                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
395                    throws com.liferay.portal.NoSuchAddressException,
396                            com.liferay.portal.kernel.exception.SystemException {
397                    return getPersistence().findByUserId_First(userId, orderByComparator);
398            }
399    
400            /**
401            * Returns the first address in the ordered set where userId = &#63;.
402            *
403            * @param userId the user ID
404            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
405            * @return the first matching address, or <code>null</code> if a matching address could not be found
406            * @throws SystemException if a system exception occurred
407            */
408            public static com.liferay.portal.model.Address fetchByUserId_First(
409                    long userId,
410                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
411                    throws com.liferay.portal.kernel.exception.SystemException {
412                    return getPersistence().fetchByUserId_First(userId, orderByComparator);
413            }
414    
415            /**
416            * Returns the last address in the ordered set where userId = &#63;.
417            *
418            * @param userId the user ID
419            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
420            * @return the last matching address
421            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
422            * @throws SystemException if a system exception occurred
423            */
424            public static com.liferay.portal.model.Address findByUserId_Last(
425                    long userId,
426                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
427                    throws com.liferay.portal.NoSuchAddressException,
428                            com.liferay.portal.kernel.exception.SystemException {
429                    return getPersistence().findByUserId_Last(userId, orderByComparator);
430            }
431    
432            /**
433            * Returns the last address in the ordered set where userId = &#63;.
434            *
435            * @param userId the user ID
436            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
437            * @return the last matching address, or <code>null</code> if a matching address could not be found
438            * @throws SystemException if a system exception occurred
439            */
440            public static com.liferay.portal.model.Address fetchByUserId_Last(
441                    long userId,
442                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
443                    throws com.liferay.portal.kernel.exception.SystemException {
444                    return getPersistence().fetchByUserId_Last(userId, orderByComparator);
445            }
446    
447            /**
448            * Returns the addresses before and after the current address in the ordered set where userId = &#63;.
449            *
450            * @param addressId the primary key of the current address
451            * @param userId the user ID
452            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
453            * @return the previous, current, and next address
454            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
455            * @throws SystemException if a system exception occurred
456            */
457            public static com.liferay.portal.model.Address[] findByUserId_PrevAndNext(
458                    long addressId, long userId,
459                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
460                    throws com.liferay.portal.NoSuchAddressException,
461                            com.liferay.portal.kernel.exception.SystemException {
462                    return getPersistence()
463                                       .findByUserId_PrevAndNext(addressId, userId,
464                            orderByComparator);
465            }
466    
467            /**
468            * Returns all the addresses where companyId = &#63; and classNameId = &#63;.
469            *
470            * @param companyId the company ID
471            * @param classNameId the class name ID
472            * @return the matching addresses
473            * @throws SystemException if a system exception occurred
474            */
475            public static java.util.List<com.liferay.portal.model.Address> findByC_C(
476                    long companyId, long classNameId)
477                    throws com.liferay.portal.kernel.exception.SystemException {
478                    return getPersistence().findByC_C(companyId, classNameId);
479            }
480    
481            /**
482            * Returns a range of all the addresses where companyId = &#63; and classNameId = &#63;.
483            *
484            * <p>
485            * 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.
486            * </p>
487            *
488            * @param companyId the company ID
489            * @param classNameId the class name ID
490            * @param start the lower bound of the range of addresses
491            * @param end the upper bound of the range of addresses (not inclusive)
492            * @return the range of matching addresses
493            * @throws SystemException if a system exception occurred
494            */
495            public static java.util.List<com.liferay.portal.model.Address> findByC_C(
496                    long companyId, long classNameId, int start, int end)
497                    throws com.liferay.portal.kernel.exception.SystemException {
498                    return getPersistence().findByC_C(companyId, classNameId, start, end);
499            }
500    
501            /**
502            * Returns an ordered range of all the addresses where companyId = &#63; and classNameId = &#63;.
503            *
504            * <p>
505            * 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.
506            * </p>
507            *
508            * @param companyId the company ID
509            * @param classNameId the class name ID
510            * @param start the lower bound of the range of addresses
511            * @param end the upper bound of the range of addresses (not inclusive)
512            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
513            * @return the ordered range of matching addresses
514            * @throws SystemException if a system exception occurred
515            */
516            public static java.util.List<com.liferay.portal.model.Address> findByC_C(
517                    long companyId, long classNameId, int start, int end,
518                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
519                    throws com.liferay.portal.kernel.exception.SystemException {
520                    return getPersistence()
521                                       .findByC_C(companyId, classNameId, start, end,
522                            orderByComparator);
523            }
524    
525            /**
526            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63;.
527            *
528            * @param companyId the company ID
529            * @param classNameId the class name ID
530            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
531            * @return the first matching address
532            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
533            * @throws SystemException if a system exception occurred
534            */
535            public static com.liferay.portal.model.Address findByC_C_First(
536                    long companyId, long classNameId,
537                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
538                    throws com.liferay.portal.NoSuchAddressException,
539                            com.liferay.portal.kernel.exception.SystemException {
540                    return getPersistence()
541                                       .findByC_C_First(companyId, classNameId, orderByComparator);
542            }
543    
544            /**
545            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63;.
546            *
547            * @param companyId the company ID
548            * @param classNameId the class name ID
549            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
550            * @return the first matching address, or <code>null</code> if a matching address could not be found
551            * @throws SystemException if a system exception occurred
552            */
553            public static com.liferay.portal.model.Address fetchByC_C_First(
554                    long companyId, long classNameId,
555                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
556                    throws com.liferay.portal.kernel.exception.SystemException {
557                    return getPersistence()
558                                       .fetchByC_C_First(companyId, classNameId, orderByComparator);
559            }
560    
561            /**
562            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63;.
563            *
564            * @param companyId the company ID
565            * @param classNameId the class name ID
566            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
567            * @return the last matching address
568            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
569            * @throws SystemException if a system exception occurred
570            */
571            public static com.liferay.portal.model.Address findByC_C_Last(
572                    long companyId, long classNameId,
573                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
574                    throws com.liferay.portal.NoSuchAddressException,
575                            com.liferay.portal.kernel.exception.SystemException {
576                    return getPersistence()
577                                       .findByC_C_Last(companyId, classNameId, orderByComparator);
578            }
579    
580            /**
581            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63;.
582            *
583            * @param companyId the company ID
584            * @param classNameId the class name ID
585            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
586            * @return the last matching address, or <code>null</code> if a matching address could not be found
587            * @throws SystemException if a system exception occurred
588            */
589            public static com.liferay.portal.model.Address fetchByC_C_Last(
590                    long companyId, long classNameId,
591                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
592                    throws com.liferay.portal.kernel.exception.SystemException {
593                    return getPersistence()
594                                       .fetchByC_C_Last(companyId, classNameId, orderByComparator);
595            }
596    
597            /**
598            * Returns the addresses before and after the current address in the ordered set where companyId = &#63; and classNameId = &#63;.
599            *
600            * @param addressId the primary key of the current address
601            * @param companyId the company ID
602            * @param classNameId the class name ID
603            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
604            * @return the previous, current, and next address
605            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
606            * @throws SystemException if a system exception occurred
607            */
608            public static com.liferay.portal.model.Address[] findByC_C_PrevAndNext(
609                    long addressId, long companyId, long classNameId,
610                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
611                    throws com.liferay.portal.NoSuchAddressException,
612                            com.liferay.portal.kernel.exception.SystemException {
613                    return getPersistence()
614                                       .findByC_C_PrevAndNext(addressId, companyId, classNameId,
615                            orderByComparator);
616            }
617    
618            /**
619            * Returns all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
620            *
621            * @param companyId the company ID
622            * @param classNameId the class name ID
623            * @param classPK the class p k
624            * @return the matching addresses
625            * @throws SystemException if a system exception occurred
626            */
627            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
628                    long companyId, long classNameId, long classPK)
629                    throws com.liferay.portal.kernel.exception.SystemException {
630                    return getPersistence().findByC_C_C(companyId, classNameId, classPK);
631            }
632    
633            /**
634            * Returns a range of all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
635            *
636            * <p>
637            * 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.
638            * </p>
639            *
640            * @param companyId the company ID
641            * @param classNameId the class name ID
642            * @param classPK the class p k
643            * @param start the lower bound of the range of addresses
644            * @param end the upper bound of the range of addresses (not inclusive)
645            * @return the range of matching addresses
646            * @throws SystemException if a system exception occurred
647            */
648            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
649                    long companyId, long classNameId, long classPK, int start, int end)
650                    throws com.liferay.portal.kernel.exception.SystemException {
651                    return getPersistence()
652                                       .findByC_C_C(companyId, classNameId, classPK, start, end);
653            }
654    
655            /**
656            * Returns an ordered range of all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
657            *
658            * <p>
659            * 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.
660            * </p>
661            *
662            * @param companyId the company ID
663            * @param classNameId the class name ID
664            * @param classPK the class p k
665            * @param start the lower bound of the range of addresses
666            * @param end the upper bound of the range of addresses (not inclusive)
667            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
668            * @return the ordered range of matching addresses
669            * @throws SystemException if a system exception occurred
670            */
671            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C(
672                    long companyId, long classNameId, long classPK, int start, int end,
673                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
674                    throws com.liferay.portal.kernel.exception.SystemException {
675                    return getPersistence()
676                                       .findByC_C_C(companyId, classNameId, classPK, start, end,
677                            orderByComparator);
678            }
679    
680            /**
681            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
682            *
683            * @param companyId the company ID
684            * @param classNameId the class name ID
685            * @param classPK the class p k
686            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
687            * @return the first matching address
688            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
689            * @throws SystemException if a system exception occurred
690            */
691            public static com.liferay.portal.model.Address findByC_C_C_First(
692                    long companyId, long classNameId, long classPK,
693                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
694                    throws com.liferay.portal.NoSuchAddressException,
695                            com.liferay.portal.kernel.exception.SystemException {
696                    return getPersistence()
697                                       .findByC_C_C_First(companyId, classNameId, classPK,
698                            orderByComparator);
699            }
700    
701            /**
702            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
703            *
704            * @param companyId the company ID
705            * @param classNameId the class name ID
706            * @param classPK the class p k
707            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
708            * @return the first matching address, or <code>null</code> if a matching address could not be found
709            * @throws SystemException if a system exception occurred
710            */
711            public static com.liferay.portal.model.Address fetchByC_C_C_First(
712                    long companyId, long classNameId, long classPK,
713                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
714                    throws com.liferay.portal.kernel.exception.SystemException {
715                    return getPersistence()
716                                       .fetchByC_C_C_First(companyId, classNameId, classPK,
717                            orderByComparator);
718            }
719    
720            /**
721            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
722            *
723            * @param companyId the company ID
724            * @param classNameId the class name ID
725            * @param classPK the class p k
726            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
727            * @return the last matching address
728            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
729            * @throws SystemException if a system exception occurred
730            */
731            public static com.liferay.portal.model.Address findByC_C_C_Last(
732                    long companyId, long classNameId, long classPK,
733                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
734                    throws com.liferay.portal.NoSuchAddressException,
735                            com.liferay.portal.kernel.exception.SystemException {
736                    return getPersistence()
737                                       .findByC_C_C_Last(companyId, classNameId, classPK,
738                            orderByComparator);
739            }
740    
741            /**
742            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
743            *
744            * @param companyId the company ID
745            * @param classNameId the class name ID
746            * @param classPK the class p k
747            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
748            * @return the last matching address, or <code>null</code> if a matching address could not be found
749            * @throws SystemException if a system exception occurred
750            */
751            public static com.liferay.portal.model.Address fetchByC_C_C_Last(
752                    long companyId, long classNameId, long classPK,
753                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
754                    throws com.liferay.portal.kernel.exception.SystemException {
755                    return getPersistence()
756                                       .fetchByC_C_C_Last(companyId, classNameId, classPK,
757                            orderByComparator);
758            }
759    
760            /**
761            * Returns the addresses before and after the current address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
762            *
763            * @param addressId the primary key of the current address
764            * @param companyId the company ID
765            * @param classNameId the class name ID
766            * @param classPK the class p k
767            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
768            * @return the previous, current, and next address
769            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
770            * @throws SystemException if a system exception occurred
771            */
772            public static com.liferay.portal.model.Address[] findByC_C_C_PrevAndNext(
773                    long addressId, long companyId, long classNameId, long classPK,
774                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
775                    throws com.liferay.portal.NoSuchAddressException,
776                            com.liferay.portal.kernel.exception.SystemException {
777                    return getPersistence()
778                                       .findByC_C_C_PrevAndNext(addressId, companyId, classNameId,
779                            classPK, orderByComparator);
780            }
781    
782            /**
783            * Returns all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
784            *
785            * @param companyId the company ID
786            * @param classNameId the class name ID
787            * @param classPK the class p k
788            * @param mailing the mailing
789            * @return the matching addresses
790            * @throws SystemException if a system exception occurred
791            */
792            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
793                    long companyId, long classNameId, long classPK, boolean mailing)
794                    throws com.liferay.portal.kernel.exception.SystemException {
795                    return getPersistence()
796                                       .findByC_C_C_M(companyId, classNameId, classPK, mailing);
797            }
798    
799            /**
800            * Returns a range of all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
801            *
802            * <p>
803            * 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.
804            * </p>
805            *
806            * @param companyId the company ID
807            * @param classNameId the class name ID
808            * @param classPK the class p k
809            * @param mailing the mailing
810            * @param start the lower bound of the range of addresses
811            * @param end the upper bound of the range of addresses (not inclusive)
812            * @return the range of matching addresses
813            * @throws SystemException if a system exception occurred
814            */
815            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
816                    long companyId, long classNameId, long classPK, boolean mailing,
817                    int start, int end)
818                    throws com.liferay.portal.kernel.exception.SystemException {
819                    return getPersistence()
820                                       .findByC_C_C_M(companyId, classNameId, classPK, mailing,
821                            start, end);
822            }
823    
824            /**
825            * Returns an ordered range of all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
826            *
827            * <p>
828            * 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.
829            * </p>
830            *
831            * @param companyId the company ID
832            * @param classNameId the class name ID
833            * @param classPK the class p k
834            * @param mailing the mailing
835            * @param start the lower bound of the range of addresses
836            * @param end the upper bound of the range of addresses (not inclusive)
837            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
838            * @return the ordered range of matching addresses
839            * @throws SystemException if a system exception occurred
840            */
841            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_M(
842                    long companyId, long classNameId, long classPK, boolean mailing,
843                    int start, int end,
844                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
845                    throws com.liferay.portal.kernel.exception.SystemException {
846                    return getPersistence()
847                                       .findByC_C_C_M(companyId, classNameId, classPK, mailing,
848                            start, end, orderByComparator);
849            }
850    
851            /**
852            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
853            *
854            * @param companyId the company ID
855            * @param classNameId the class name ID
856            * @param classPK the class p k
857            * @param mailing the mailing
858            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
859            * @return the first matching address
860            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
861            * @throws SystemException if a system exception occurred
862            */
863            public static com.liferay.portal.model.Address findByC_C_C_M_First(
864                    long companyId, long classNameId, long classPK, boolean mailing,
865                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
866                    throws com.liferay.portal.NoSuchAddressException,
867                            com.liferay.portal.kernel.exception.SystemException {
868                    return getPersistence()
869                                       .findByC_C_C_M_First(companyId, classNameId, classPK,
870                            mailing, orderByComparator);
871            }
872    
873            /**
874            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
875            *
876            * @param companyId the company ID
877            * @param classNameId the class name ID
878            * @param classPK the class p k
879            * @param mailing the mailing
880            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
881            * @return the first matching address, or <code>null</code> if a matching address could not be found
882            * @throws SystemException if a system exception occurred
883            */
884            public static com.liferay.portal.model.Address fetchByC_C_C_M_First(
885                    long companyId, long classNameId, long classPK, boolean mailing,
886                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
887                    throws com.liferay.portal.kernel.exception.SystemException {
888                    return getPersistence()
889                                       .fetchByC_C_C_M_First(companyId, classNameId, classPK,
890                            mailing, orderByComparator);
891            }
892    
893            /**
894            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
895            *
896            * @param companyId the company ID
897            * @param classNameId the class name ID
898            * @param classPK the class p k
899            * @param mailing the mailing
900            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
901            * @return the last matching address
902            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
903            * @throws SystemException if a system exception occurred
904            */
905            public static com.liferay.portal.model.Address findByC_C_C_M_Last(
906                    long companyId, long classNameId, long classPK, boolean mailing,
907                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
908                    throws com.liferay.portal.NoSuchAddressException,
909                            com.liferay.portal.kernel.exception.SystemException {
910                    return getPersistence()
911                                       .findByC_C_C_M_Last(companyId, classNameId, classPK,
912                            mailing, orderByComparator);
913            }
914    
915            /**
916            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
917            *
918            * @param companyId the company ID
919            * @param classNameId the class name ID
920            * @param classPK the class p k
921            * @param mailing the mailing
922            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
923            * @return the last matching address, or <code>null</code> if a matching address could not be found
924            * @throws SystemException if a system exception occurred
925            */
926            public static com.liferay.portal.model.Address fetchByC_C_C_M_Last(
927                    long companyId, long classNameId, long classPK, boolean mailing,
928                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
929                    throws com.liferay.portal.kernel.exception.SystemException {
930                    return getPersistence()
931                                       .fetchByC_C_C_M_Last(companyId, classNameId, classPK,
932                            mailing, orderByComparator);
933            }
934    
935            /**
936            * Returns the addresses before and after the current address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
937            *
938            * @param addressId the primary key of the current address
939            * @param companyId the company ID
940            * @param classNameId the class name ID
941            * @param classPK the class p k
942            * @param mailing the mailing
943            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
944            * @return the previous, current, and next address
945            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
946            * @throws SystemException if a system exception occurred
947            */
948            public static com.liferay.portal.model.Address[] findByC_C_C_M_PrevAndNext(
949                    long addressId, long companyId, long classNameId, long classPK,
950                    boolean mailing,
951                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
952                    throws com.liferay.portal.NoSuchAddressException,
953                            com.liferay.portal.kernel.exception.SystemException {
954                    return getPersistence()
955                                       .findByC_C_C_M_PrevAndNext(addressId, companyId,
956                            classNameId, classPK, mailing, orderByComparator);
957            }
958    
959            /**
960            * Returns all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
961            *
962            * @param companyId the company ID
963            * @param classNameId the class name ID
964            * @param classPK the class p k
965            * @param primary the primary
966            * @return the matching addresses
967            * @throws SystemException if a system exception occurred
968            */
969            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
970                    long companyId, long classNameId, long classPK, boolean primary)
971                    throws com.liferay.portal.kernel.exception.SystemException {
972                    return getPersistence()
973                                       .findByC_C_C_P(companyId, classNameId, classPK, primary);
974            }
975    
976            /**
977            * Returns a range of all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
978            *
979            * <p>
980            * 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.
981            * </p>
982            *
983            * @param companyId the company ID
984            * @param classNameId the class name ID
985            * @param classPK the class p k
986            * @param primary the primary
987            * @param start the lower bound of the range of addresses
988            * @param end the upper bound of the range of addresses (not inclusive)
989            * @return the range of matching addresses
990            * @throws SystemException if a system exception occurred
991            */
992            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
993                    long companyId, long classNameId, long classPK, boolean primary,
994                    int start, int end)
995                    throws com.liferay.portal.kernel.exception.SystemException {
996                    return getPersistence()
997                                       .findByC_C_C_P(companyId, classNameId, classPK, primary,
998                            start, end);
999            }
1000    
1001            /**
1002            * Returns an ordered range of all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1003            *
1004            * <p>
1005            * 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.
1006            * </p>
1007            *
1008            * @param companyId the company ID
1009            * @param classNameId the class name ID
1010            * @param classPK the class p k
1011            * @param primary the primary
1012            * @param start the lower bound of the range of addresses
1013            * @param end the upper bound of the range of addresses (not inclusive)
1014            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1015            * @return the ordered range of matching addresses
1016            * @throws SystemException if a system exception occurred
1017            */
1018            public static java.util.List<com.liferay.portal.model.Address> findByC_C_C_P(
1019                    long companyId, long classNameId, long classPK, boolean primary,
1020                    int start, int end,
1021                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1022                    throws com.liferay.portal.kernel.exception.SystemException {
1023                    return getPersistence()
1024                                       .findByC_C_C_P(companyId, classNameId, classPK, primary,
1025                            start, end, orderByComparator);
1026            }
1027    
1028            /**
1029            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1030            *
1031            * @param companyId the company ID
1032            * @param classNameId the class name ID
1033            * @param classPK the class p k
1034            * @param primary the primary
1035            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1036            * @return the first matching address
1037            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
1038            * @throws SystemException if a system exception occurred
1039            */
1040            public static com.liferay.portal.model.Address findByC_C_C_P_First(
1041                    long companyId, long classNameId, long classPK, boolean primary,
1042                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1043                    throws com.liferay.portal.NoSuchAddressException,
1044                            com.liferay.portal.kernel.exception.SystemException {
1045                    return getPersistence()
1046                                       .findByC_C_C_P_First(companyId, classNameId, classPK,
1047                            primary, orderByComparator);
1048            }
1049    
1050            /**
1051            * Returns the first address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1052            *
1053            * @param companyId the company ID
1054            * @param classNameId the class name ID
1055            * @param classPK the class p k
1056            * @param primary the primary
1057            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1058            * @return the first matching address, or <code>null</code> if a matching address could not be found
1059            * @throws SystemException if a system exception occurred
1060            */
1061            public static com.liferay.portal.model.Address fetchByC_C_C_P_First(
1062                    long companyId, long classNameId, long classPK, boolean primary,
1063                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1064                    throws com.liferay.portal.kernel.exception.SystemException {
1065                    return getPersistence()
1066                                       .fetchByC_C_C_P_First(companyId, classNameId, classPK,
1067                            primary, orderByComparator);
1068            }
1069    
1070            /**
1071            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1072            *
1073            * @param companyId the company ID
1074            * @param classNameId the class name ID
1075            * @param classPK the class p k
1076            * @param primary the primary
1077            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1078            * @return the last matching address
1079            * @throws com.liferay.portal.NoSuchAddressException if a matching address could not be found
1080            * @throws SystemException if a system exception occurred
1081            */
1082            public static com.liferay.portal.model.Address findByC_C_C_P_Last(
1083                    long companyId, long classNameId, long classPK, boolean primary,
1084                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1085                    throws com.liferay.portal.NoSuchAddressException,
1086                            com.liferay.portal.kernel.exception.SystemException {
1087                    return getPersistence()
1088                                       .findByC_C_C_P_Last(companyId, classNameId, classPK,
1089                            primary, orderByComparator);
1090            }
1091    
1092            /**
1093            * Returns the last address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1094            *
1095            * @param companyId the company ID
1096            * @param classNameId the class name ID
1097            * @param classPK the class p k
1098            * @param primary the primary
1099            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1100            * @return the last matching address, or <code>null</code> if a matching address could not be found
1101            * @throws SystemException if a system exception occurred
1102            */
1103            public static com.liferay.portal.model.Address fetchByC_C_C_P_Last(
1104                    long companyId, long classNameId, long classPK, boolean primary,
1105                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1106                    throws com.liferay.portal.kernel.exception.SystemException {
1107                    return getPersistence()
1108                                       .fetchByC_C_C_P_Last(companyId, classNameId, classPK,
1109                            primary, orderByComparator);
1110            }
1111    
1112            /**
1113            * Returns the addresses before and after the current address in the ordered set where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1114            *
1115            * @param addressId the primary key of the current address
1116            * @param companyId the company ID
1117            * @param classNameId the class name ID
1118            * @param classPK the class p k
1119            * @param primary the primary
1120            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
1121            * @return the previous, current, and next address
1122            * @throws com.liferay.portal.NoSuchAddressException if a address with the primary key could not be found
1123            * @throws SystemException if a system exception occurred
1124            */
1125            public static com.liferay.portal.model.Address[] findByC_C_C_P_PrevAndNext(
1126                    long addressId, long companyId, long classNameId, long classPK,
1127                    boolean primary,
1128                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1129                    throws com.liferay.portal.NoSuchAddressException,
1130                            com.liferay.portal.kernel.exception.SystemException {
1131                    return getPersistence()
1132                                       .findByC_C_C_P_PrevAndNext(addressId, companyId,
1133                            classNameId, classPK, primary, orderByComparator);
1134            }
1135    
1136            /**
1137            * Returns all the addresses.
1138            *
1139            * @return the addresses
1140            * @throws SystemException if a system exception occurred
1141            */
1142            public static java.util.List<com.liferay.portal.model.Address> findAll()
1143                    throws com.liferay.portal.kernel.exception.SystemException {
1144                    return getPersistence().findAll();
1145            }
1146    
1147            /**
1148            * Returns a range of all the addresses.
1149            *
1150            * <p>
1151            * 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.
1152            * </p>
1153            *
1154            * @param start the lower bound of the range of addresses
1155            * @param end the upper bound of the range of addresses (not inclusive)
1156            * @return the range of addresses
1157            * @throws SystemException if a system exception occurred
1158            */
1159            public static java.util.List<com.liferay.portal.model.Address> findAll(
1160                    int start, int end)
1161                    throws com.liferay.portal.kernel.exception.SystemException {
1162                    return getPersistence().findAll(start, end);
1163            }
1164    
1165            /**
1166            * Returns an ordered range of all the addresses.
1167            *
1168            * <p>
1169            * 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.
1170            * </p>
1171            *
1172            * @param start the lower bound of the range of addresses
1173            * @param end the upper bound of the range of addresses (not inclusive)
1174            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
1175            * @return the ordered range of addresses
1176            * @throws SystemException if a system exception occurred
1177            */
1178            public static java.util.List<com.liferay.portal.model.Address> findAll(
1179                    int start, int end,
1180                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
1181                    throws com.liferay.portal.kernel.exception.SystemException {
1182                    return getPersistence().findAll(start, end, orderByComparator);
1183            }
1184    
1185            /**
1186            * Removes all the addresses where companyId = &#63; from the database.
1187            *
1188            * @param companyId the company ID
1189            * @throws SystemException if a system exception occurred
1190            */
1191            public static void removeByCompanyId(long companyId)
1192                    throws com.liferay.portal.kernel.exception.SystemException {
1193                    getPersistence().removeByCompanyId(companyId);
1194            }
1195    
1196            /**
1197            * Removes all the addresses where userId = &#63; from the database.
1198            *
1199            * @param userId the user ID
1200            * @throws SystemException if a system exception occurred
1201            */
1202            public static void removeByUserId(long userId)
1203                    throws com.liferay.portal.kernel.exception.SystemException {
1204                    getPersistence().removeByUserId(userId);
1205            }
1206    
1207            /**
1208            * Removes all the addresses where companyId = &#63; and classNameId = &#63; from the database.
1209            *
1210            * @param companyId the company ID
1211            * @param classNameId the class name ID
1212            * @throws SystemException if a system exception occurred
1213            */
1214            public static void removeByC_C(long companyId, long classNameId)
1215                    throws com.liferay.portal.kernel.exception.SystemException {
1216                    getPersistence().removeByC_C(companyId, classNameId);
1217            }
1218    
1219            /**
1220            * Removes all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; from the database.
1221            *
1222            * @param companyId the company ID
1223            * @param classNameId the class name ID
1224            * @param classPK the class p k
1225            * @throws SystemException if a system exception occurred
1226            */
1227            public static void removeByC_C_C(long companyId, long classNameId,
1228                    long classPK)
1229                    throws com.liferay.portal.kernel.exception.SystemException {
1230                    getPersistence().removeByC_C_C(companyId, classNameId, classPK);
1231            }
1232    
1233            /**
1234            * Removes all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63; from the database.
1235            *
1236            * @param companyId the company ID
1237            * @param classNameId the class name ID
1238            * @param classPK the class p k
1239            * @param mailing the mailing
1240            * @throws SystemException if a system exception occurred
1241            */
1242            public static void removeByC_C_C_M(long companyId, long classNameId,
1243                    long classPK, boolean mailing)
1244                    throws com.liferay.portal.kernel.exception.SystemException {
1245                    getPersistence()
1246                            .removeByC_C_C_M(companyId, classNameId, classPK, mailing);
1247            }
1248    
1249            /**
1250            * Removes all the addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63; from the database.
1251            *
1252            * @param companyId the company ID
1253            * @param classNameId the class name ID
1254            * @param classPK the class p k
1255            * @param primary the primary
1256            * @throws SystemException if a system exception occurred
1257            */
1258            public static void removeByC_C_C_P(long companyId, long classNameId,
1259                    long classPK, boolean primary)
1260                    throws com.liferay.portal.kernel.exception.SystemException {
1261                    getPersistence()
1262                            .removeByC_C_C_P(companyId, classNameId, classPK, primary);
1263            }
1264    
1265            /**
1266            * Removes all the addresses from the database.
1267            *
1268            * @throws SystemException if a system exception occurred
1269            */
1270            public static void removeAll()
1271                    throws com.liferay.portal.kernel.exception.SystemException {
1272                    getPersistence().removeAll();
1273            }
1274    
1275            /**
1276            * Returns the number of addresses where companyId = &#63;.
1277            *
1278            * @param companyId the company ID
1279            * @return the number of matching addresses
1280            * @throws SystemException if a system exception occurred
1281            */
1282            public static int countByCompanyId(long companyId)
1283                    throws com.liferay.portal.kernel.exception.SystemException {
1284                    return getPersistence().countByCompanyId(companyId);
1285            }
1286    
1287            /**
1288            * Returns the number of addresses where userId = &#63;.
1289            *
1290            * @param userId the user ID
1291            * @return the number of matching addresses
1292            * @throws SystemException if a system exception occurred
1293            */
1294            public static int countByUserId(long userId)
1295                    throws com.liferay.portal.kernel.exception.SystemException {
1296                    return getPersistence().countByUserId(userId);
1297            }
1298    
1299            /**
1300            * Returns the number of addresses where companyId = &#63; and classNameId = &#63;.
1301            *
1302            * @param companyId the company ID
1303            * @param classNameId the class name ID
1304            * @return the number of matching addresses
1305            * @throws SystemException if a system exception occurred
1306            */
1307            public static int countByC_C(long companyId, long classNameId)
1308                    throws com.liferay.portal.kernel.exception.SystemException {
1309                    return getPersistence().countByC_C(companyId, classNameId);
1310            }
1311    
1312            /**
1313            * Returns the number of addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63;.
1314            *
1315            * @param companyId the company ID
1316            * @param classNameId the class name ID
1317            * @param classPK the class p k
1318            * @return the number of matching addresses
1319            * @throws SystemException if a system exception occurred
1320            */
1321            public static int countByC_C_C(long companyId, long classNameId,
1322                    long classPK)
1323                    throws com.liferay.portal.kernel.exception.SystemException {
1324                    return getPersistence().countByC_C_C(companyId, classNameId, classPK);
1325            }
1326    
1327            /**
1328            * Returns the number of addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and mailing = &#63;.
1329            *
1330            * @param companyId the company ID
1331            * @param classNameId the class name ID
1332            * @param classPK the class p k
1333            * @param mailing the mailing
1334            * @return the number of matching addresses
1335            * @throws SystemException if a system exception occurred
1336            */
1337            public static int countByC_C_C_M(long companyId, long classNameId,
1338                    long classPK, boolean mailing)
1339                    throws com.liferay.portal.kernel.exception.SystemException {
1340                    return getPersistence()
1341                                       .countByC_C_C_M(companyId, classNameId, classPK, mailing);
1342            }
1343    
1344            /**
1345            * Returns the number of addresses where companyId = &#63; and classNameId = &#63; and classPK = &#63; and primary = &#63;.
1346            *
1347            * @param companyId the company ID
1348            * @param classNameId the class name ID
1349            * @param classPK the class p k
1350            * @param primary the primary
1351            * @return the number of matching addresses
1352            * @throws SystemException if a system exception occurred
1353            */
1354            public static int countByC_C_C_P(long companyId, long classNameId,
1355                    long classPK, boolean primary)
1356                    throws com.liferay.portal.kernel.exception.SystemException {
1357                    return getPersistence()
1358                                       .countByC_C_C_P(companyId, classNameId, classPK, primary);
1359            }
1360    
1361            /**
1362            * Returns the number of addresses.
1363            *
1364            * @return the number of addresses
1365            * @throws SystemException if a system exception occurred
1366            */
1367            public static int countAll()
1368                    throws com.liferay.portal.kernel.exception.SystemException {
1369                    return getPersistence().countAll();
1370            }
1371    
1372            public static AddressPersistence getPersistence() {
1373                    if (_persistence == null) {
1374                            _persistence = (AddressPersistence)PortalBeanLocatorUtil.locate(AddressPersistence.class.getName());
1375    
1376                            ReferenceRegistry.registerReference(AddressUtil.class,
1377                                    "_persistence");
1378                    }
1379    
1380                    return _persistence;
1381            }
1382    
1383            /**
1384             * @deprecated
1385             */
1386            public void setPersistence(AddressPersistence persistence) {
1387            }
1388    
1389            private static AddressPersistence _persistence;
1390    }