001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
020    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
021    import com.liferay.portal.kernel.exception.SystemException;
022    import com.liferay.portal.kernel.util.OrderByComparator;
023    import com.liferay.portal.kernel.util.ReferenceRegistry;
024    import com.liferay.portal.model.Country;
025    import com.liferay.portal.service.ServiceContext;
026    
027    import java.util.List;
028    
029    /**
030     * The persistence utility for the country service. This utility wraps {@link CountryPersistenceImpl} 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.
031     *
032     * <p>
033     * Caching information and settings can be found in <code>portal.properties</code>
034     * </p>
035     *
036     * @author Brian Wing Shun Chan
037     * @see CountryPersistence
038     * @see CountryPersistenceImpl
039     * @generated
040     */
041    @ProviderType
042    public class CountryUtil {
043            /*
044             * NOTE FOR DEVELOPERS:
045             *
046             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
047             */
048    
049            /**
050             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
051             */
052            public static void clearCache() {
053                    getPersistence().clearCache();
054            }
055    
056            /**
057             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
058             */
059            public static void clearCache(Country country) {
060                    getPersistence().clearCache(country);
061            }
062    
063            /**
064             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
065             */
066            public static long countWithDynamicQuery(DynamicQuery dynamicQuery)
067                    throws SystemException {
068                    return getPersistence().countWithDynamicQuery(dynamicQuery);
069            }
070    
071            /**
072             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
073             */
074            public static List<Country> findWithDynamicQuery(DynamicQuery dynamicQuery)
075                    throws SystemException {
076                    return getPersistence().findWithDynamicQuery(dynamicQuery);
077            }
078    
079            /**
080             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
081             */
082            public static List<Country> findWithDynamicQuery(
083                    DynamicQuery dynamicQuery, int start, int end)
084                    throws SystemException {
085                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
086            }
087    
088            /**
089             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
090             */
091            public static List<Country> findWithDynamicQuery(
092                    DynamicQuery dynamicQuery, int start, int end,
093                    OrderByComparator orderByComparator) throws SystemException {
094                    return getPersistence()
095                                       .findWithDynamicQuery(dynamicQuery, start, end,
096                            orderByComparator);
097            }
098    
099            /**
100             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
101             */
102            public static Country update(Country country) throws SystemException {
103                    return getPersistence().update(country);
104            }
105    
106            /**
107             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
108             */
109            public static Country update(Country country, ServiceContext serviceContext)
110                    throws SystemException {
111                    return getPersistence().update(country, serviceContext);
112            }
113    
114            /**
115            * Returns the country where name = &#63; or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
116            *
117            * @param name the name
118            * @return the matching country
119            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
120            * @throws SystemException if a system exception occurred
121            */
122            public static com.liferay.portal.model.Country findByName(
123                    java.lang.String name)
124                    throws com.liferay.portal.NoSuchCountryException,
125                            com.liferay.portal.kernel.exception.SystemException {
126                    return getPersistence().findByName(name);
127            }
128    
129            /**
130            * Returns the country where name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
131            *
132            * @param name the name
133            * @return the matching country, or <code>null</code> if a matching country could not be found
134            * @throws SystemException if a system exception occurred
135            */
136            public static com.liferay.portal.model.Country fetchByName(
137                    java.lang.String name)
138                    throws com.liferay.portal.kernel.exception.SystemException {
139                    return getPersistence().fetchByName(name);
140            }
141    
142            /**
143            * Returns the country where name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
144            *
145            * @param name the name
146            * @param retrieveFromCache whether to use the finder cache
147            * @return the matching country, or <code>null</code> if a matching country could not be found
148            * @throws SystemException if a system exception occurred
149            */
150            public static com.liferay.portal.model.Country fetchByName(
151                    java.lang.String name, boolean retrieveFromCache)
152                    throws com.liferay.portal.kernel.exception.SystemException {
153                    return getPersistence().fetchByName(name, retrieveFromCache);
154            }
155    
156            /**
157            * Removes the country where name = &#63; from the database.
158            *
159            * @param name the name
160            * @return the country that was removed
161            * @throws SystemException if a system exception occurred
162            */
163            public static com.liferay.portal.model.Country removeByName(
164                    java.lang.String name)
165                    throws com.liferay.portal.NoSuchCountryException,
166                            com.liferay.portal.kernel.exception.SystemException {
167                    return getPersistence().removeByName(name);
168            }
169    
170            /**
171            * Returns the number of countries where name = &#63;.
172            *
173            * @param name the name
174            * @return the number of matching countries
175            * @throws SystemException if a system exception occurred
176            */
177            public static int countByName(java.lang.String name)
178                    throws com.liferay.portal.kernel.exception.SystemException {
179                    return getPersistence().countByName(name);
180            }
181    
182            /**
183            * Returns the country where a2 = &#63; or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
184            *
185            * @param a2 the a2
186            * @return the matching country
187            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
188            * @throws SystemException if a system exception occurred
189            */
190            public static com.liferay.portal.model.Country findByA2(java.lang.String a2)
191                    throws com.liferay.portal.NoSuchCountryException,
192                            com.liferay.portal.kernel.exception.SystemException {
193                    return getPersistence().findByA2(a2);
194            }
195    
196            /**
197            * Returns the country where a2 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
198            *
199            * @param a2 the a2
200            * @return the matching country, or <code>null</code> if a matching country could not be found
201            * @throws SystemException if a system exception occurred
202            */
203            public static com.liferay.portal.model.Country fetchByA2(
204                    java.lang.String a2)
205                    throws com.liferay.portal.kernel.exception.SystemException {
206                    return getPersistence().fetchByA2(a2);
207            }
208    
209            /**
210            * Returns the country where a2 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
211            *
212            * @param a2 the a2
213            * @param retrieveFromCache whether to use the finder cache
214            * @return the matching country, or <code>null</code> if a matching country could not be found
215            * @throws SystemException if a system exception occurred
216            */
217            public static com.liferay.portal.model.Country fetchByA2(
218                    java.lang.String a2, boolean retrieveFromCache)
219                    throws com.liferay.portal.kernel.exception.SystemException {
220                    return getPersistence().fetchByA2(a2, retrieveFromCache);
221            }
222    
223            /**
224            * Removes the country where a2 = &#63; from the database.
225            *
226            * @param a2 the a2
227            * @return the country that was removed
228            * @throws SystemException if a system exception occurred
229            */
230            public static com.liferay.portal.model.Country removeByA2(
231                    java.lang.String a2)
232                    throws com.liferay.portal.NoSuchCountryException,
233                            com.liferay.portal.kernel.exception.SystemException {
234                    return getPersistence().removeByA2(a2);
235            }
236    
237            /**
238            * Returns the number of countries where a2 = &#63;.
239            *
240            * @param a2 the a2
241            * @return the number of matching countries
242            * @throws SystemException if a system exception occurred
243            */
244            public static int countByA2(java.lang.String a2)
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    return getPersistence().countByA2(a2);
247            }
248    
249            /**
250            * Returns the country where a3 = &#63; or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
251            *
252            * @param a3 the a3
253            * @return the matching country
254            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
255            * @throws SystemException if a system exception occurred
256            */
257            public static com.liferay.portal.model.Country findByA3(java.lang.String a3)
258                    throws com.liferay.portal.NoSuchCountryException,
259                            com.liferay.portal.kernel.exception.SystemException {
260                    return getPersistence().findByA3(a3);
261            }
262    
263            /**
264            * Returns the country where a3 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
265            *
266            * @param a3 the a3
267            * @return the matching country, or <code>null</code> if a matching country could not be found
268            * @throws SystemException if a system exception occurred
269            */
270            public static com.liferay.portal.model.Country fetchByA3(
271                    java.lang.String a3)
272                    throws com.liferay.portal.kernel.exception.SystemException {
273                    return getPersistence().fetchByA3(a3);
274            }
275    
276            /**
277            * Returns the country where a3 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
278            *
279            * @param a3 the a3
280            * @param retrieveFromCache whether to use the finder cache
281            * @return the matching country, or <code>null</code> if a matching country could not be found
282            * @throws SystemException if a system exception occurred
283            */
284            public static com.liferay.portal.model.Country fetchByA3(
285                    java.lang.String a3, boolean retrieveFromCache)
286                    throws com.liferay.portal.kernel.exception.SystemException {
287                    return getPersistence().fetchByA3(a3, retrieveFromCache);
288            }
289    
290            /**
291            * Removes the country where a3 = &#63; from the database.
292            *
293            * @param a3 the a3
294            * @return the country that was removed
295            * @throws SystemException if a system exception occurred
296            */
297            public static com.liferay.portal.model.Country removeByA3(
298                    java.lang.String a3)
299                    throws com.liferay.portal.NoSuchCountryException,
300                            com.liferay.portal.kernel.exception.SystemException {
301                    return getPersistence().removeByA3(a3);
302            }
303    
304            /**
305            * Returns the number of countries where a3 = &#63;.
306            *
307            * @param a3 the a3
308            * @return the number of matching countries
309            * @throws SystemException if a system exception occurred
310            */
311            public static int countByA3(java.lang.String a3)
312                    throws com.liferay.portal.kernel.exception.SystemException {
313                    return getPersistence().countByA3(a3);
314            }
315    
316            /**
317            * Returns all the countries where active = &#63;.
318            *
319            * @param active the active
320            * @return the matching countries
321            * @throws SystemException if a system exception occurred
322            */
323            public static java.util.List<com.liferay.portal.model.Country> findByActive(
324                    boolean active)
325                    throws com.liferay.portal.kernel.exception.SystemException {
326                    return getPersistence().findByActive(active);
327            }
328    
329            /**
330            * Returns a range of all the countries where active = &#63;.
331            *
332            * <p>
333            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
334            * </p>
335            *
336            * @param active the active
337            * @param start the lower bound of the range of countries
338            * @param end the upper bound of the range of countries (not inclusive)
339            * @return the range of matching countries
340            * @throws SystemException if a system exception occurred
341            */
342            public static java.util.List<com.liferay.portal.model.Country> findByActive(
343                    boolean active, int start, int end)
344                    throws com.liferay.portal.kernel.exception.SystemException {
345                    return getPersistence().findByActive(active, start, end);
346            }
347    
348            /**
349            * Returns an ordered range of all the countries where active = &#63;.
350            *
351            * <p>
352            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
353            * </p>
354            *
355            * @param active the active
356            * @param start the lower bound of the range of countries
357            * @param end the upper bound of the range of countries (not inclusive)
358            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
359            * @return the ordered range of matching countries
360            * @throws SystemException if a system exception occurred
361            */
362            public static java.util.List<com.liferay.portal.model.Country> findByActive(
363                    boolean active, int start, int end,
364                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
365                    throws com.liferay.portal.kernel.exception.SystemException {
366                    return getPersistence()
367                                       .findByActive(active, start, end, orderByComparator);
368            }
369    
370            /**
371            * Returns the first country in the ordered set where active = &#63;.
372            *
373            * @param active the active
374            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
375            * @return the first matching country
376            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
377            * @throws SystemException if a system exception occurred
378            */
379            public static com.liferay.portal.model.Country findByActive_First(
380                    boolean active,
381                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
382                    throws com.liferay.portal.NoSuchCountryException,
383                            com.liferay.portal.kernel.exception.SystemException {
384                    return getPersistence().findByActive_First(active, orderByComparator);
385            }
386    
387            /**
388            * Returns the first country in the ordered set where active = &#63;.
389            *
390            * @param active the active
391            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
392            * @return the first matching country, or <code>null</code> if a matching country could not be found
393            * @throws SystemException if a system exception occurred
394            */
395            public static com.liferay.portal.model.Country fetchByActive_First(
396                    boolean active,
397                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
398                    throws com.liferay.portal.kernel.exception.SystemException {
399                    return getPersistence().fetchByActive_First(active, orderByComparator);
400            }
401    
402            /**
403            * Returns the last country in the ordered set where active = &#63;.
404            *
405            * @param active the active
406            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
407            * @return the last matching country
408            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
409            * @throws SystemException if a system exception occurred
410            */
411            public static com.liferay.portal.model.Country findByActive_Last(
412                    boolean active,
413                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
414                    throws com.liferay.portal.NoSuchCountryException,
415                            com.liferay.portal.kernel.exception.SystemException {
416                    return getPersistence().findByActive_Last(active, orderByComparator);
417            }
418    
419            /**
420            * Returns the last country in the ordered set where active = &#63;.
421            *
422            * @param active the active
423            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
424            * @return the last matching country, or <code>null</code> if a matching country could not be found
425            * @throws SystemException if a system exception occurred
426            */
427            public static com.liferay.portal.model.Country fetchByActive_Last(
428                    boolean active,
429                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
430                    throws com.liferay.portal.kernel.exception.SystemException {
431                    return getPersistence().fetchByActive_Last(active, orderByComparator);
432            }
433    
434            /**
435            * Returns the countries before and after the current country in the ordered set where active = &#63;.
436            *
437            * @param countryId the primary key of the current country
438            * @param active the active
439            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
440            * @return the previous, current, and next country
441            * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found
442            * @throws SystemException if a system exception occurred
443            */
444            public static com.liferay.portal.model.Country[] findByActive_PrevAndNext(
445                    long countryId, boolean active,
446                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
447                    throws com.liferay.portal.NoSuchCountryException,
448                            com.liferay.portal.kernel.exception.SystemException {
449                    return getPersistence()
450                                       .findByActive_PrevAndNext(countryId, active,
451                            orderByComparator);
452            }
453    
454            /**
455            * Removes all the countries where active = &#63; from the database.
456            *
457            * @param active the active
458            * @throws SystemException if a system exception occurred
459            */
460            public static void removeByActive(boolean active)
461                    throws com.liferay.portal.kernel.exception.SystemException {
462                    getPersistence().removeByActive(active);
463            }
464    
465            /**
466            * Returns the number of countries where active = &#63;.
467            *
468            * @param active the active
469            * @return the number of matching countries
470            * @throws SystemException if a system exception occurred
471            */
472            public static int countByActive(boolean active)
473                    throws com.liferay.portal.kernel.exception.SystemException {
474                    return getPersistence().countByActive(active);
475            }
476    
477            /**
478            * Caches the country in the entity cache if it is enabled.
479            *
480            * @param country the country
481            */
482            public static void cacheResult(com.liferay.portal.model.Country country) {
483                    getPersistence().cacheResult(country);
484            }
485    
486            /**
487            * Caches the countries in the entity cache if it is enabled.
488            *
489            * @param countries the countries
490            */
491            public static void cacheResult(
492                    java.util.List<com.liferay.portal.model.Country> countries) {
493                    getPersistence().cacheResult(countries);
494            }
495    
496            /**
497            * Creates a new country with the primary key. Does not add the country to the database.
498            *
499            * @param countryId the primary key for the new country
500            * @return the new country
501            */
502            public static com.liferay.portal.model.Country create(long countryId) {
503                    return getPersistence().create(countryId);
504            }
505    
506            /**
507            * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
508            *
509            * @param countryId the primary key of the country
510            * @return the country that was removed
511            * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found
512            * @throws SystemException if a system exception occurred
513            */
514            public static com.liferay.portal.model.Country remove(long countryId)
515                    throws com.liferay.portal.NoSuchCountryException,
516                            com.liferay.portal.kernel.exception.SystemException {
517                    return getPersistence().remove(countryId);
518            }
519    
520            public static com.liferay.portal.model.Country updateImpl(
521                    com.liferay.portal.model.Country country)
522                    throws com.liferay.portal.kernel.exception.SystemException {
523                    return getPersistence().updateImpl(country);
524            }
525    
526            /**
527            * Returns the country with the primary key or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
528            *
529            * @param countryId the primary key of the country
530            * @return the country
531            * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found
532            * @throws SystemException if a system exception occurred
533            */
534            public static com.liferay.portal.model.Country findByPrimaryKey(
535                    long countryId)
536                    throws com.liferay.portal.NoSuchCountryException,
537                            com.liferay.portal.kernel.exception.SystemException {
538                    return getPersistence().findByPrimaryKey(countryId);
539            }
540    
541            /**
542            * Returns the country with the primary key or returns <code>null</code> if it could not be found.
543            *
544            * @param countryId the primary key of the country
545            * @return the country, or <code>null</code> if a country with the primary key could not be found
546            * @throws SystemException if a system exception occurred
547            */
548            public static com.liferay.portal.model.Country fetchByPrimaryKey(
549                    long countryId)
550                    throws com.liferay.portal.kernel.exception.SystemException {
551                    return getPersistence().fetchByPrimaryKey(countryId);
552            }
553    
554            /**
555            * Returns all the countries.
556            *
557            * @return the countries
558            * @throws SystemException if a system exception occurred
559            */
560            public static java.util.List<com.liferay.portal.model.Country> findAll()
561                    throws com.liferay.portal.kernel.exception.SystemException {
562                    return getPersistence().findAll();
563            }
564    
565            /**
566            * Returns a range of all the countries.
567            *
568            * <p>
569            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
570            * </p>
571            *
572            * @param start the lower bound of the range of countries
573            * @param end the upper bound of the range of countries (not inclusive)
574            * @return the range of countries
575            * @throws SystemException if a system exception occurred
576            */
577            public static java.util.List<com.liferay.portal.model.Country> findAll(
578                    int start, int end)
579                    throws com.liferay.portal.kernel.exception.SystemException {
580                    return getPersistence().findAll(start, end);
581            }
582    
583            /**
584            * Returns an ordered range of all the countries.
585            *
586            * <p>
587            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.CountryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
588            * </p>
589            *
590            * @param start the lower bound of the range of countries
591            * @param end the upper bound of the range of countries (not inclusive)
592            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
593            * @return the ordered range of countries
594            * @throws SystemException if a system exception occurred
595            */
596            public static java.util.List<com.liferay.portal.model.Country> findAll(
597                    int start, int end,
598                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
599                    throws com.liferay.portal.kernel.exception.SystemException {
600                    return getPersistence().findAll(start, end, orderByComparator);
601            }
602    
603            /**
604            * Removes all the countries from the database.
605            *
606            * @throws SystemException if a system exception occurred
607            */
608            public static void removeAll()
609                    throws com.liferay.portal.kernel.exception.SystemException {
610                    getPersistence().removeAll();
611            }
612    
613            /**
614            * Returns the number of countries.
615            *
616            * @return the number of countries
617            * @throws SystemException if a system exception occurred
618            */
619            public static int countAll()
620                    throws com.liferay.portal.kernel.exception.SystemException {
621                    return getPersistence().countAll();
622            }
623    
624            public static CountryPersistence getPersistence() {
625                    if (_persistence == null) {
626                            _persistence = (CountryPersistence)PortalBeanLocatorUtil.locate(CountryPersistence.class.getName());
627    
628                            ReferenceRegistry.registerReference(CountryUtil.class,
629                                    "_persistence");
630                    }
631    
632                    return _persistence;
633            }
634    
635            /**
636             * @deprecated As of 6.2.0
637             */
638            public void setPersistence(CountryPersistence persistence) {
639            }
640    
641            private static CountryPersistence _persistence;
642    }