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.model.Country;
020    
021    /**
022     * The persistence interface for the country service.
023     *
024     * <p>
025     * Caching information and settings can be found in <code>portal.properties</code>
026     * </p>
027     *
028     * @author Brian Wing Shun Chan
029     * @see com.liferay.portal.service.persistence.impl.CountryPersistenceImpl
030     * @see CountryUtil
031     * @generated
032     */
033    @ProviderType
034    public interface CountryPersistence extends BasePersistence<Country> {
035            /*
036             * NOTE FOR DEVELOPERS:
037             *
038             * 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.
039             */
040    
041            /**
042            * Returns the country where name = &#63; or throws a {@link NoSuchCountryException} if it could not be found.
043            *
044            * @param name the name
045            * @return the matching country
046            * @throws NoSuchCountryException if a matching country could not be found
047            */
048            public Country findByName(java.lang.String name)
049                    throws com.liferay.portal.NoSuchCountryException;
050    
051            /**
052            * Returns the country where name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
053            *
054            * @param name the name
055            * @return the matching country, or <code>null</code> if a matching country could not be found
056            */
057            public Country fetchByName(java.lang.String name);
058    
059            /**
060            * Returns the country where name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
061            *
062            * @param name the name
063            * @param retrieveFromCache whether to use the finder cache
064            * @return the matching country, or <code>null</code> if a matching country could not be found
065            */
066            public Country fetchByName(java.lang.String name, boolean retrieveFromCache);
067    
068            /**
069            * Removes the country where name = &#63; from the database.
070            *
071            * @param name the name
072            * @return the country that was removed
073            */
074            public Country removeByName(java.lang.String name)
075                    throws com.liferay.portal.NoSuchCountryException;
076    
077            /**
078            * Returns the number of countries where name = &#63;.
079            *
080            * @param name the name
081            * @return the number of matching countries
082            */
083            public int countByName(java.lang.String name);
084    
085            /**
086            * Returns the country where a2 = &#63; or throws a {@link NoSuchCountryException} if it could not be found.
087            *
088            * @param a2 the a2
089            * @return the matching country
090            * @throws NoSuchCountryException if a matching country could not be found
091            */
092            public Country findByA2(java.lang.String a2)
093                    throws com.liferay.portal.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 use 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 com.liferay.portal.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)
137                    throws com.liferay.portal.NoSuchCountryException;
138    
139            /**
140            * Returns the country where a3 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
141            *
142            * @param a3 the a3
143            * @return the matching country, or <code>null</code> if a matching country could not be found
144            */
145            public Country fetchByA3(java.lang.String a3);
146    
147            /**
148            * Returns the country where a3 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
149            *
150            * @param a3 the a3
151            * @param retrieveFromCache whether to use the finder cache
152            * @return the matching country, or <code>null</code> if a matching country could not be found
153            */
154            public Country fetchByA3(java.lang.String a3, boolean retrieveFromCache);
155    
156            /**
157            * Removes the country where a3 = &#63; from the database.
158            *
159            * @param a3 the a3
160            * @return the country that was removed
161            */
162            public Country removeByA3(java.lang.String a3)
163                    throws com.liferay.portal.NoSuchCountryException;
164    
165            /**
166            * Returns the number of countries where a3 = &#63;.
167            *
168            * @param a3 the a3
169            * @return the number of matching countries
170            */
171            public int countByA3(java.lang.String a3);
172    
173            /**
174            * Returns all the countries where active = &#63;.
175            *
176            * @param active the active
177            * @return the matching countries
178            */
179            public java.util.List<Country> findByActive(boolean active);
180    
181            /**
182            * Returns a range of all the countries where active = &#63;.
183            *
184            * <p>
185            * 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.
186            * </p>
187            *
188            * @param active the active
189            * @param start the lower bound of the range of countries
190            * @param end the upper bound of the range of countries (not inclusive)
191            * @return the range of matching countries
192            */
193            public java.util.List<Country> findByActive(boolean active, int start,
194                    int end);
195    
196            /**
197            * Returns an ordered range of all the countries where active = &#63;.
198            *
199            * <p>
200            * 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.
201            * </p>
202            *
203            * @param active the active
204            * @param start the lower bound of the range of countries
205            * @param end the upper bound of the range of countries (not inclusive)
206            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
207            * @return the ordered range of matching countries
208            */
209            public java.util.List<Country> findByActive(boolean active, int start,
210                    int end,
211                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
212    
213            /**
214            * Returns the first country in the ordered set where active = &#63;.
215            *
216            * @param active the active
217            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
218            * @return the first matching country
219            * @throws NoSuchCountryException if a matching country could not be found
220            */
221            public Country findByActive_First(boolean active,
222                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator)
223                    throws com.liferay.portal.NoSuchCountryException;
224    
225            /**
226            * Returns the first country in the ordered set where active = &#63;.
227            *
228            * @param active the active
229            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
230            * @return the first matching country, or <code>null</code> if a matching country could not be found
231            */
232            public Country fetchByActive_First(boolean active,
233                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
234    
235            /**
236            * Returns the last country in the ordered set where active = &#63;.
237            *
238            * @param active the active
239            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
240            * @return the last matching country
241            * @throws NoSuchCountryException if a matching country could not be found
242            */
243            public Country findByActive_Last(boolean active,
244                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator)
245                    throws com.liferay.portal.NoSuchCountryException;
246    
247            /**
248            * Returns the last country in the ordered set where active = &#63;.
249            *
250            * @param active the active
251            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
252            * @return the last matching country, or <code>null</code> if a matching country could not be found
253            */
254            public Country fetchByActive_Last(boolean active,
255                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
256    
257            /**
258            * Returns the countries before and after the current country in the ordered set where active = &#63;.
259            *
260            * @param countryId the primary key of the current country
261            * @param active the active
262            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
263            * @return the previous, current, and next country
264            * @throws NoSuchCountryException if a country with the primary key could not be found
265            */
266            public Country[] findByActive_PrevAndNext(long countryId, boolean active,
267                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator)
268                    throws com.liferay.portal.NoSuchCountryException;
269    
270            /**
271            * Removes all the countries where active = &#63; from the database.
272            *
273            * @param active the active
274            */
275            public void removeByActive(boolean active);
276    
277            /**
278            * Returns the number of countries where active = &#63;.
279            *
280            * @param active the active
281            * @return the number of matching countries
282            */
283            public int countByActive(boolean active);
284    
285            /**
286            * Caches the country in the entity cache if it is enabled.
287            *
288            * @param country the country
289            */
290            public void cacheResult(Country country);
291    
292            /**
293            * Caches the countries in the entity cache if it is enabled.
294            *
295            * @param countries the countries
296            */
297            public void cacheResult(java.util.List<Country> countries);
298    
299            /**
300            * Creates a new country with the primary key. Does not add the country to the database.
301            *
302            * @param countryId the primary key for the new country
303            * @return the new country
304            */
305            public Country create(long countryId);
306    
307            /**
308            * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
309            *
310            * @param countryId the primary key of the country
311            * @return the country that was removed
312            * @throws NoSuchCountryException if a country with the primary key could not be found
313            */
314            public Country remove(long countryId)
315                    throws com.liferay.portal.NoSuchCountryException;
316    
317            public Country updateImpl(Country country);
318    
319            /**
320            * Returns the country with the primary key or throws a {@link NoSuchCountryException} if it could not be found.
321            *
322            * @param countryId the primary key of the country
323            * @return the country
324            * @throws NoSuchCountryException if a country with the primary key could not be found
325            */
326            public Country findByPrimaryKey(long countryId)
327                    throws com.liferay.portal.NoSuchCountryException;
328    
329            /**
330            * Returns the country with the primary key or returns <code>null</code> if it could not be found.
331            *
332            * @param countryId the primary key of the country
333            * @return the country, or <code>null</code> if a country with the primary key could not be found
334            */
335            public Country fetchByPrimaryKey(long countryId);
336    
337            @Override
338            public java.util.Map<java.io.Serializable, Country> fetchByPrimaryKeys(
339                    java.util.Set<java.io.Serializable> primaryKeys);
340    
341            /**
342            * Returns all the countries.
343            *
344            * @return the countries
345            */
346            public java.util.List<Country> findAll();
347    
348            /**
349            * Returns a range of all the countries.
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 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.
353            * </p>
354            *
355            * @param start the lower bound of the range of countries
356            * @param end the upper bound of the range of countries (not inclusive)
357            * @return the range of countries
358            */
359            public java.util.List<Country> findAll(int start, int end);
360    
361            /**
362            * Returns an ordered range of all the countries.
363            *
364            * <p>
365            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link 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.
366            * </p>
367            *
368            * @param start the lower bound of the range of countries
369            * @param end the upper bound of the range of countries (not inclusive)
370            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
371            * @return the ordered range of countries
372            */
373            public java.util.List<Country> findAll(int start, int end,
374                    com.liferay.portal.kernel.util.OrderByComparator<Country> orderByComparator);
375    
376            /**
377            * Removes all the countries from the database.
378            */
379            public void removeAll();
380    
381            /**
382            * Returns the number of countries.
383            *
384            * @return the number of countries
385            */
386            public int countAll();
387    }