001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.exception.NoSuchCountryException;
020    import com.liferay.portal.model.Country;
021    
022    /**
023     * The persistence interface for the country service.
024     *
025     * <p>
026     * Caching information and settings can be found in <code>portal.properties</code>
027     * </p>
028     *
029     * @author Brian Wing Shun Chan
030     * @see com.liferay.portal.service.persistence.impl.CountryPersistenceImpl
031     * @see CountryUtil
032     * @generated
033     */
034    @ProviderType
035    public interface CountryPersistence extends BasePersistence<Country> {
036            /*
037             * NOTE FOR DEVELOPERS:
038             *
039             * Never modify or reference this interface directly. Always use {@link CountryUtil} to access the country persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
040             */
041    
042            /**
043            * Returns the country where name = &#63; or throws a {@link NoSuchCountryException} if it could not be found.
044            *
045            * @param name the name
046            * @return the matching country
047            * @throws NoSuchCountryException if a matching country could not be found
048            */
049            public Country findByName(java.lang.String name)
050                    throws NoSuchCountryException;
051    
052            /**
053            * Returns the country where name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
054            *
055            * @param name the name
056            * @return the matching country, or <code>null</code> if a matching country could not be found
057            */
058            public Country fetchByName(java.lang.String name);
059    
060            /**
061            * Returns the country where name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
062            *
063            * @param name the name
064            * @param retrieveFromCache whether to retrieve from the finder cache
065            * @return the matching country, or <code>null</code> if a matching country could not be found
066            */
067            public Country fetchByName(java.lang.String name, boolean retrieveFromCache);
068    
069            /**
070            * Removes the country where name = &#63; from the database.
071            *
072            * @param name the name
073            * @return the country that was removed
074            */
075            public Country removeByName(java.lang.String name)
076                    throws NoSuchCountryException;
077    
078            /**
079            * Returns the number of countries where name = &#63;.
080            *
081            * @param name the name
082            * @return the number of matching countries
083            */
084            public int countByName(java.lang.String name);
085    
086            /**
087            * Returns the country where a2 = &#63; or throws a {@link NoSuchCountryException} if it could not be found.
088            *
089            * @param a2 the a2
090            * @return the matching country
091            * @throws NoSuchCountryException if a matching country could not be found
092            */
093            public Country findByA2(java.lang.String a2) throws NoSuchCountryException;
094    
095            /**
096            * Returns the country where a2 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
097            *
098            * @param a2 the a2
099            * @return the matching country, or <code>null</code> if a matching country could not be found
100            */
101            public Country fetchByA2(java.lang.String a2);
102    
103            /**
104            * Returns the country where a2 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
105            *
106            * @param a2 the a2
107            * @param retrieveFromCache whether to retrieve from the finder cache
108            * @return the matching country, or <code>null</code> if a matching country could not be found
109            */
110            public Country fetchByA2(java.lang.String a2, boolean retrieveFromCache);
111    
112            /**
113            * Removes the country where a2 = &#63; from the database.
114            *
115            * @param a2 the a2
116            * @return the country that was removed
117            */
118            public Country removeByA2(java.lang.String a2)
119                    throws NoSuchCountryException;
120    
121            /**
122            * Returns the number of countries where a2 = &#63;.
123            *
124            * @param a2 the a2
125            * @return the number of matching countries
126            */
127            public int countByA2(java.lang.String a2);
128    
129            /**
130            * Returns the country where a3 = &#63; or throws a {@link NoSuchCountryException} if it could not be found.
131            *
132            * @param a3 the a3
133            * @return the matching country
134            * @throws NoSuchCountryException if a matching country could not be found
135            */
136            public Country findByA3(java.lang.String a3) throws NoSuchCountryException;
137    
138            /**
139            * Returns the country where a3 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
140            *
141            * @param a3 the a3
142            * @return the matching country, or <code>null</code> if a matching country could not be found
143            */
144            public Country fetchByA3(java.lang.String a3);
145    
146            /**
147            * Returns the country where a3 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
148            *
149            * @param a3 the a3
150            * @param retrieveFromCache whether to retrieve from the finder cache
151            * @return the matching country, or <code>null</code> if a matching country could not be found
152            */
153            public Country fetchByA3(java.lang.String a3, boolean retrieveFromCache);
154    
155            /**
156            * Removes the country where a3 = &#63; from the database.
157            *
158            * @param a3 the a3
159            * @return the country that was removed
160            */
161            public Country removeByA3(java.lang.String a3)
162                    throws NoSuchCountryException;
163    
164            /**
165            * Returns the number of countries where a3 = &#63;.
166            *
167            * @param a3 the a3
168            * @return the number of matching countries
169            */
170            public int countByA3(java.lang.String a3);
171    
172            /**
173            * Returns all the countries where active = &#63;.
174            *
175            * @param active the active
176            * @return the matching countries
177            */
178            public java.util.List<Country> findByActive(boolean active);
179    
180            /**
181            * Returns a range of all the countries where active = &#63;.
182            *
183            * <p>
184            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
185            * </p>
186            *
187            * @param active the active
188            * @param start the lower bound of the range of countries
189            * @param end the upper bound of the range of countries (not inclusive)
190            * @return the range of matching countries
191            */
192            public java.util.List<Country> findByActive(boolean active, int start,
193                    int end);
194    
195            /**
196            * Returns an ordered range of all the countries where active = &#63;.
197            *
198            * <p>
199            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
200            * </p>
201            *
202            * @param active the active
203            * @param start the lower bound of the range of countries
204            * @param end the upper bound of the range of countries (not inclusive)
205            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
206            * @return the ordered range of matching countries
207            */
208            public java.util.List<Country> findByActive(boolean active, int start,
209                    int end,
210                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
211    
212            /**
213            * Returns an ordered range of all the countries where active = &#63;.
214            *
215            * <p>
216            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
217            * </p>
218            *
219            * @param active the active
220            * @param start the lower bound of the range of countries
221            * @param end the upper bound of the range of countries (not inclusive)
222            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
223            * @param retrieveFromCache whether to retrieve from the finder cache
224            * @return the ordered range of matching countries
225            */
226            public java.util.List<Country> findByActive(boolean active, int start,
227                    int end,
228                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator,
229                    boolean retrieveFromCache);
230    
231            /**
232            * Returns the first country in the ordered set where active = &#63;.
233            *
234            * @param active the active
235            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
236            * @return the first matching country
237            * @throws NoSuchCountryException if a matching country could not be found
238            */
239            public Country findByActive_First(boolean active,
240                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator)
241                    throws NoSuchCountryException;
242    
243            /**
244            * Returns the first country in the ordered set where active = &#63;.
245            *
246            * @param active the active
247            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
248            * @return the first matching country, or <code>null</code> if a matching country could not be found
249            */
250            public Country fetchByActive_First(boolean active,
251                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
252    
253            /**
254            * Returns the last country in the ordered set where active = &#63;.
255            *
256            * @param active the active
257            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
258            * @return the last matching country
259            * @throws NoSuchCountryException if a matching country could not be found
260            */
261            public Country findByActive_Last(boolean active,
262                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator)
263                    throws NoSuchCountryException;
264    
265            /**
266            * Returns the last country in the ordered set where active = &#63;.
267            *
268            * @param active the active
269            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
270            * @return the last matching country, or <code>null</code> if a matching country could not be found
271            */
272            public Country fetchByActive_Last(boolean active,
273                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
274    
275            /**
276            * Returns the countries before and after the current country in the ordered set where active = &#63;.
277            *
278            * @param countryId the primary key of the current country
279            * @param active the active
280            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
281            * @return the previous, current, and next country
282            * @throws NoSuchCountryException if a country with the primary key could not be found
283            */
284            public Country[] findByActive_PrevAndNext(long countryId, boolean active,
285                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator)
286                    throws NoSuchCountryException;
287    
288            /**
289            * Removes all the countries where active = &#63; from the database.
290            *
291            * @param active the active
292            */
293            public void removeByActive(boolean active);
294    
295            /**
296            * Returns the number of countries where active = &#63;.
297            *
298            * @param active the active
299            * @return the number of matching countries
300            */
301            public int countByActive(boolean active);
302    
303            /**
304            * Caches the country in the entity cache if it is enabled.
305            *
306            * @param country the country
307            */
308            public void cacheResult(Country country);
309    
310            /**
311            * Caches the countries in the entity cache if it is enabled.
312            *
313            * @param countries the countries
314            */
315            public void cacheResult(java.util.List<Country> countries);
316    
317            /**
318            * Creates a new country with the primary key. Does not add the country to the database.
319            *
320            * @param countryId the primary key for the new country
321            * @return the new country
322            */
323            public Country create(long countryId);
324    
325            /**
326            * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
327            *
328            * @param countryId the primary key of the country
329            * @return the country that was removed
330            * @throws NoSuchCountryException if a country with the primary key could not be found
331            */
332            public Country remove(long countryId) throws NoSuchCountryException;
333    
334            public Country updateImpl(Country country);
335    
336            /**
337            * Returns the country with the primary key or throws a {@link NoSuchCountryException} if it could not be found.
338            *
339            * @param countryId the primary key of the country
340            * @return the country
341            * @throws NoSuchCountryException if a country with the primary key could not be found
342            */
343            public Country findByPrimaryKey(long countryId)
344                    throws NoSuchCountryException;
345    
346            /**
347            * Returns the country with the primary key or returns <code>null</code> if it could not be found.
348            *
349            * @param countryId the primary key of the country
350            * @return the country, or <code>null</code> if a country with the primary key could not be found
351            */
352            public Country fetchByPrimaryKey(long countryId);
353    
354            @Override
355            public java.util.Map<java.io.Serializable, Country> fetchByPrimaryKeys(
356                    java.util.Set<java.io.Serializable> primaryKeys);
357    
358            /**
359            * Returns all the countries.
360            *
361            * @return the countries
362            */
363            public java.util.List<Country> findAll();
364    
365            /**
366            * Returns a range of all the countries.
367            *
368            * <p>
369            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
370            * </p>
371            *
372            * @param start the lower bound of the range of countries
373            * @param end the upper bound of the range of countries (not inclusive)
374            * @return the range of countries
375            */
376            public java.util.List<Country> findAll(int start, int end);
377    
378            /**
379            * Returns an ordered range of all the countries.
380            *
381            * <p>
382            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
383            * </p>
384            *
385            * @param start the lower bound of the range of countries
386            * @param end the upper bound of the range of countries (not inclusive)
387            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
388            * @return the ordered range of countries
389            */
390            public java.util.List<Country> findAll(int start, int end,
391                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
392    
393            /**
394            * Returns an ordered range of all the countries.
395            *
396            * <p>
397            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link 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.
398            * </p>
399            *
400            * @param start the lower bound of the range of countries
401            * @param end the upper bound of the range of countries (not inclusive)
402            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
403            * @param retrieveFromCache whether to retrieve from the finder cache
404            * @return the ordered range of countries
405            */
406            public java.util.List<Country> findAll(int start, int end,
407                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator,
408                    boolean retrieveFromCache);
409    
410            /**
411            * Removes all the countries from the database.
412            */
413            public void removeAll();
414    
415            /**
416            * Returns the number of countries.
417            *
418            * @return the number of countries
419            */
420            public int countAll();
421    
422            @Override
423            public java.util.Set<java.lang.String> getBadColumnNames();
424    }