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