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